Code is tested but not covered by codecov



So in my PR, I added a specific unit test testDeinit() for testing deinit();

I can confirm that the deinit() diff has been 100% tested, I can see breakpoints hit as well as test logs showing the missing covered code is run.

You can see the log here:

Search “Detect timer in use yet invalidated”, and it will guide you to the specific test log

You can see the test log shows:

[TELLO-FREE-] MUST CALL shutdown() first, trying to close the channel only, event group may escape
[TELLO-FREE-] Detect timer in use yet invalidated
[TELLO-FREE-] MUST CALL shutdown() first, trying to close the channel only, event group may escape

which means, all the if condition in deinit() is hit, so it should be 100% covered.

To be clear,
TelloSwift.swift line 82 - 83, 86-89 should be hit, not missing.

I’m not sure why codecov would think it’s not covered, while it has been tested.

Description of the issue


Steps to Reproduce

Run the test testDeinit(), make sure deinit() is tested
check codecov report, it says deinit diff is not covered in full.

Expected behavior: [What you expect to happen]
deinit() diff should be 100% covered.
Actual behavior: [What actually happens]
deinit() diff is not covered

I wonder no one watches this community? Or everyone is enjoying the holidays?

The holidays :slight_smile:

Lets take a look here. The raw uploaded report for c4092d8a6e6bc4b7f66ad4ad0cfb5fe5bd45a7aa is

I don’t see Tello.swift anywhere in that report.

We also have

This one does contain Tello.swift

If you look at the report you uploaded, you can see that those lines for that file have a hit count of 0 (second column) This indicates your coverage reported is not considering those lines hit. Codecov can only parse what we are given

Hi @drazisil

Thanks for taking a look.

So I assume the raw coverage input file is generated by Xcode/Apple? I do see the hit count of the code is 0, however, the hit count of the whole corresponding unit test testDeinit() is 1, meaning the tests have been run, yet the code itself is not covered, it’s kind of paradox.

Also, I found there are areas that the tests have been run but not covered, I can clearly see the test printing logs, however it’s not covered as well. I guess it’s not a single case, this is either a bug of coverage or deinit code is not correctly parsed problem?

I understand it’s not your fault, so I should turn to Apple for this issue/bug?

Yes, please. I know we are working with Apple to fix code coverage after the latest Xcode version, I think that wrong/missing line-level coverage is one of the issues.