In addition to the the Configuring Test Coverage help doc, these topics provide additional troubleshooting context:
- Coverage data is based on the data that you send us via your coverage payloads, which is created client-side.
- Try removing Code Climate from the equation:
(1) Look at coverage results locally. Are they what you expect?
(2) Are your results what you expect, regardless of Code Climate?
(3) How are they different while looking at Code Climate?
- Output debug messages to your CI using the
--debugflag with your cc-test-reporter.
- Search the test reporter GitHub project for specific error messages.
- Read the test reporter's README for detailed instructions and low level usage commands.
- Check out the sample/working test config files on the test reporter GitHub project here.
- Ask a question and open an issue on the test reporter repo itself.
Opening an Issue or contacting Support?
I see a "successfully sent" message in my CI, but no results show in Code Climate's UI.
You will only see default branch coverage in Code Climate's UI. Use the browser extension to see other coverage in GitHub.
--debugflag and view additional output.
Possibly due to malformed payloads.
Make sure that you're sending ENV (not Git) values.
Check to see if you're pinning to a specific test coverage reporter version.
Where should I put the
If you're running your tests in single builds, use
For tests run in parallel, please use both
What CI-specific environmental variables and calls should I use?
Although the same basic variables are needed, we've found that each CI's naming of variables and calls can be quite different.
Check our CI sample config files in our help docs here as well as in the test reporter project.
Coverage results from one repo are showing on a different repo.
You might be using the incorrect CC_TEST_REPORTER_ID.
Check the test reporter id used in your test coverage config file or CI configurations.
When Code Climate is down, it causes my builds to fail because I can't upload my coverage reports. How can I fix this?
We're looking to update our reporter to account for this. In the meantime, we recommend the following workaround:
after-build || echo “Skipping CC coverage upload” or upload-coverage || echo “Skipping CC coverage upload”
My test coverage disappeared. My test coverage badge now shows a
- We purge test reports every 30 days. To bring back your test coverage info, configure the test reporter to send a new coverage payload for your default branch.
My test coverage info is visible in the UI, but the test coverage statuses won't populate in GitHub.
- Make sure your Code Climate user is GitHub-linked, and that you've granted access to private repos.
diff-coverage statuses are hanging in my PR, but my CI said the coverage info was "successfully sent".
- Our test coverage statuses rely on coverage info for both the branch head and merge base of a PR. Occasionally, a failed CI build will stop the coverage info from being uploaded, even if it gives a "successfully sent" message for the test coverage section. Check your CI logs for the builds for both the branch head and merge base commits. If one or either has failed, retrigger the CI builds to resend coverage info.
Error: you must supply a CC_TEST_REPORTER_ID ENV variable or pass it via the --id/-r flag
The reporter is unable to find your repo's test reporter ID. This value either needs to configured within the environment or passed directly as a CLI argument.
export CC_TEST_REPORTER_ID=<your token>
cc-test-reporter after-build --exit-code $?
export CC_TEST_REPORTER_ID=<your token>
cc-test-reporter after-build --id <your token> --exit-code $?
Error: file not found
The reporter is unable to find a file referenced with the test report. Does that file exist within your git repository? Was your test suite run within a different filesystem (such as in a docker container)?
You may need to specify a prefix value.
For example, if you're running the tests within a docker container and your app code is located at
/usr/src/app, the reporter run outside of the docker container will not be able to find files at the same absolute path.
--prefix /usr/src/app to instruct the test reporter to strip the unknown base path.
Invalid path part
Most often, this is related to:
- The reporter not able to find your test coverage results to upload them to Code Climate.
- The reporter encountering a file that it can't process
Error: not find any viable formatter. available formatters: simplecov, lcov, coverage.py, clover, gocov, gcov, cobertura, jacoco
The reporter is unable to find a formatter.
This is often seen with Java projects, when the the path to source code can't be inferred.
after-build, please use:
format-coverage, which includes:
JACOCO_SOURCE_PATH: the path to Java source files (a new environment variable)
coverage file: to path to JaCoCo coverage XML file (the first argument)
When using the
--insecure flag, any batch request will be made using HTTP, but the the main endpoint will still use the URL specified
Change the endpoint from