QA: System property to override distribution (#30591)

This configures all `qa` projects to use the distribution contained in
the `tests.distribution` system property if it is set. The goal is to
create a simple way to run tests against the default distribution which
has x-pack basic features enabled while not forcing these tests on all
contributors. You run these tests by doing something like:

```
./gradlew -p qa -Dtests.distribution=zip check
```

or

```
./gradlew -p qa -Dtests.distribution=zip bwcTest
```

x-pack basic *shouldn't* get in the way of any of these tests but
nothing is ever perfect so this we have to disable a few when running
with the zip distribution.
This commit is contained in:
Nik Everett 2018-05-15 17:16:16 -04:00 committed by GitHub
parent 2cb71d0947
commit 869b639d14
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 28 additions and 2 deletions

View File

@ -4,7 +4,7 @@ import org.elasticsearch.gradle.test.RestIntegTestTask
subprojects { Project subproj ->
subproj.tasks.withType(RestIntegTestTask) {
subproj.extensions.configure("${it.name}Cluster") { cluster ->
cluster.distribution = 'oss-zip'
cluster.distribution = System.getProperty('tests.distribution', 'oss-zip')
}
}
}

View File

@ -54,9 +54,16 @@ for (Version version : bwcVersions.wireCompatible) {
bwcTest.dependsOn(versionBwcTest)
}
/* To support taking index snapshots, we have to set path.repo setting */
tasks.getByName("${baseName}#mixedClusterTestRunner").configure {
/* To support taking index snapshots, we have to set path.repo setting */
systemProperty 'tests.path.repo', new File(buildDir, "cluster/shared/repo")
if ('zip'.equals(extension.distribution)) {
systemProperty 'tests.rest.blacklist', [
'cat.templates/10_basic/No templates',
'cat.templates/10_basic/Sort templates',
'cat.templates/10_basic/Multiple template',
].join(',')
}
}
}

View File

@ -27,3 +27,13 @@ integTest {
integTestCluster {
numNodes = 2
}
integTestRunner {
if ('zip'.equals(integTestCluster.distribution)) {
systemProperty 'tests.rest.blacklist', [
'cat.templates/10_basic/No templates',
'cat.templates/10_basic/Sort templates',
'cat.templates/10_basic/Multiple template',
].join(',')
}
}

View File

@ -26,3 +26,11 @@ dependencies {
testCompile project(path: ':modules:lang-mustache', configuration: 'runtime')
}
/*
* One of the integration tests doesn't work with the zip distribution
* and will be fixed later.
* Tracked by https://github.com/elastic/elasticsearch/issues/30628
*/
if ("zip".equals(integTestCluster.distribution)) {
integTestRunner.enabled = false
}

View File

@ -149,6 +149,7 @@ public class ReproduceInfoPrinter extends RunListener {
}
appendOpt("tests.locale", Locale.getDefault().toLanguageTag());
appendOpt("tests.timezone", TimeZone.getDefault().getID());
appendOpt("tests.distribution", System.getProperty("tests.distribution"));
return this;
}