Add JaCoCo code coverage reporting with Codecov integration#1285
Conversation
- Add jacoco-maven-plugin 0.8.12 to pom.xml with prepare-agent and report executions - Exclude dictgenerator from coverage report - Wire argLine into maven-surefire-plugin so JaCoCo agent is activated during tests - Add test-coverage GitHub Actions job that runs tests and uploads to Codecov
... it is done on the nightly build.
Added Codecov badge to README for coverage tracking.
|
@copilot is there the possibility to only create the coverage report selectively, i.e. on the nightly build? |
…ightly build
- Add default empty argLine property so surefire @{argLine} expands safely without the profile
- Move jacoco-maven-plugin (prepare-agent + report) into a new coverage profile
- Activate -Pcoverage only on the nightly Build SNAPSHOT step
Yes — JaCoCo is now gated behind a
|
Fixed in the latest commit. The edit that moved JaCoCo into a profile accidentally dropped the |
Welcome to Codecov 🎉Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests. Thanks for integrating Codecov - We've got you covered ☂️ |
|
@copilot please move the codecov upload from the nightly build to the normal maven.yml. I think it needs to be there to correctly analyze PRs. |
Done. A dedicated |
|
@copilot please change maven.yml so that there is no separate job where coverage data is uploaded. Instead, use only the "ubuntu-latest" job on JDK 21 for uploading coverage data. Coverage data can be generated on each job, so we do not need the "coverage" profile anymore. |
Done (commit
|
|
Seems that messages are still included, which is probably not desired? |
|
@the-thing I still need to get used to their UI. Do you mean the golden source files? |
|
Yes, but it seems like it is not being picked up? Shows 0% for |
Integrates JaCoCo coverage instrumentation into the Maven build and wires it up to Codecov via GitHub Actions.
pom.xmljacoco-maven-plugin0.8.15withprepare-agent(test-time instrumentation) andreport(package phase) executionsquickfixj-messages/quickfixj-messages-*/target/classes/**) from the coverage report@{argLine}tomaven-surefire-pluginconfiguration — required so the JaCoCo Java agent is actually passed to the JVM running tests; without this no coverage data is collectedREADME.mdmaven.ymltestjob now has a Codecov upload step withif: matrix.os == 'ubuntu-latest' && matrix.java == 21, so only that combination uploads results.