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

[run] omit is ignored since 4.5 #638

Closed
nedbat opened this issue Feb 6, 2018 · 6 comments
Closed

[run] omit is ignored since 4.5 #638

nedbat opened this issue Feb 6, 2018 · 6 comments
Labels
bug Something isn't working

Comments

@nedbat
Copy link
Owner

nedbat commented Feb 6, 2018

Originally reported by Marius Gedminas (Bitbucket: mgedmin, GitHub: mgedmin)


The coverage of irclog2html dropped from 100% to 98% after a cron-triggered Travis CI rebuild with no code changes. I investigated and discovered that despite my .coveragerc containing

[run]
source = irclog2html
omit = */tests/*,*/xchatlogsplit.py

the new version of coverage (4.5) does not omit src/irclog2html/tests/test_*.py from measurement or reporting.

This is probably related to commit 1031ead7ca4c (bb).


@nedbat
Copy link
Owner Author

nedbat commented Feb 8, 2018

@mgedmin Can you point me to the commit in your repo that shows the problem? And exactly how to reproduce the before/after?

@nedbat
Copy link
Owner Author

nedbat commented Feb 9, 2018

Original comment by Marius Gedminas (Bitbucket: mgedmin, GitHub: mgedmin)


mgedmin/irclog2html@da8d6ec is a commit where make coverage reports 100% with coverage 4.4, but 98% (due to extra files with <100% coverage not being omitted) with coverage 4.5.

(The "Also for some reason buildout-installed tools ignore my .coveragerc" part of the commit message was a misunderstanding on my part: buildout installed coverage 4.5 and was affected by this bug, but my globally pip-installed coverage was still at 4.4.)

mgedmin/irclog2html@3db55bd is the workaround I applied to get the reporting back to 100%.

@nedbat
Copy link
Owner Author

nedbat commented Feb 9, 2018

Thanks. Looking at the .coverage files produced by 4.4.2 and 4.5, they are identical. So the [run]omit was never stopping the collecting of data for some reason. In 4.4.2, that setting was preventing the reporting, but it isn't in 4.5. I'll have to dig into it some more.

@nedbat
Copy link
Owner Author

nedbat commented Feb 10, 2018

The problem was that during measurement, omitting patterns weren't used inside source packages, only source directories. In the ambiguous case (such as you have) we interpret the source setting as a package. So the omit was being ignored (and has been for a while). It used to be that run-omit was also used for report-omit, so the data would be collected, but then omitted during reporting. Now that report-omit doesn't default to report-omit, the incorrectly collected data was being reported.

In change 3ee6ac71eb08 (bb) I fixed the handling of omits inside source packages, so this is now fixed.

@nedbat
Copy link
Owner Author

nedbat commented Feb 10, 2018

Original comment by Marius Gedminas (Bitbucket: mgedmin, GitHub: mgedmin)


You're amazing! Thank you!

@nedbat
Copy link
Owner Author

nedbat commented Feb 10, 2018

This is now available in 4.5.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant