feedback icon indicating copy to clipboard operation
feedback copied to clipboard

Reports overriding eachother instead of being merged

Open AndrewPochapsky opened this issue 1 year ago • 1 comments

Describe the bug In our repository we have two directories for which we would like to generate coverage for. These are /framework and /modules. We have a CI task that generates a coverage report and uploads it for either of these directories depending on whether or not a change was made in them, so for a given PR we may run the coverage for /framework and for another we may run it for /modules.

We run /framework coverage using this github action.

We run /modules coverage using circleci since github actions runs out of memory. The circleci job is triggered by this github action which runs this script to generate and upload the report.

The problem is that we are not seeing coverage being merged properly between these reports, but more so what appears to be each one replacing the other. This is a rust project and many crates in /modules have dependencies on crates in /framework, so when the coverage report is generated for /modules it also generates coverage for /framework which looks artificially low since the tests in /modules only indirectly test parts of /framework. However, when we generate the coverage report for /framework we get the correct coverage for /framework, but /modules then gets removed from the report. Ideally we would have these reports be merged properly such that we can see a consistent view of test coverage across the repository.

I have already read through the documentation, in particular the section about merging reports, but I may have missed something.

Below is our codecov.yml file which we have defined in the .github directory.

# ref: https://docs.codecov.com/docs/codecovyml-reference
coverage:
  # Hold ourselves to a high bar
  range: 85..100
  round: down
  precision: 1
  status:
    # ref: https://docs.codecov.com/docs/commit-status
    project:
      default:
        # Avoid false negatives
        threshold: 1%

# Test files aren't important for coverage
ignore:
  - "tests"
  - "**/examples"
  - "**/schema.rs"

# Make comments less noisy
comment:
  layout: "files"
  require_changes: true

component_management:
  individual_components:
    - component_id: framework  # this is an identifier that should not be changed
      name: framework  # this is a display name, and can be changed freely
      paths:
        - framework/
    - component_id: modules  # this is an identifier that should not be changed
      name: modules  # this is a display name, and can be changed freely
      paths:
        - modules/

AndrewPochapsky avatar Nov 24 '23 00:11 AndrewPochapsky

Hi @AndrewPochapsky

Simce you are not uploading full coverage reports every time, you are probably going to want to use wither https://docs.codecov.com/docs/flags with https://docs.codecov.com/docs/carryforward-flags

drazisil-codecov avatar Nov 27 '23 14:11 drazisil-codecov