Code Coverage
Code coverage analysis is handled by Jacoco and, optionally, coverage reports can be published to Coveralls.io.
Code coverage analysis
The repository is configured to report code coverage using Jacoco.
A test coverage report can be generated by running the coverage
Gradle task:
./gradlew coverage
Combined coverage reports for all modules in the repository will be created, capturing coverage data from both unit and system tests. Two styles of reports are generated by default:
- A machine friendly XML report is created at
build/reports/jacoco/coverage/coverage.xml
. - A human friendly HTML report is created at
build/reports/jacoco/coverage/html/index.html
.
Settings for code coverage are configured in the Creek coverage build convention, which can be customised as needed.
Code coverage publishing
The repository is configured to publish code coverage of tests to Coveralls.io when the coveralls
Gradle task is executed.
./gradlew coveralls
This task is executed as part of the default CI GitHub workflow.
If you wish to make use of Coveralls.io for your code coverage needs then you will need to:
- Create a Coveralls.io account.
- Import your new repository into Coveralls, noting the
REPO TOKEN
. - Store the Coveralls
REPO TOKEN
in a repository secret in GitHub namedCOVERALLS_REPO_TOKEN
.