Scrutinizer can process code coverage information that you generate during your build. We currently support code coverage processing for PHP, Python and Ruby, and also support merging your code coverage data should you run tests in parallel.
For PHP, we support the
clover format that is generated for example by
phpunit. When setting up your test commands,
simply specify where we find the coverage file and what format it has:
build: tests: override: - command: 'vendor/bin/phpunit --coverage-clover=some-file' coverage: file: 'some-file' format: 'clover'
For Python, we support data generated by
coverage. When setting up your test commands, simply specify where we find
.coverage file, and potentially your
.coveragerc configuration file:
build: tests: override: - command: './run-tests.sh' coverage: file: '.coverage' config_file: '.coveragerc' format: 'py-cc'
For Ruby, code coverage can be generated using our
scrutinizer-ocular gem that uses
SimpleCov internally. When
you have set-up the scrutinizer-ocular gem, make sure to set the
SCRUTINIZER_CC_FILE environment variable:
build: tests: override: - command: 'bundle exec rspec spec' environment: 'SCRUTINIZER_CC_FILE': 'my-coverage' coverage: file: 'my-coverage' format: 'rb-cc'
We also support the
build: dependencies: before: - npm install istanbul # or add it as part of your package.json tests: override: - command: 'istanbul cover --report clover test.js' coverage: file: 'coverage/clover.xml' format: 'clover'
Scrutinizer also supports several coverage reports formats such as
JaCoCo as an example, the configuration of code coverage in your
.scrutinizer.yml would look like:
build: tests: override: - command: mvn clean package coverage: file: '[path-to-coverage-reports]' format: 'jacoco'
For Go projects, Scrutinizer supports the default coverage file format of the go tool Cover <https://golang.org/cmd/cover/> along with the cross language formats like
If you use the
Cover tool as an example, the configuration will look like:
build: tests: override: - command: go test -coverprofile=cover.out coverage: file: 'cover.out' format: 'go-cc'