This is a Buildkite plugin for Codeclimate coverage reporting. It adds pre-command and post-command hooks that use Codeclimate's test reporter to submit code coverage reports to Codeclimate.
To use this plugin you need to:
- Setup a code coverage tool for your project. For example, if you're working on a Ruby/Rails project, you can use SimpleCov.
- Setup a Codeclimate account, and add your repository to Codeclimate
- Get the test reporter id for your repo (https://docs.codeclimate.com/docs/finding-your-test-coverage-token), and set it as the env var CC_TEST_REPORTER_ID on your Buildkite pipeline
Then configure your buildkite pipeline for parallel or non-parallel test steps:
- Add codeclimate-coverage plugin to your test step.
You're test step should look something like this:
- name: 'Test'
command: '.buildkite/test'
plugins:
docker-compose#v2.4.1:
run: web
env:
# Used by code coverage
- BUILDKITE_BRANCH
- BUILDKITE_COMMIT
- CC_TEST_REPORTER_ID
taylorzr/codeclimate-coverage#v0.1.0: ~
- Add coverage to your artifact_paths
- Add codeclimate-coverage plugin to your test step
- Add a new step to sum and upload the aggregate coverage report
You're pipeline should look something like this:
- name: 'Test'
command: '.buildkite/test'
artifact_paths:
- "coverage/codeclimate_coverage_*.json"
parallelism: 2
plugins:
docker-compose#v2.4.1:
run: web
env:
# Used by code coverage
- BUILDKITE_BRANCH
- BUILDKITE_COMMIT
- CC_TEST_REPORTER_ID
taylorzr/codeclimate-coverage#v0.1.0:
prefix: '/usr/src/app'
- name: ':codeclimate: Upload'
command: 'echo +++ :codeclimate:'
plugins:
taylorzr/codeclimate-coverage#v0.1.0: ~
sum_and_upload: true
prefix: '/usr/src/app'
- document, explain, and test prefix config
- document and test reporter url config
- document debug config
- document caveats
- must mount local dir when using docker-compose
- must pass through env variables