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

houston pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/solr.git


The following commit(s) were added to refs/heads/main by this push:
     new 800da0b20a6 Only apply test failure output logic for Java tests (#3287)
800da0b20a6 is described below

commit 800da0b20a66b90548b85531d063666d92e283e7
Author: Houston Putman <[email protected]>
AuthorDate: Wed Mar 26 11:24:48 2025 -0500

    Only apply test failure output logic for Java tests (#3287)
---
 gradle/testing/defaults-tests.gradle      |  4 ++--
 gradle/testing/failed-tests-at-end.gradle | 18 ++++++++++--------
 2 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/gradle/testing/defaults-tests.gradle 
b/gradle/testing/defaults-tests.gradle
index d1fdbf11858..9eed9572fe2 100644
--- a/gradle/testing/defaults-tests.gradle
+++ b/gradle/testing/defaults-tests.gradle
@@ -23,7 +23,7 @@ def resources = scriptResources(buildscript)
 def verboseModeHookInstalled = false
 
 allprojects {
-  plugins.withType(JavaPlugin) {
+  plugins.withType(JavaPlugin).configureEach {
     project.ext {
       // This array will collect all test options, including default values 
and option description.
       // The actual values of these properties (defaults, project properties) 
are resolved lazily after evaluation
@@ -87,7 +87,7 @@ allprojects {
       }
     }
 
-    tasks.withType(Test) {
+    tasks.withType(Test).configureEach {
       ext {
         testOutputsDir = 
file("${reports.junitXml.outputLocation.get()}/outputs")
       }
diff --git a/gradle/testing/failed-tests-at-end.gradle 
b/gradle/testing/failed-tests-at-end.gradle
index 2a42bac5795..bd5f17b30a6 100644
--- a/gradle/testing/failed-tests-at-end.gradle
+++ b/gradle/testing/failed-tests-at-end.gradle
@@ -34,16 +34,18 @@ def genFailInfo(def task, TestDescriptor desc) {
 }
 
 allprojects {
-  tasks.withType(Test) { Test task ->
-    afterTest { desc, result ->
-      if (result.resultType == TestResult.ResultType.FAILURE) {
-        failedTests << genFailInfo(task, desc)
+  plugins.withType(JavaPlugin).configureEach {
+    tasks.withType(Test).configureEach { Test task ->
+      afterTest { desc, result ->
+        if (result.resultType == TestResult.ResultType.FAILURE) {
+          failedTests << genFailInfo(task, desc)
+        }
       }
-    }
 
-    afterSuite { desc, result ->
-      if (result.exceptions) {
-        failedTests << genFailInfo(task, desc)
+      afterSuite { desc, result ->
+        if (result.exceptions) {
+          failedTests << genFailInfo(task, desc)
+        }
       }
     }
   }

Reply via email to