-
Notifications
You must be signed in to change notification settings - Fork 56
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
also produce standard .coverage file with .testmondata #86
Comments
This reverts commit de0de59. Ref tarpas/pytest-testmon#86 Ref #71
Yeah, unfortunatelly coveragepy doesn't handle reporting coverage of the same run to more independent callers. P.S. there is --testmon-off for exactly your use case. |
Which brings me to revelation that making coveragepy properly "re-entrant" would help also with issue #11 "dogfooding" (using testmon when developing testmon) which would be beautiful. A quick search doesn't find anything in coveragepy issue tracker: https://bitbucket.org/ned/coveragepy/issues?q=re-entrant I'll try to bring it up when I have time. |
But how does |
Any development on this so far? |
Any progress on this? |
Just for reference, there's |
--testmon
flag
#97 would solve the issue in general way |
@webknjaz pytest-cov doesn't solve it either. You have to pick one of pytest-cov, pytest-testmon, Pycharm debugger. I renamed the issue, because it is a requested feature but, I don't have capacity to work on it in the near future. |
I see, thanks for the update! |
pytest-testmon is incompatible with pytest-cov now, because they compete on using sys.settrace hook Refs: * tarpas/pytest-testmon#86 * tarpas/pytest-testmon#97 * https://coverage.readthedocs.io/en/coverage-4.5.1/trouble.html#things-that-don-t-work
I've decided to go for workaround suggested by @blueyed for now (cherrypy/cheroot@26eea5ca). |
@blueyed |
With |
You are adding it via cherrypy/cheroot@2561c7e...26eea5c#diff-513c9b6861fc981fb2c708db477f542cR3. |
I wanted to keep it enabled via addopts and disable in one place in cli |
@webknjaz |
Thanks for the hint! I've completely missed that. |
Hi, I had evaluated testmon for my project when I was looking for a solution to improve my pytest CI speed by using some form of caching across PullRequest runs and came across testmon. This issue was a blocker for me at that time too. I recall that coverage 5 and how it creates a database and how that impacts stuff was uncertain at that time. I went through multiple issue here and on coverage.py github. But thought I'd ask on what is the final status here ... Today: Is it possible for my PullRequest runs to run coverage and testmon together ? So that:
|
With testmon v 1.4.0+ it's easy to produce .testmondata and .coverage within the same run. However, there are still 2 issues, which are more on the side of coveragepy:
Depending on your project it might still be a good tradeoff to give up on coverage reporting and gain a boost in performance for some branches/commits. |
I see - the point on line adds/dels making .coverage for subsequent lines invalid makes sense and seems like a core issue tough to solve. Then is it possible to run the tests for the altered lines "first" and then run the remaining tests ? (In my experience 80% of CI runs at a PR level are failures) NOTE: Even better would be to just invalidate that file's coverage and rerun all tests for that file... But I assume that is not possible right now. |
Yes. --testmon-noselect does exactly that.
Yes, this is the sweetspot of using coverage + testmon as it's designed with current limits.
Not possible now but a neat idea. Tougher challenge is the .coverage data merge performance.. I would like to get feedback on the approach as outlined above, then think about implementation of "execute all test for affected files" |
Hi @tarpas ,
what i want to achieve is kind combination of both like i can't just use |
It's been possible to use --cov and --testmon simultaneously for a long time. Now it's also possible to only reorder tests without selecting or collecting .testmondata. (re later discussion) |
Oh, really? I must've missed when that happened.. Will have to try integrating this again. |
I've added
--testmon
flag toaddopts
inpytest.ini
. This immediately reduced coverage from 60% to 18%:https://codecov.io/gh/cherrypy/cheroot/branch/master/commits
P.S. Related feature request would be to support
--no-testmon
disabling the plugin.P.P.S. Coverage is calculated using
pytest-cov
pluginThe text was updated successfully, but these errors were encountered: