You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by dw...@apache.org on 2019/12/08 20:50:10 UTC
[lucene-solr] 03/04: Add testOpts task and info about it in
tests.txt
This is an automated email from the ASF dual-hosted git repository.
dweiss pushed a commit to branch gradle-master
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git
commit 02c79dd2112d9dfa5c7f97553b0583dbbc6fb43c
Author: Dawid Weiss <da...@carrotsearch.com>
AuthorDate: Sun Dec 8 18:45:41 2019 +0100
Add testOpts task and info about it in tests.txt
---
gradle/testing/randomization.gradle | 7 +++----
help/tests.txt | 10 +++++++++-
2 files changed, 12 insertions(+), 5 deletions(-)
diff --git a/gradle/testing/randomization.gradle b/gradle/testing/randomization.gradle
index 5983a72..84523df 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 09d8c35..9f7a1f8 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
---------