Skip to content

Commit

Permalink
QA: System property to override distribution (#30591)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
nik9000 committed May 16, 2018
1 parent d45ef00 commit 32c7b06
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 2 deletions.
2 changes: 1 addition & 1 deletion qa/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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')
}
}
}
9 changes: 8 additions & 1 deletion qa/mixed-cluster/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,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(',')
}
}
}

Expand Down
10 changes: 10 additions & 0 deletions qa/smoke-test-multinode/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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(',')
}
}
8 changes: 8 additions & 0 deletions qa/smoke-test-rank-eval-with-mustache/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ public ReproduceErrorMessageBuilder appendESProperties() {
}
appendOpt("tests.locale", Locale.getDefault().toLanguageTag());
appendOpt("tests.timezone", TimeZone.getDefault().getID());
appendOpt("tests.distribution", System.getProperty("tests.distribution"));
return this;
}

Expand Down

0 comments on commit 32c7b06

Please sign in to comment.