Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Coverage.jl reporting lines surrounded by covered code as not covered #261

Closed
vlandau opened this issue Dec 12, 2019 · 9 comments
Closed

Comments

@vlandau
Copy link

vlandau commented Dec 12, 2019

I'm noticing issues with a coverage report for my Julia package submitted to codecov showing lines of code as not covered that are surrounded by covered code. There is no control flow in this section of code -- basically, if lines n and n+2 were covered, then line n+1 must have also been covered, but the report is stating otherwise.

It could be something on codecov's end also, but wanted to post this here to make devs aware.
Here is the coverage report with an example highlighted for reference.

@baggepinnen
Copy link

Was the line counted at all? Maybe that line was elided by the compiler in case it counts as neither a hit or a miss. That usually applieds to constant definitions etc.

@DilumAluthge
Copy link
Member

@vlandau Can you try running your test suite with inlining disabled, and see if that fixes the problem? I opened a pull request here: Circuitscape/Omniscape.jl#14

@vlandau
Copy link
Author

vlandau commented Jan 2, 2020

Thanks @DilumAluthge! Trying it now.

@vlandau
Copy link
Author

vlandau commented Jan 2, 2020

It does seem that the coverage errors were significantly worse when the after_script in travis was run after the documentation stage. I added some control flow to the after_script to only have it run after the Test stage on Linux, and the problem was reduced significantly. There is still one case, here.

Note that this is all before trying with no inlining. I'll post the results here once that finishes running.

@vlandau
Copy link
Author

vlandau commented Jan 2, 2020

The previous comment above seems to still apply. There are two cases with skipped lines: here, and here. I can live with this just fine for now, but a fix probably does exist.

@DilumAluthge
Copy link
Member

In the second case (line 168 of run_omniscape.jl), are you sure that the line is being run?

@vtjnash
Copy link
Member

vtjnash commented Jan 6, 2020

Expected to be fixed by JuliaLang/julia#34254

@vlandau
Copy link
Author

vlandau commented Jan 6, 2020

In the second case (line 168 of run_omniscape.jl), are you sure that the line is being run?

🤦‍♂️ I thought I had a test that covered that line but I actually did not! Whoops.

@vlandau
Copy link
Author

vlandau commented Feb 17, 2020

Appears to have been fixed (presumably by JuliaLang/julia#34254). Line count is still not perfect (some lines are skipped), but there are no longer any false negatives in the report (e.g. lines that were covered that are being reported as not covered). Closing this since it was about those false negatives.

@vlandau vlandau closed this as completed Feb 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants