Skip to content

Commit 28b0c2a

Browse files
dweissuschindler
authored andcommitted
LUCENE-9660: add tests.neverUpToDate=true option which, by default, makes test tasks always execute. (#410)
1 parent aa8c976 commit 28b0c2a

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

gradle/testing/defaults-tests.gradle

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ allprojects {
4949
[propName: 'tests.jvmargs',
5050
value: { -> propertyOrEnvOrDefault("tests.jvmargs", "TEST_JVM_ARGS", "-XX:TieredStopAtLevel=1") },
5151
description: "Arguments passed to each forked JVM."],
52+
// Other settings.
53+
[propName: 'tests.neverUpToDate', value: true,
54+
description: "Make test tasks always fail the up-to-date checks (rerun) even if the inputs have not changed."],
5255
]
5356

5457
// Resolves test option's value.
@@ -90,6 +93,11 @@ allprojects {
9093
testOutputsDir = file("${reports.junitXml.destination}/outputs")
9194
}
9295

96+
// LUCENE-9660: Make it possible to always rerun tests, even if they're incrementally up-to-date.
97+
if (resolvedTestOption("tests.neverUpToDate").toBoolean()) {
98+
outputs.upToDateWhen { false }
99+
}
100+
93101
maxParallelForks = resolvedTestOption("tests.jvms") as Integer
94102
if (verboseMode && maxParallelForks != 1) {
95103
logger.lifecycle("tests.jvm forced to 1 in verbose mode.")

0 commit comments

Comments
 (0)