When I run my tests, both locally and on Travis CI, I get a coverage report, but when the data is sent to codecov (via the codecov package), the report codecov presents is suddenly different. Coverage drops by 10% or so, and the report I see on codecov doesn’t match the HTML report I get running the tests.
Repository
(Webpack replace branch specifically, although the reports on the Dev branch never matched either, but the difference was significantly smaller.)
CI/CD
Travis CI.
Uploader
I’ve tried both the codecov NPM package and the bash uploader. Same results.
Commit SHAs
For example: 5650269188dd66ea59d82a606ec06d9c7fb79ff7, 4e41c95bfa46bcfd655edc2b428f375feb7984bc, b872248dd9f4eaf0d0e6ecca3b8d94b6f04c7af2
Hi @shirblc, thanks for this! I think I figured out why it looks off. The most important thing is that Codecov takes into account branch coverage and does NOT consider a partially covered as hit.
For example, we can take a look at src/app/components/aboutApp/aboutApp.component.ts. This is what we see in the HTML
BRDA specific branch coverage. There are 29 statements here (as matches the HTML branches). If you see lines marked with a 0 at the end, it means that branch was not taken as described in the docs (BRDA:<line number>,<block number>,<branch number>,<taken>)
So what does this mean? Codecov interprets your branch coverage and thus you see coverage seem to be off.