Closed gabrielschulhof closed 6 months ago
Hmmm ... a lot of the lines are neither covered nor not covered, because they're ifdef-ed out. So, we'd have to build and test with a lot more variations (e.g. bindings_v5.node, binding_noexcept_v5.node, ... for NAPI_VERSION 5).
So where I left off on my investigations:
This gave me a 61% coverage, see here. What I found interesting (and touched on in last week's meeting) is that this cout
line was marked as "Uncovered" yet is present inside the CI's action run log. This run also turned off compiler optimizations using -O0
.
Not exactly sure how you are getting in the 90s on your coverage, so I tried again using your changes on a new PR. This also resulted in 64% code coverage, see here.
Maybe it has something to do with the functions being inlined? I dunno
On the Feb 23 meeting, @KevinEady mentioned that he would verify the generated coverage report locally to see uncovered branches and discrepancies with the optimization on/off.
Some findings here https://github.com/KevinEady/node-addon-api/pull/6#issuecomment-1961987002
Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.
Thanks for integrating Codecov - We've got you covered :open_umbrella:
Hi team,
I've added the codecov.io service integration. You can see in the above comment that once this is merged, we'll start to see messages regarding coverage in new PRs. You can see the coverage for this branch on codecov.io.
Additionally, I did a test on my local fork with removing all the tests for threadsafe functions and async workers. You can see the comment on the PR with codecovs report here, with a -13.03%
change. You can click through to codecov.io's hosted report and see detailed information.
We can discuss some configurations in the next meeting:
Coverage now runs on drafts as well, and removed the HTML report generation + upload
The result looks pretty decent at first blush:
AFAICT, this only works on Linux, and doesn't integrate with any online coverage tools.
BEGIN_COMMIT_OVERRIDE test: add basic coverage support (#1451) END_COMMIT_OVERRIDE