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

Abacn pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/beam.git


The following commit(s) were added to refs/heads/master by this push:
     new 627d7fbb3fd Reduce Gradle build and test log spam in Java CI workflows 
(#40458)
627d7fbb3fd is described below

commit 627d7fbb3fdddbe1a23f25bf5847b581619d454f
Author: Yi Hu <[email protected]>
AuthorDate: Thu Oct 8 15:16:10 2026 -0400

    Reduce Gradle build and test log spam in Java CI workflows (#40458)
    
    * Reduce Gradle build and test log spam in Java CI workflows
    
    - Remove `'passed'` from default `testLogging` events in `BeamModulePlugin` 
so only skipped/failed tests and per-task summaries are logged.
    
    - Downgrade the CI Maven Central mirror log message from `lifecycle` to 
`debug` in `Repositories.groovy` and `settings.gradle.kts` to avoid repeating 
it for every subproject.
    
    - Remove `showStandardStreams = true` and `outputs.upToDateWhen {false}` 
overrides from `needsRunnerTests` and `examplesIntegrationTest` in 
`:runners:direct-java`, `:sdks:java:io:debezium`
---
 .../groovy/org/apache/beam/gradle/BeamModulePlugin.groovy | 15 +++++++--------
 .../groovy/org/apache/beam/gradle/Repositories.groovy     |  2 +-
 runners/direct-java/build.gradle                          |  7 -------
 sdks/java/io/debezium/build.gradle                        |  6 ------
 settings.gradle.kts                                       |  2 +-
 5 files changed, 9 insertions(+), 23 deletions(-)

diff --git 
a/buildSrc/src/main/groovy/org/apache/beam/gradle/BeamModulePlugin.groovy 
b/buildSrc/src/main/groovy/org/apache/beam/gradle/BeamModulePlugin.groovy
index 1453b63b2f2..3b93abfcc9e 100644
--- a/buildSrc/src/main/groovy/org/apache/beam/gradle/BeamModulePlugin.groovy
+++ b/buildSrc/src/main/groovy/org/apache/beam/gradle/BeamModulePlugin.groovy
@@ -1265,15 +1265,14 @@ class BeamModulePlugin implements Plugin<Project> {
         if (System.getProperty("os.name").toLowerCase().contains("windows")) {
           systemProperty 'org.xerial.snappy.tempdir', 
System.getProperty('org.xerial.snappy.tempdir') ?: 
"${project.rootDir.absolutePath}/build/snappy_bin"
         }
-        // Report each test as it runs, plus a per-task summary. Gradle logs 
only
-        // failures by default, so a passing run prints nothing but "BUILD 
SUCCESSFUL"
-        // and gives no indication of which tests --tests actually selected.
-        // Test stdout/stderr stays off unless asked for, since it is noisy:
-        //   -PshowTestOutput   also forward test stdout/stderr
-        // A cached or up-to-date test task forks no JVM and prints nothing;
-        // add --no-build-cache --rerun to force real execution.
+        // Log skipped and failed tests, plus a per-task summary.
+        // Pass -PshowTestOutput to also forward test stdout/stderr.
+        // Pass -PshowTestPassed to also log passed tests.
         testLogging {
-          events 'passed', 'skipped', 'failed'
+          events 'skipped', 'failed'
+          if (project.hasProperty('showTestPassed')) {
+            events 'passed'
+          }
           exceptionFormat = 'full'
           showExceptions = true
           showCauses = true
diff --git 
a/buildSrc/src/main/groovy/org/apache/beam/gradle/Repositories.groovy 
b/buildSrc/src/main/groovy/org/apache/beam/gradle/Repositories.groovy
index e154fc6ea7a..a8d66f4ff4e 100644
--- a/buildSrc/src/main/groovy/org/apache/beam/gradle/Repositories.groovy
+++ b/buildSrc/src/main/groovy/org/apache/beam/gradle/Repositories.groovy
@@ -27,7 +27,7 @@ class Repositories {
     def useMirror = isCi && mirrorUrl
 
     if (useMirror) {
-      project.logger.lifecycle("Running in CI. Mirroring Maven Central 
repositories via Google Maven Mirror.")
+      project.logger.debug("Running in CI. Mirroring Maven Central 
repositories via Google Maven Mirror.")
     }
 
     project.repositories {
diff --git a/runners/direct-java/build.gradle b/runners/direct-java/build.gradle
index 547f49ce910..96a0218e60d 100644
--- a/runners/direct-java/build.gradle
+++ b/runners/direct-java/build.gradle
@@ -121,7 +121,6 @@ task needsRunnerTests(type: Test) {
   description = "Runs tests that require a runner to validate that 
pipelines/transforms work correctly"
 
   maxParallelForks 4
-  testLogging.showStandardStreams = true
 
   String[] pipelineOptions = ["--runner=DirectRunner", 
"--runnerDeterminedSharding=false"]
   systemProperty "beamTestPipelineOptions", 
pipelineOptionsStringCrossPlatformHandling(pipelineOptions)
@@ -148,10 +147,6 @@ task needsRunnerTests(type: Test) {
     excludeCategories "org.apache.beam.sdk.testing.UsesExternalService"
     excludeCategories 'org.apache.beam.sdk.testing.UsesBundleFinalizer'
   }
-  testLogging {
-    outputs.upToDateWhen {false}
-    showStandardStreams = true
-  }
 }
 
 // NOTE: This will also run 'NeedsRunner' tests, which are run in the 
:needsRunnerTests task as well.
@@ -223,8 +218,6 @@ createJavaExamplesArchetypeValidationTask(type: 
'MobileGaming',
 task examplesIntegrationTest(type: Test) {
   description = "Runs examples tests on DirectRunner"
 
-  testLogging.showStandardStreams = true
-
   String[] pipelineOptions = [
           "--runner=DirectRunner",
           "--runnerDeterminedSharding=false",
diff --git a/sdks/java/io/debezium/build.gradle 
b/sdks/java/io/debezium/build.gradle
index ad5410b37de..4dbab262734 100644
--- a/sdks/java/io/debezium/build.gradle
+++ b/sdks/java/io/debezium/build.gradle
@@ -113,13 +113,7 @@ def configureTestJvmArgs(Task task) {
 }
 
 test {
-    testLogging {
-        outputs.upToDateWhen {false}
-        showStandardStreams = true
-        exceptionFormat = 'full'
-    }
     configureTestJvmArgs(delegate)
-
 }
 
 task integrationTest(type: Test, dependsOn: processTestResources) {
diff --git a/settings.gradle.kts b/settings.gradle.kts
index 2681148095d..ffbe40365c1 100644
--- a/settings.gradle.kts
+++ b/settings.gradle.kts
@@ -23,7 +23,7 @@ pluginManagement {
     val useMirror = isCi && !mavenCentralMirrorUrl.isNullOrBlank()
 
     if (useMirror) {
-        logger.lifecycle("Running in CI. Mirroring Maven Central repositories 
via Google Maven Mirror.")
+        logger.debug("Running in CI. Mirroring Maven Central repositories via 
Google Maven Mirror.")
     }
 
     repositories {

Reply via email to