You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by GitBox <gi...@apache.org> on 2021/02/09 13:49:09 UTC

[GitHub] [camel] bthdimension commented on a change in pull request #5057: CAMEL-16153: Added overall coverage threshold (across all routes) to camel-report-maven-plugin

bthdimension commented on a change in pull request #5057:
URL: https://github.com/apache/camel/pull/5057#discussion_r572897395



##########
File path: catalog/camel-report-maven-plugin/src/main/java/org/apache/camel/maven/RouteCoverageMojo.java
##########
@@ -319,8 +332,16 @@ public void execute() throws MojoExecutionException, MojoFailureException {
             }
         }
 
+        // compute and log overall coverage across routes
+        AtomicBoolean overallCoverageAboveThreshold = new AtomicBoolean();
+        String out = templateOverallCoverageData(coveredNodes.get(), totalNumberOfNodes, overallCoverageAboveThreshold);
+        getLog().info("Overall coverage summary:\n\n" + out);
+        getLog().info("");

Review comment:
       These lines show the overall test coverage in the same style as the pre-existing code already showed it on a per-route-basis. It allows to also set an overall threshold and then fail if the overall coverage is below that.
   This looks like this:
   ```
   [INFO] Overall coverage summary:
   
   Coverage: 22 out of 23 (95.7% / threshold 95.0%)
   Status: Success
   ```
   
   This is useful if you have dozens of routes with some only doing some minor debug logging or similar trivial things. Before, you could only set a threshold on a per-route-basis, e.g. all routes need to be covered at least 90%. At least for us, that would be very tedious, as we would have to cover each of the more trivial routes fully instead of setting an overall threshold.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org