Code Coverage

Note

Code Coverage reporting and analysis are in beta. Contact us at support@solanolabs.com for more information.

Solano CI integrates with your existing rcov, simplecov, and JaCoCo configurations to provide code coverage metrics for your test suite. If you use one of these tools, you’ll see the aggregate coverage for your session reported in the Results Summary and an HTML report in the logs section at the bottom of the report page.

To enable coverage collection, add the following to your config/solano.yml:

---
coverage:
  version: 2
  enabled: true

JaCoCo coverage

In order to use the build in coverage reporter and jacoco you must also include the following

---
coverage:
  version: 2
  enabled: true
  merge_command: mvn jacoco:merge # could be `mvn` or `ant`
  report_command: mvn jacoco:report # could be `mvn` or `ant`
  • merge_command - merges coverage result from multiple workers. Is not necessary to provide if tests are run on one worker
  • report_command - generates report with test coverage result
  • merge_path - OPTIONAL if not provided will use the default

coverage ratchet

Solano CI also supports a “coverage ratchet”. When the ratchet is enabled, the session will be marked as a failure if code coverage falls below the configured threshold, even if all the tests pass.

---
coverage:
  version: 2
  enabled: true
  ratchet: 80

Adding the above incantation to your config/solano.yml will cause the session to fail if coverage falls below 80%.

Original Beta

If you are using the original beta of code coverage with a solano.yml like:

---
coverage: true

Change it to the following to use the new system:

---
coverage:
  version: 2
  enabled: true