LUCENE-9660: add tests.neverUpToDate=true option which, by default, makes test tasks always execute. (#410)

This commit is contained in:
Dawid Weiss 2021-10-25 14:51:11 +02:00 committed by GitHub
parent 2719cf6630
commit 81f5b4d642
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 0 deletions

View File

@ -49,6 +49,9 @@ allprojects {
[propName: 'tests.jvmargs', [propName: 'tests.jvmargs',
value: { -> propertyOrEnvOrDefault("tests.jvmargs", "TEST_JVM_ARGS", "-XX:TieredStopAtLevel=1") }, value: { -> propertyOrEnvOrDefault("tests.jvmargs", "TEST_JVM_ARGS", "-XX:TieredStopAtLevel=1") },
description: "Arguments passed to each forked JVM."], description: "Arguments passed to each forked JVM."],
// Other settings.
[propName: 'tests.neverUpToDate', value: true,
description: "Make test tasks always fail the up-to-date checks (rerun) even if the inputs have not changed."],
] ]
// Resolves test option's value. // Resolves test option's value.
@ -90,6 +93,11 @@ allprojects {
testOutputsDir = file("${reports.junitXml.destination}/outputs") testOutputsDir = file("${reports.junitXml.destination}/outputs")
} }
// LUCENE-9660: Make it possible to always rerun tests, even if they're incrementally up-to-date.
if (resolvedTestOption("tests.neverUpToDate").toBoolean()) {
outputs.upToDateWhen { false }
}
maxParallelForks = resolvedTestOption("tests.jvms") as Integer maxParallelForks = resolvedTestOption("tests.jvms") as Integer
if (verboseMode && maxParallelForks != 1) { if (verboseMode && maxParallelForks != 1) {
logger.lifecycle("tests.jvm forced to 1 in verbose mode.") logger.lifecycle("tests.jvm forced to 1 in verbose mode.")