Code coverage done right.®

Welcome to Codecov Documentation. You'll find comprehensive guides and documentation to help you start working with Codecov as quickly as possible, as well as support if you get stuck. Let's jump right in!

Get Started


Group coverage reports based on type of tests or system.

Codecov presents Coverage Flags, which is an uploading strategy to isolate coverage reports.


Toggle flags in the source code overlay

**Source code overlay** Toggle `unittests`, `integration` and `ui` coverage reports with one tap.

Source code overlay Toggle unittests, integration and ui coverage reports with one tap.

Filter flags in tree navigation (coming soon)

**Navigate** with specific flags visible.

Navigate with specific flags visible.

Flag badges and graphs

Badges and graphs may express specific flags only. More details on this will come soon.

Create custom notifications

You can specify Flags in your Codecov Yaml for statuses and all notifications.

      default: off
        flags: frontend
        target: 50%
        flags: backend
        target: 89%
        flags: api

  # filter the folder(s) you wish to measure by that flag
    # only include files in the backend folder
      - app/backend/
      - app/frontend/
      - app/api/
      - tests/
**Custom Statuses** only report on specific Flags.

Custom Statuses only report on specific Flags.

How to create Flags

To apply a flag simply submit coverage reports with the -F flagname included in the upload command; Codecov will do the rest. The following example illustrates how you may run specific test groups and upload coverage, flagging each coverage group.

# example running unittests only
py.test --cov=./ -k tests/unittests/
bash <(curl -s -C -F unittests

# example running integration tests only
py.test --cov=./ -k tests/integration/
bash <(curl -s -C -F integration

# example running ui tests only
npm test
bash <(curl -s -C -F ui

-C will remove all previously uploaded reports.

Remove old reports after uploading (optional)

Apply the -C argument to clear the workspace of all coverage reports before running you next set of tests.

Flags must be lowercase, alphanumeric, and not exceed 45 characters

Only lowercase, alphanumeric values are accepted. ^[a-z0-9_]{1,45}$

Hiding builds (e.g. nightly builds)

Codecov provides a strategy to isolate specific builds from the master report while maintaining the report's integrity. When reports are not joined into the master report, they will be ignored for comparison, although they will remain accessible for source overlay, api, badges, and graphing.

A nightly build is an excellent example of this feature. What follows is a yaml configuration for a nightly build.

    joined: false

Now that we have configured the flag nightly to not join into the master report, let's upload a report flagged as nightly.

bash <(curl -s -F nightly

By adding -F nightly we mark all the coverage report data for this build as nightly coverage data.


Group coverage reports based on type of tests or system.