This is an automated email from the ASF dual-hosted git repository.

alexey pushed a commit to branch branch-1.15.x
in repository https://gitbox.apache.org/repos/asf/kudu.git

commit 915b6c61d994286e8317b7e7c683087c25642179
Author: Alexey Serbin <ale...@apache.org>
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 <ban...@cloudera.com>
    Reviewed-by: Andrew Wong <aw...@cloudera.com>
    (cherry picked from commit 7cdc9f7c735efe99b2d39d61ac4034d41473522e)
    Reviewed-on: http://gerrit.cloudera.org:8080/17494
---
 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) {

Reply via email to