codecov / codecov/codecov-action

[BUG] Puzzling coverage computation?

Open
#1,850 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Python
Stars
1.7k
Forks
260
Avg merge
1d 7h
Merged PRs (30d)
1

Description

Describe the bug

I'm not sure if this is a bug in codecov-action, https://github.com/getsentry/prevent-cli (formerly codecov-cli), or my own (mis)understanding of how the wholle coverage collection process works (highly possible), but I am getting a rather strange code coverage report for a project that I'm working on. The coverage in question can be found on:

https://app.codecov.io/gh/neuronsimulator/nrn/commit/c81be96caac3712c53784a1597f56062f0747854/blob/share/lib/python/neuron/nmodl/ode.py?dropdown=coverage#L132

As you see, the coverage is somewhat nonsensical:

Image

as it basically skips over lines that should always run.

To Reproduce

Not sure what is the exact source of the problem.

Expected behavior

The coverage report should include basically all of the lines in the screenshot above.

Regression

Not sure since we didn't cover this file before (i.e. it had 0% coverage).

Screenshots

See above.

Versions

  • OS: Linux
  • Git Host: GitHub
  • CI/CD: GHA (ubuntu-22.04 host)
  • Uploader: codecov/codecov-action@v4, codecov-cli cli-11.0.3 (according to the logs, see below)

Commit and CI link

CI logs are here:

https://github.com/neuronsimulator/nrn/actions/runs/16566967873/job/46849303386?pr=3544#step:26:1

Additional context

Bumped into this behavior while working on https://github.com/neuronsimulator/nrn/pull/3544

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the Codecov report for share/lib/python/neuron/nmodl/ode.py and the linked GitHub Actions logs from codecov-action@v4 using codecov-cli 11.0.3. Compare the reported coverage with the lines shown in the issue, then determine whether the behavior originates in the action, CLI, or project coverage data. Done means a reproducible diagnosis and a clearly identified component or configuration needing correction.

Written by the indexing model from the issue text.

Assessment

Tech stack
github-actions, python
Domain
ci-cd, testing-qa
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.