You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by rm...@apache.org on 2022/10/06 01:59:48 UTC
[lucene] branch branch_9x updated: make 'gradle coverage' print test coverage summaries. (#11837)
This is an automated email from the ASF dual-hosted git repository.
rmuir pushed a commit to branch branch_9x
in repository https://gitbox.apache.org/repos/asf/lucene.git
The following commit(s) were added to refs/heads/branch_9x by this push:
new a285141b1ec make 'gradle coverage' print test coverage summaries. (#11837)
a285141b1ec is described below
commit a285141b1ec485a317ddf3d13f4b840fd4481459
Author: Robert Muir <rm...@apache.org>
AuthorDate: Wed Oct 5 21:46:20 2022 -0400
make 'gradle coverage' print test coverage summaries. (#11837)
Currently, this task is too silent and just writes HTML reports. It is a
nice improvement to print the summary to the console.
Before:
```
> Task :lucene:analysis:icu:jacocoTestReport
Code coverage report at: /home/rmuir/workspace/lucene/lucene/analysis/icu/build/reports/jacoco/test/html.
```
After:
```
> Task :lucene:analysis:icu:jacocoTestReport
Code coverage report at: /home/rmuir/workspace/lucene/lucene/analysis/icu/build/reports/jacoco/test/html.
> Task :lucene:analysis:icu:jacocoLogTestCoverage
Test Coverage:
- Class Coverage: 100%
- Method Coverage: 87.9%
- Branch Coverage: 82.7%
- Line Coverage: 92.8%
- Instruction Coverage: 92.7%
- Complexity Coverage: 78.8%
```
---
build.gradle | 1 +
gradle/testing/coverage.gradle | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/build.gradle b/build.gradle
index ab621ee7eaf..bb828f8add6 100644
--- a/build.gradle
+++ b/build.gradle
@@ -26,6 +26,7 @@ plugins {
id "de.undercouch.download" version "5.2.0" apply false
id "net.ltgt.errorprone" version "2.0.2" apply false
id 'com.diffplug.spotless' version "6.5.2" apply false
+ id 'org.barfuin.gradle.jacocolog' version "2.0.0" apply false
}
apply from: file('gradle/globals.gradle')
diff --git a/gradle/testing/coverage.gradle b/gradle/testing/coverage.gradle
index 38b23c156f5..66850a2a6ef 100644
--- a/gradle/testing/coverage.gradle
+++ b/gradle/testing/coverage.gradle
@@ -26,7 +26,7 @@ if (withCoverage) {
allprojects {
plugins.withType(JavaPlugin) {
// Apply jacoco once we know the project has a Java plugin too.
- project.plugins.apply("jacoco")
+ project.plugins.apply("org.barfuin.gradle.jacocolog")
// Synthetic task to enable test coverage (and reports).
task coverage() {