Skip to content

Commit 11e4667

Browse files
committed
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'.
1 parent e1141b1 commit 11e4667

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

buildSrc/src/main/groovy/org/elasticsearch/gradle/BuildPlugin.groovy

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,7 @@ class BuildPlugin implements Plugin<Project> {
558558
return {
559559
jvm "${project.runtimeJavaHome}/bin/java"
560560
parallelism System.getProperty('tests.jvms', 'auto')
561-
ifNoTests 'fail'
561+
ifNoTests System.getProperty('tests.ifNoTests', 'fail')
562562
onNonEmptyWorkDirectory 'wipe'
563563
leaveTemporary true
564564

@@ -582,8 +582,6 @@ class BuildPlugin implements Plugin<Project> {
582582
systemProperty 'tests.task', path
583583
systemProperty 'tests.security.manager', 'true'
584584
systemProperty 'jna.nosys', 'true'
585-
// default test sysprop values
586-
systemProperty 'tests.ifNoTests', 'fail'
587585
// TODO: remove setting logging level via system property
588586
systemProperty 'tests.logger.level', 'WARN'
589587
for (Map.Entry<String, String> property : System.properties.entrySet()) {

0 commit comments

Comments
 (0)