!npm versionnpm-badgenpm-url !Build Statustravis-badgetravis-url !Coverage Statuscoverage-badgecoverage-url !Code Climatecodeclimate-badgecodeclimate-url !Dependency Statusdavid-badgedavid-url
Supplies a script which accepts coverage data over standard input, formats the coverage data and sends it to Code Climate. Supports lcov and Go's
Code Climate - https://codeclimate.com
Important FYIsAcross the many different testing frameworks, setups, and environments, there are lots of variables at play. Before setting up test coverage, it's important to understand what we do and do not currently support:
- Single payload: We currently only support a single test coverage payload per commit. If you run your tests in multiple steps, or via parallel tests, Code Climate will only process the first payload that we receive. If you are using a CI, be sure to check if you are running your tests in a parallel mode.
Note: There is one exception to this rule. We've specifically built an integration with Solano Labs to support parallel tests.
- Invalid File Paths: By default, our test reporters expect your application to exist at the root of your repository. If this is not the case, the file paths in your test coverage payload will not match the file paths that Code Climate expects.
InstallationThis npm package requires having a user (but not necessarily a paid account) on Code Climate, so if you don't have one the first step is to create an account at: https://codeclimate.com. Then:
- Install codeclimate's NPM package
$ npm install -g codeclimate-test-reporter
- Specifying your repo token as an environment variable, send lcov coverage data to the codeclimate npm script.
For example, if your coverage data resides in a "lcov.info" file: CODECLIMATE_REPO_TOKEN=ABCD11110000000 codeclimate-test-reporter < lcov.info
CODECLIMATE_REPO_TOKENvalue is provided after you add your repo to your Code Climate account by clicking on "Setup Test Coverage" on the right hand side of your feed.
Please contact email@example.com if you need any assistance setting this up.
Usage: codeclimate [options] < <file> Options: -h, --help output usage information -V, --version output the version number -S, --skip-cert skips verification of the chain of certificate