janhoy opened a new pull request, #4712:
URL: https://github.com/apache/solr/pull/4712

   https://issues.apache.org/jira/browse/SOLR-18338
   
   Adds opt-in JaCoCo test coverage to the Gradle build, modeled on the 
equivalent integration in Apache Lucene.
   
   ## What was done
   
   * New `gradle/testing/coverage.gradle`, applied from the root build. 
Coverage is **opt-in**: it activates when running the `coverage` task or 
passing `-Ptests.coverage=true`; regular builds are unaffected.
   * Per module: the built-in `jacoco` plugin instruments the test tasks and 
`jacocoTestReport` produces HTML + XML reports (XML is what CI tooling 
consumes).
   * Root: `jacoco-report-aggregation` provides an aggregated report across all 
modules with tests via `gradlew coverage`.
   * Console summaries via the `org.barfuin.gradle.jacocolog` plugin (same as 
Lucene) — per-module and aggregated coverage percentages are printed at the end 
of the build.
   * Test security policy: granted the jacoco agent write access to its data 
file, so coverage also works when tests run with the security manager enabled.
   * The `tests.coverage` option shows up in `gradlew testOpts`; usage 
documented in `dev-docs/gradle-help/tests.txt`.
   
   ## Usage
   
   ```
   gradlew -p solr/core coverage                    # single module
   open solr/core/build/reports/jacoco/test/html/index.html
   
   gradlew -p solr/core test --tests TestDemo coverage   # with test filtering
   
   gradlew coverage                                 # all tests + aggregated 
report
   open build/reports/jacoco/testCodeCoverageReport/html/index.html
   ```
   
   Follow-up (separate effort): publish nightly coverage from the Jenkins job 
and add PR-level diff-coverage feedback.


-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to