Ruby
Code Coverage
Example
For a full working example, see our example Ruby repository.
Details
Install and instrument test coverage with SimpleCov
Configure SimpleCov
to generate JSON reports:
If you want to combine the JSON format with other formats, use SimpleCov’s MultiFormatter
:
Publish SimpleCov’s JSON coverage reports using qlty coverage publish PATH
SimpleCov will write a coverage data file to coverage/coverage.json
.
This path is needed to complete the final step which is publishing this data to qlty.
For GitHub Actions users, the simplest next step is to use our example workflow from our example ruby repository.
Otherwise, refer to:
- Our general procedure for test coverage setup (start at step 2)
- Instructions on using with other CI providers
Compatibility
SimpleCov version 0.22.0+
(We may be compatible with older versions of SimpleCov, but they have not been explicitly tested.)