10000 TST: relax codecov project threshold by tylerjereddy · Pull Request #12549 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

TST: relax codecov project threshold #12549

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

Merged
merged 1 commit into from
Jan 1, 2019

Conversation

tylerjereddy
Copy link
Contributor

We have been observing far too many false positive project-level codecov failures due to < 0.01 % drops that are clearly not relevant. I've tried to adjust project threshold parameter based on the standard docs.

This would allow a 0.05 % drop in total project test coverage to report as a success, but I think this is probably fine since a PR will still fail if its diff has poor coverage (there's a separate threshold we could set for the diff--currently I think it is set to our base coverage of around 85 % by default, which is fairly solid on a PR).

I know this is something that came up recently with @shoyer in an in person discussion.

I'm not always optimistic about codecov doing exactly what the yml should be telling it to do, but maybe worth a try.

@shoyer
Copy link
Member
shoyer commented Dec 14, 2018

Looks good to me, thanks. The main reason why failing for reducing overall code coverage is not a good idea is that it penalizes you for deleting code!

@rgommers
Copy link
Member

Also, the measurements are simply incorrect. It's a difference between a PR and some random previous run. So turning it off completely is also fine if the check keeps failiing.

@rgommers
Copy link
Member

And it did, just now. This didn't work it looks like, it's still trying to use 0.01%. IIRC we've tried this before and codecov doesn't do what's documented.

@tylerjereddy
Copy link
Contributor Author

Not surprised the API isn't responding to the yml.

Trying one more thing now -- disabling the project status entirely, since it is really only the patch diff that is useful.

@pv
Copy link
Member
pv commented Dec 14, 2018

Maybe you can copypaste the config from scipy --- it used to work before hitting codecov size limits...

@tylerjereddy tylerjereddy changed the title TST: relax codecov project threshold WIP, TST: relax codecov project threshold Dec 14, 2018
@tylerjereddy
Copy link
Contributor Author

I've copied in the codecov.yml file from SciPy verbatim as an experiment based on feedback above. Also, adding a WIP tag, since this is basically a scientific experiment with no evidence that codecov yml config directives work as documented.

My other thought, because this is really confusing--what if codecov.yml was working in SciPy because it wasn't hidden -- @charris had asked me to use .codecov.yml (hidden) instead, and to be fair the docs do indicate that these options should be the same--but the docs are obviously wrong anyway.

@tylerjereddy
Copy link
Contributor Author

A third possibility is web-hook only vs. github marketplace app for codecov. Pretty sure we use the former, not sure about SciPy but probaby web-hook there too given historical availability.

@tylerjereddy
Copy link
Contributor Author

The verbatim copy of the SciPy codecov config allows CI to pass, but seems to eliminate the most useful entry from the matrix (the patch diff coverage).

Not a fan of that tradeoff myself, and not sure it is worth trying to experiment too much more if the docs aren't reliable.

@tylerjereddy
Copy link
Contributor Author

I've added a dummy function that is not covered by unit tests to this PR -- let's see if the SciPy codecov settings that are copied in provide some kind of indication that the new function is not covered.

If there's a silent indicator of some sort, that might be a compromise worth discussing.

@tylerjereddy
Copy link
Contributor Author

With the SciPy settings you get complete silence on uncovered code additions in a PR, but the CI will have less false positive failures.

I suppose reviewers could be trusted to click through the codecov link and take a peek at the patch diff. Not sure how many more issues might sneak though if CI is more quiet about coverage matters.

@rgommers
Copy link
Member

This needs a rebase. I suggest to move .codecov.yml to codecov.yml to check that the settings get applied correctly then. not a big deal to have this non-hidden. if it doesn't pick up and remains at -0.01%, then it needs to be turned off. we cannot have CI turn red when there's a single more uncovered line (or if it compares vs some other PR or other state of master, that happens when it doesn't have coverage for the correct commit to compare with, maybe in more situations).

* we have no idea why codecov API
does not respond to codecov.yml settings
as documented; we now use config from
SciPy verbatim to avoid excessive coverage
CI failures
@tylerjereddy
Copy link
Contributor Author

The hidden status doesn't seem to matter -- copying the codecov.yml from SciPy verbatim to our hidden .codecov.yml immediately solved the issue causing frustration & seems to generate the same behavior observed in SciPy.

I was simply saying I wasn't fully satisfied with that fix, because now reviewers will have to click through a few pages to gauge the coverage of the patch diff manually.

Anyway, I've rebased, force-pushed, and I'll remove the WIP tag if CI is all green. I suspect this will do what is desired--basically always produce a green CI as far as codecov is concerned with the tradeoffs already discussed.

I suspect we can all agree that improvement on their end or a new competitor in the ecosystem would be most welcome. I suppose it may not be that hard to simply code in the patch cov diff % check to a CI stage manually & fail below some threshold we agree on & storing the coverage html artifact for the offending file. But maybe that is something a third-party service should really be doing for the ecosystem.

@tylerjereddy
Copy link
Contributor Author

core dump on Travis!

codecov passing

@rgommers
Copy link
Member

core dump on Travis!

yes, saw that in your PR that removes agg as well, doesn't look like a flake but like something that got merged recently.

lgtm, okay to remove the WIP status and merge?

@tylerjereddy tylerjereddy changed the title WIP, TST: relax codecov project threshold TST: relax codecov project threshold Dec 31, 2018
@tylerjereddy
Copy link
Contributor Author

Ok, I've removed the WIP tag if this is what most devs want.

@rgommers
Copy link
Member
rgommers commented Jan 1, 2019

3 approvals and all green (except for the unrelated segfault), merging. Thanks @tylerjereddy

@rgommers rgommers merged commit 98c500a into numpy:master Jan 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants
0