-
-
Notifications
You must be signed in to change notification settings - Fork 782
Rewrite coverage handling in the root Makefile #4147
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
Conversation
5e37ab6 to
94f5394
Compare
Makefile
Outdated
| @echo "Removing all coverage results directories" | ||
| @echo | ||
| rm -rf .coverage \ | ||
| .coverage-unit .coverage-unit-* \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be safer to quote every parameter passed to rm -rf so it doesn't accidentally become .coverage-unit- * (accidental or intentional whitespace before *) or similar in the future.
4166d70 to
bea3412
Compare
|
|
||
| [run] | ||
| include = st2* | ||
| omit = *tests/* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't we need to omit the coverage generation for the tests/ files themselves?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The second bullet point in the PR summary:
I used to not include tests in coverage results, but the pynacl project changed my mind. I have found dead tests in projects thanks to coverage results. So I'm in favor of including *tests/ in coverage results.
|
I tested the changes locally, everything looks fine 👍 I will go ahead and merge this into master so it will be easier to keep things in sync, especially the PR / branch with OS X changes. If decided and needed, we can omit |
|
@m4dcoder It looks like that in this PR / branch, the It's likely that the coverage related instrumentation some how compounds the original race / similar issue in that test. So hopefully consistent failure in this build will help you track / narrow it down? |
|
Finding dead tests is a good reason, but including coverage for
The percentage is supposed to show what's the test coverage of the production code, not the tests themselves. Since it's about OSS community I believe what people would expect to see is the actual production code coverage as an important metric of the project quality, not the random test files. I propose to be honest with ourselves and our users. |
8402863 to
182c5a1
Compare
|
@m4dcoder |
…DE_TESTS_IN_COVERAGE environment variable
3f86f82 to
576ae76
Compare
|
I removed the commit that skipped tests and instead fixed the tests that were having issues being run with coverage turned on. @armab - the new |
|
@blag Sounds good, thank you! |
| include = st2* | ||
| omit = *tests/* | ||
| branch = True | ||
| concurrency = eventlet |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a heads up - that's the offending line which broke codecov.io reporting which I fixed in #4270.
Adds tests directories to coverage results, and reworks the coverage handling in the root
Makefileto (try to) avoid rerunning tests if they've already been run.WIP because I may have broken everything since it's a subtantial rewrite of the make logic, but other than that I'm pretty happy with it.
When I ran everything manually and gathered coverage result I got about 80% coverage throughout the entire codebase (tests included), which (in my experience) is very good for a project this size.
Questions:
wsgi.py,setup.py,dist_utils.py) - do we want to ignore those in our reports? I kinda do.*/tests/? Some projects like it (pynacl), some people don't (rebar3).