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

"Erase" still needed in 4.2 #510

Closed
nedbat opened this issue Jul 27, 2016 · 9 comments
Closed

"Erase" still needed in 4.2 #510

nedbat opened this issue Jul 27, 2016 · 9 comments
Labels
bug Something isn't working

Comments

@nedbat
Copy link
Owner

nedbat commented Jul 27, 2016

Originally reported by Michał Bultrowicz (Bitbucket: Butla, GitHub: Butla)


If I understand http://nedbatchelder.com/blog/201607/coveragepy_42.html correctly, then running "run" and then "combine" (I'm running parallel tests) should properly detect loss of test coverage, right? Because they shouldn't look at the old .coverage by default.

But at the moment I still need to run "erase" to get rid of the old results before running the tests.

Here's my full tox.ini: https://github.com/butla/PyDAS/blob/a8c76d3221447fb34af60f5d03b18df52286ed4c/tox.ini


@nedbat
Copy link
Owner Author

nedbat commented Jul 28, 2016

@butla Can you provide me with a reproducible scenario? I tried running your tests, and got many errors like this: docker.errors.DockerException: Error while fetching server API version: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))

I see that you used to have two "coverage erase" lines and now you have only one?

@nedbat
Copy link
Owner Author

nedbat commented Jul 28, 2016

Original comment by Michał Bultrowicz (Bitbucket: Butla, GitHub: Butla)


@nedbat Well, the tests require Docker. I have Xubuntu 14.04 with Docker 1.6.2 installed.

If you don't want to setup Docker, you can use a Vagrant box with Docker (this of course requires Vagrant and Virtualbox):

#!bash

vagrant init williamyeh/ubuntu-trusty64-docker
vagrant up --provider virtualbox
vagrant ssh
sudo apt-get update
sudo apt-get install python3-pip
sudo pip3 install tox
git clone https://github.com/butla/pydas
cd pydas
tox

Is this OK or should I provide a simpler scenario?

About two "coverage erase" - yes, I needed two and I reported this behavior in #492, but it's fixed in 4.2.

@nedbat
Copy link
Owner Author

nedbat commented Jul 28, 2016

Original comment by Michał Bultrowicz (Bitbucket: Butla, GitHub: Butla)


Oh, right, you need to remove "coverage erase" from tox.ini before
rerunning the tests.

As I understand in 4.2 erase shouldn't be necessary right? Because
appending to existing .coverage is optional?

@nedbat
Copy link
Owner Author

nedbat commented Jul 28, 2016

Hmm, the problem is that "tox" and "pylint" each run with coverage measurement (because of coverage_pth), and they each read the .coverage file before running. This carries the .coverage data into a parallel .coverage.localhost.xxx file, which then gets combined by the combine step.

Seems like reading the .coverage file during auto-started coverage measurement is a bad thing.

@nedbat
Copy link
Owner Author

nedbat commented Jul 28, 2016

Original comment by Michał Bultrowicz (Bitbucket: Butla, GitHub: Butla)


Can .coverage be of any use in the parallel case? Everything get's stored in separate files, right?

@nedbat
Copy link
Owner Author

nedbat commented Jul 29, 2016

The recent auto_load changes fixed #510

→ <<cset fee2fd97520c (bb)>>

@nedbat
Copy link
Owner Author

nedbat commented Jul 29, 2016

This is fixed in the handful of commits ending with fee2fd97520c (bb)

@nedbat
Copy link
Owner Author

nedbat commented Dec 27, 2016

This fix was released as part of Coverage.py 4.3.

@nedbat
Copy link
Owner Author

nedbat commented Dec 27, 2016

Original comment by Michał Bultrowicz (Bitbucket: Butla, GitHub: Butla)


Great to hear that :)

@nedbat nedbat closed this as completed Dec 27, 2016
@nedbat nedbat added minor bug Something isn't working labels Jun 23, 2018
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