Skip to content

Apache Lucene open-source search software

Add testOpts task and info about it in tests.txt

Dawid Weiss02c79dd2112d
diff --git a/gradle/testing/randomization.gradle b/gradle/testing/randomization.gradle
index 5983a7275d7..84523df0487 100644
--- a/gradle/testing/randomization.gradle
+++ b/gradle/testing/randomization.gradle
@@ -63,7 +63,7 @@ allprojects {
// asserts, debug output.
[propName: 'tests.asserts', value: "true", description: "Enables or disables assertions mode."],
[propName: 'tests.verbose', value: false, description: "Emit verbose debug information from tests."],
- [propName: 'tests.infostream', value: null, description: "Enables or disables infostream logs."],
+ [propName: 'tests.infostream', value: false, description: "Enables or disables infostream logs."],
[propName: 'tests.leaveTemporary', value: null, description: "Leave temporary directories after tests complete."],
[propName: 'tests.useSecurityManager', value: false, description: "Enable security manager in tests.", buildOnly: true],
// component randomization
@@ -118,7 +118,6 @@ allprojects {
}
// These are not official options or dynamically seed-derived options.
- testOptionsResolved['tests.infostream'] = propertyOrDefault('tests.infostream', testOptionsResolved['tests.verbose'])
if (testOptionsResolved['tests.file.encoding'] == 'random') {
testOptionsResolved['tests.file.encoding'] = RandomPicks.randomFrom(
new Random(projectSeedLong), [
@@ -188,7 +187,7 @@ allprojects {
// and descriptions.
allprojects {
plugins.withType(JavaPlugin) {
- task helpTestOpts() {
+ task testOpts() {
group = 'Help (developer guides and hints)'
description = "Display values of randomization settings for a given seed"
@@ -196,7 +195,7 @@ allprojects {
println "Test options for project ${project.path} and seed \"${rootSeed}\":"
testOptions.sort { a, b -> a.propName.compareTo(b.propName) }.each { opt ->
- def defValue = opt.value
+ def defValue = Objects.toString(opt.value, null)
def value = testOptionsResolved[opt.propName]
println String.format(Locale.ROOT,
"%s%-23s = %-8s # %s",
diff --git a/help/tests.txt b/help/tests.txt
index 09d8c35464e..9f7a1f8c23e 100644
--- a/help/tests.txt
+++ b/help/tests.txt
@@ -30,10 +30,18 @@ gradlew -p lucene/core check # By folder designation + task
Randomization
-------------
-Run tests with the given starting seed:
+To run tests with the given starting seed pass 'tests.seed'
+property:
gradlew :lucene:misc:test -Ptests.seed=DEADBEEF
+There are a lot of other test randomization properties
+available. To list them, their defaults and current values
+run the testOpts task against a project that has tests.
+For example:
+
+gradlew -p lucene/core testOpts
+
Filtering
---------