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

Inconsistent coverage reports #356

Open
apriha opened this issue Oct 30, 2019 · 6 comments
Open

Inconsistent coverage reports #356

apriha opened this issue Oct 30, 2019 · 6 comments

Comments

@apriha
Copy link

apriha commented Oct 30, 2019

Hi guys, I'm not sure if this is a pytest-cov, coverage, or Travis CI issue, but recently my Travis builds have started producing inconsistent coverage reports. For example, with this job, the coverage report is including src and site-packages:

https://travis-ci.org/apriha/snps/jobs/604796573

However, with this job (same parent build as the previous) the coverage report only includes site-packages:

https://travis-ci.org/apriha/snps/jobs/604796575

Any idea what's happening here? Thanks in advance!

@ionelmc
Copy link
Member

ionelmc commented Oct 30, 2019

Is it always the same test configuration that lacks the src coverage or is it kind of random?

@apriha
Copy link
Author

apriha commented Oct 30, 2019 via email

@apriha
Copy link
Author

apriha commented Oct 30, 2019

Here is an example of a build where src was included in the report, and after restarting the job a few minutes after the first, src was not included:

https://codecov.io/gh/apriha/snps/commit/57c204a4a436def6fe38d6bce610234c7ed92478/build

Specifically, here are the raw reports:

1st report
https://codecov.io/codecov/v4/raw/2019-10-23/9E6AA2A1AAF76DC349CF798DB6EB70E2/57c204a4a436def6fe38d6bce610234c7ed92478/43ba98c3-e464-43d2-9fe1-19108ce53974.txt

2nd report (after restarting job)
https://codecov.io/codecov/v4/raw/2019-10-23/9E6AA2A1AAF76DC349CF798DB6EB70E2/57c204a4a436def6fe38d6bce610234c7ed92478/363ee630-0128-4c85-89c9-ca3ab38d93da.txt

Notice how the 2nd report doesn't have the element <package branch-rate="0.0229" complexity="0" line-rate="0.02011" name="snps">.

@apriha
Copy link
Author

apriha commented Nov 2, 2019

Ok, it looks like the coverage that's being reported in the src directory is a function that gets called via Pool.

I then came across this and added the recommended fix (cleanup_on_sigterm), but the src directory is still getting picked up. Any ideas on where to go from here?

@apriha
Copy link
Author

apriha commented Nov 2, 2019

FYI, since results are not being combined, removing the following from setup.cfg fixed the issue for me:

[coverage:paths]
source =
    src
    */site-packages

Thanks for providing pytest-cov!

@JulienPalard
Copy link
Contributor

Is this related to nedbat/coveragepy#883 (comment)?

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

3 participants