"Erase" still needed in 4.2

Issue #510 resolved
Michał Bultrowicz created an issue

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

Comments (11)

  1. Ned Batchelder repo owner

    @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?

  2. Michał Bultrowicz reporter

    @ned 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):

    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

    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.

  3. Michał Bultrowicz reporter

    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?

  4. Ned Batchelder repo owner

    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.

  5. Michał Bultrowicz reporter

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

  6. Log in to comment