-
Notifications
You must be signed in to change notification settings - Fork 25.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
QA: System property to override distribution #30591
Conversation
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 also adds support for skipping tests based on the distribution. For the yaml tests this looks like: ``` - skip: distribution: zip reason: x-pack includes templates which breaks the output here ``` For java tests it looks something like: ``` assumeFalse("zip".equals(System.getProperty("tests.distribution")), "some reason"); ``` Gradle makes sure to set the `tests.distribution` environment variable when running tests whether or not you override the distribution on the command line. This allows us to remove some `tests.rest.blacklist` settings in `x-pack/qa` because those tests skip themselves based on the distribution. I think this sort of thing substantially reduces the "surprise factor" while working on x-pack.
Pinging @elastic/es-core-infra |
@@ -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') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At first I thought this PR would be just this line. If only things were that simple....
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And now that I've reverted most of the rest, it is almost the only line!
@@ -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")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you override the distribution on the command line then it is important to override it again. If you don't override it on the command line then setting this environment variable does nothing which is fine.
@@ -15,9 +15,6 @@ integTestRunner { | |||
['cat.aliases/10_basic/Empty cluster', | |||
'index/10_with_id/Index with ID', | |||
'indices.get_alias/10_basic/Get alias against closed indices', | |||
'cat.templates/10_basic/No templates', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are skipped by the skip
section in the test now which I find much easier to read.
This is a WIP because I'm still experimenting with it locally. |
I think I could drop the |
On second thought I think I will drop the |
It'd be nice to have it but it'd break clients.
qa/mixed-cluster/build.gradle
Outdated
@@ -57,6 +57,11 @@ for (Version version : bwcVersions.wireCompatible) { | |||
/* To support taking index snapshots, we have to set path.repo setting */ | |||
tasks.getByName("${baseName}#mixedClusterTestRunner").configure { | |||
systemProperty 'tests.path.repo', new File(buildDir, "cluster/shared/repo") | |||
systemProperty 'tests.rest.blacklist', [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, no, this isn't right.
not quite... |
I'm still working through getting a clean run of |
OK! I've got |
OK! I got a successful run of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -26,3 +26,10 @@ dependencies { | |||
testCompile project(path: ':modules:lang-mustache', configuration: 'runtime') | |||
} | |||
|
|||
/* | |||
* One of the integration tests doesn't work with the zip distribution |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you open an issue for this so it is tracked and link it in this code comment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Absolutely.
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 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.
It looks like this was backported. I removed the label. |
…bad-mkay * elastic/6.x: [ML] Wait for ML indices in rolling upgrade tests (elastic#30615) Watcher: Ensure secrets integration tests also run triggered watch (elastic#30478) Move allocation awareness attributes to list setting (elastic#30626) [Docs] Update code snippet in has-child-query.asciidoc (elastic#30510) Allow date math for naming newly-created snapshots (elastic#7939) (elastic#30479) Awaits fix a failing test Switch many QA projects to use new style requests (elastic#30574) QA: System property to override distribution (elastic#30591)
Thanks! |
This configures all
qa
projects to use the distribution contained inthe
tests.distribution
system property if it is set. The goal is tocreate 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:
or
x-pack basic shouldn't get in the way of any of these tests but
nothing is ever perfect so this also adds support for skipping tests
based on the distribution. For the yaml tests this looks like:
For java tests it looks something like:
Gradle makes sure to set the
tests.distribution
environment variablewhen running tests whether or not you override the distribution on the
command line. This allows us to remove some
tests.rest.blacklist
settings in
x-pack/qa
because those tests skip themselves based on thedistribution. I think this sort of thing substantially reduces the
"surprise factor" while working on x-pack.