This is an automated email from the ASF dual-hosted git repository.
alexey pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kudu.git
The following commit(s) were added to refs/heads/master by this push:
new 7cdc9f7 [java] a property to show output while running a test
7cdc9f7 is described below
commit 7cdc9f7c735efe99b2d39d61ac4034d41473522e
Author: Alexey Serbin <[email protected]>
AuthorDate: Thu May 20 10:31:36 2021 -0700
[java] a property to show output while running a test
While working on non-trivial and relatively long running test scenarios,
I found it's inconvenient that the test output isn't shown while a test
scenario is running. This patch introduces a new command-line property
'showTestOutput' to direct gradle outputting stdout and stderr from the
JVM on the console, so it's possible to do the standard stream
redirection and other stream manipulation in a command line shell.
An example of running a particular test scenario with the output
redirected to the console:
./gradlew -DshowTestOutput cleanTest :kudu-client:test --test ...
By default the property isn't set, so this patch preserves the original
behavior w.r.t. the output of running Java tests.
Change-Id: I82590957004eef427a19f36a32e903012ea220d4
Reviewed-on: http://gerrit.cloudera.org:8080/17479
Tested-by: Kudu Jenkins
Reviewed-by: Bankim Bhavsar <[email protected]>
Reviewed-by: Andrew Wong <[email protected]>
---
java/gradle/tests.gradle | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/java/gradle/tests.gradle b/java/gradle/tests.gradle
index 89ead79..4157c55 100644
--- a/java/gradle/tests.gradle
+++ b/java/gradle/tests.gradle
@@ -20,6 +20,10 @@
// Support parallel unit test execution.
test {
maxParallelForks = propertyWithDefault("maxParallelForks", "1").toInteger()
+ if (propertyExists("showTestOutput")) {
+ // Show stdout and stderr from tests on the console.
+ testLogging.showStandardStreams = true
+ }
}
tasks.withType(Test) {