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 <micha...@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) {