Missing information into coverage xml uploaded file

Description

I’ve got an xml file corresponding to my tests coverage and it’s complete.
But on codecov interface the values are different.
Is the upload can prune some value from the xml ?

Repository

CI/CD

Github Action.

Uploader

I use

    - name: Upload coverage to Codecov
      uses: codecov/codecov-action@v1
      with:
        file: coverage.xml

I can’t use

bash <(curl -s https://codecov.io/bash)

it’s not recognized into the Github Action.
To overcome this, I tried:

curl -s https://codecov.io/bash > .codecov
chmod +x .codecov
./.codecov -f coverage.xml

But result is the same.
I also tried to add the -X flag but issue still remains.

Commit SHAs

69538617dd4a948cd0bb5d2444494698f1d7614b

https://codecov.io/gh/mrobertseidowsky-gpsw/gopro-lib-node.gl/tree/69538617dd4a948cd0bb5d2444494698f1d7614b

it should provides 81.4% instead around 70%

Codecov YAML

codecov:
require_ci_to_pass: yes
strict_yaml_branch: master # Only use the latest copy on master branch.
max_report_age: 168 # Coverage reports expire after one week.

codecov:
disable_default_path_fixes: yes
fixes:

  • “libnodegl::”

Codecov Output

See link: https://github.com/mrobertseidowsky-gpsw/gopro-lib-node.gl/runs/715933185?check_suite_focus=true

and especially the parts “get coverage” and “upload coverage to codecov”

Steps to Reproduce

  1. generate a coverage report with gcovr version 4.2 in xml format
  2. upload it to codecov
  3. observe that coverage value is not the same than in the xml file

Expected behavior: Having the same values has the xml files

Actual behavior: maybe it’s a path fixes, I tried to add in the codecov.yml
codecov:
disable_default_path_fixes: yes
fixes:

  • “libnodegl::”

because my source are in libnodegl repo and that the one I would like to see in the codecov interface.

I also tried - “::libnodegl” but same behaviour.

Flakiness? all the time

Additional Information

I’m not against an another export format is xml causes issue, but I tried with json and html and it wasn’t succesfull.
I also tried without any specified format just codecov take all .gcna available into the repository but it wasn’t good neither.

It will be very valuable to have this codecov badge on an open source repository by gopro compagny :slight_smile:

Hi @mrobertseidowsky-gps, would you be able to supply the xml file? Maybe I can dig into why you see this discrepancy. My initial thought is differences in how coverage is calculated. We typically count a partial hit as not a match. You can read more about our calculation here: Frequently Asked Questions

Hello @tom you can see the xml thanks to a cat coverage.xml command here: https://github.com/mrobertseidowsky-gpsw/gopro-lib-node.gl/runs/715933185?check_suite_focus=true
in the part “show cov xml”
Do you think it will possible to change this way of computing in order to have the same behaviour than gcovr tool ?
Or just reporting the same values than in the xml on codecov ?

Hi @mrobertseidowsky-gps, I can confirm this is a partials issue, and we do not consider partials to be covered lines. As an example, check out animation.c

You’ll see that it’s covered in the coverage.xml file like so

<class branch-rate="0.8571428571428571" complexity="0.0" filename="animation.c" line-rate="0.9565217391304348" name="animation_c">

The line-rate is 0.9565… or 95.65%.

Codecov is showing 86.96%

However, if you include partials (4) as being covered, the math is 44/46 = 95.65%

thanks for the explanation @tom. So how can I have the tests report including this partials in order to get my total correct score ? Because, at the end I lost 10% of coverage so I don’t want to use that for my badge unfortunately :frowning:

Hi @mrobertseidowsky-gps, unfortunately there is no current way to show a coverage value with partials included with Codecov. I know that’s not a satisfying answer, but we believe that those lines should not count toward overall coverage.

thanks @tom for your explanation! Even with the configuration file codecov.yml, is that not possible to specifiy the inclusion of partial lines as “hits” ?

1 Like

Hi @mrobertseidowsky-gps, unfortunately it’s not. I will let our product team know, but I don’t believe we will be making this change.

OK let me know if you can add this feature, it will be great!
We merged the badge on this repository GitHub - gopro/gopro-lib-node.gl: Graphics engine for building and rendering graph-based scenes but unfortunately the coverage per files don’t work, example:

Do you have an idea of what happened?
Thanks in advance!

This looks like a path fixing issue to me.

Try adding

fixes:
  - "::libnodegl/"

to your codecov.yml file

1 Like