You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by mi...@apache.org on 2024/06/26 22:14:16 UTC

(maven-surefire) branch SUREFIRE-2124 created (now c9c542b46)

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

michaelo pushed a change to branch SUREFIRE-2124
in repository https://gitbox.apache.org/repos/asf/maven-surefire.git


      at c9c542b46 [SUREFIRE-2124] Avoid creating unnecessary target files for pom projects

This branch includes the following new commits:

     new c9c542b46 [SUREFIRE-2124] Avoid creating unnecessary target files for pom projects

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



(maven-surefire) 01/01: [SUREFIRE-2124] Avoid creating unnecessary target files for pom projects

Posted by mi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

michaelo pushed a commit to branch SUREFIRE-2124
in repository https://gitbox.apache.org/repos/asf/maven-surefire.git

commit c9c542b46362cf57b68036103e062da548337818
Author: Michael Osipov <mi...@apache.org>
AuthorDate: Thu Jun 27 00:14:05 2024 +0200

    [SUREFIRE-2124] Avoid creating unnecessary target files for pom projects
---
 .../java/org/apache/maven/plugin/failsafe/IntegrationTestMojo.java  | 4 +++-
 .../main/java/org/apache/maven/surefire/api/suite/RunResult.java    | 6 +++++-
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/maven-failsafe-plugin/src/main/java/org/apache/maven/plugin/failsafe/IntegrationTestMojo.java b/maven-failsafe-plugin/src/main/java/org/apache/maven/plugin/failsafe/IntegrationTestMojo.java
index cceb79409..07ee1591e 100644
--- a/maven-failsafe-plugin/src/main/java/org/apache/maven/plugin/failsafe/IntegrationTestMojo.java
+++ b/maven-failsafe-plugin/src/main/java/org/apache/maven/plugin/failsafe/IntegrationTestMojo.java
@@ -561,7 +561,9 @@ public class IntegrationTestMojo extends AbstractSurefireMojo {
 
         try {
             Object token = getPluginContext().get(FAILSAFE_IN_PROGRESS_CONTEXT_KEY);
-            writeSummary(summary, summaryFile, token != null);
+            if (!summary.isNoTestsRun()) {
+                writeSummary(summary, summaryFile, token != null);
+            }
         } catch (Exception e) {
             throw new MojoExecutionException(e.getMessage(), e);
         }
diff --git a/surefire-api/src/main/java/org/apache/maven/surefire/api/suite/RunResult.java b/surefire-api/src/main/java/org/apache/maven/surefire/api/suite/RunResult.java
index ceb182aee..8be1df1d0 100644
--- a/surefire-api/src/main/java/org/apache/maven/surefire/api/suite/RunResult.java
+++ b/surefire-api/src/main/java/org/apache/maven/surefire/api/suite/RunResult.java
@@ -86,9 +86,9 @@ public class RunResult {
         this.errors = errors;
         this.failures = failures;
         this.skipped = skipped;
+        this.flakes = flakes;
         this.failure = failure;
         this.timeout = timeout;
-        this.flakes = flakes;
     }
 
     private static String getStackTrace(Exception e) {
@@ -174,6 +174,10 @@ public class RunResult {
         return new RunResult(0, 0, 0, 0);
     }
 
+    public boolean isNoTestsRun() {
+        return completedCount == 0 && errors == 0 && skipped == 0 && flakes == 0 && failure == null && !timeout;
+    }
+
     @Override
     @SuppressWarnings("RedundantIfStatement")
     public boolean equals(Object o) {