Codecov is wrongly informing the coverage percentage on my project, Codecov
As can be seen on it, the original source file has 100% coverage, but there is a strange copy of the same file from Travis where Codecov informs only 83.67%, giving the project and average of 91.84%
I don’t understand how to implement the bash uploader on our public project on Travis CI
Commit SHAs
8e03ccfac25c17d6f08867da233cd8bf82b89b58
Codecov YAML
I have no codecov.yml on my project, just a .travis.yml with:
os:
- linux
- osx
- windows
language: node_js
install:
- npm ci
- npm install -g codecov
node_js:
- "node"
after_script:
- codecov
Codecov Output
$ codecov
_____ _
/ ____| | |
| | ___ __| | ___ ___ _____ __
| | / _ \ / _` |/ _ \/ __/ _ \ \ / /
| |___| (_) | (_| | __/ (_| (_) \ V /
\_____\___/ \__,_|\___|\___\___/ \_/
v3.7.1
==> Detecting CI Provider
Travis CI Detected
==> Configuration:
Endpoint: https://codecov.io
{
commit: '8e03ccfac25c17d6f08867da233cd8bf82b89b58',
branch: 'v1.0.1',
package: 'node-v3.7.1'
}
==> Building file structure
==> Generating gcov reports (skip via --disable=gcov)
Failed to run gcov command.
==> Scanning for reports
X Failed to read file at
==> Uploading reports
Success!
View report at: https://codecov.io/github/alumna/unitflow/commit/8e03ccfac25c17d6f08867da233cd8bf82b89b58
Done. Your build exited with 0.
Steps to Reproduce
Created a new PR on my project
Travis CI identified it and runned new tests
It executed the codecov command in the end
Expected behavior:
Since the original file has 100% coverage, as Codecov recognizes, I would not like to have a copy file with wrong coverage percentage changing the project overall coverage to a wrong value (below 100%)
Actual behavior:
Codecov is considering also this wrong file and its strange coverage percentage.
I also have an issue with wrong coverage percentage, I have a 100% coverage but Codecov give me a wrong percentage. But I use the bash script and Github actions.
@mikbry, you are seeing less than 100% coverage because we do not consider partial hits to be covered lines. If you look at the raw reports by going to the build tab here, you will see that these lines do not traverse the false path
You are right @tom. It is confusing to see some differences between Codecov and jest coverage. And it is more tricky to avoid them during dev phase as partials are not displayed in html report… I will investigate.
This is strange, because I also use Jest and partials are displayed for me, both on the results summarized on the command line (with line numbers partially covered being enumerated and printed with different colors, like yellow), as well as in html report.
The html reports are even more detailed, showing exactly where in the line the issue of partial coverage is, and I remember many cases where I was only able to solve after opening the html report, to understand precisely what logic scenarios were missing on my tests.
Finally I found why such differences: I was sending cover.xml report which includes partials, but my html report is using lcov.info without partials support. I changed my script to send to codecov the lcov.info instead and now I have same 100%. But yes i didn’t fix partials…