Build: Fix ability to ignore when no tests are run (#28930)
Running any randomized testing task within Elasticsearch currently fails if a project has zero tests. This was supposed to be overrideable, but it was always set to 'fail', and the system property to override was passed down to the test runner, but never read there. This commit changes the value of the ifNoTests setting to randomized runner to be read from system properties and continue to default to 'fail'.
This commit is contained in:
parent
9709d89daf
commit
d972db7eb7
|
@ -558,7 +558,7 @@ class BuildPlugin implements Plugin<Project> {
|
||||||
return {
|
return {
|
||||||
jvm "${project.runtimeJavaHome}/bin/java"
|
jvm "${project.runtimeJavaHome}/bin/java"
|
||||||
parallelism System.getProperty('tests.jvms', 'auto')
|
parallelism System.getProperty('tests.jvms', 'auto')
|
||||||
ifNoTests 'fail'
|
ifNoTests System.getProperty('tests.ifNoTests', 'fail')
|
||||||
onNonEmptyWorkDirectory 'wipe'
|
onNonEmptyWorkDirectory 'wipe'
|
||||||
leaveTemporary true
|
leaveTemporary true
|
||||||
|
|
||||||
|
@ -582,8 +582,6 @@ class BuildPlugin implements Plugin<Project> {
|
||||||
systemProperty 'tests.task', path
|
systemProperty 'tests.task', path
|
||||||
systemProperty 'tests.security.manager', 'true'
|
systemProperty 'tests.security.manager', 'true'
|
||||||
systemProperty 'jna.nosys', 'true'
|
systemProperty 'jna.nosys', 'true'
|
||||||
// default test sysprop values
|
|
||||||
systemProperty 'tests.ifNoTests', 'fail'
|
|
||||||
// TODO: remove setting logging level via system property
|
// TODO: remove setting logging level via system property
|
||||||
systemProperty 'tests.logger.level', 'WARN'
|
systemProperty 'tests.logger.level', 'WARN'
|
||||||
for (Map.Entry<String, String> property : System.properties.entrySet()) {
|
for (Map.Entry<String, String> property : System.properties.entrySet()) {
|
||||||
|
|
Loading…
Reference in New Issue