1. Ned Batchelder
  2. coverage.py
  3. Issues
Issue #548 resolved

Don't Fail with Coverage Combine - aka, 4.3 Broke All Our Builds

Miserlou
created an issue

The changes in 4.3 to fail (return -1) if there are no coverage files to append broke all of our builds. We needed that to success for our Travis + Coveralls set up. Now we are forced to peg at 4.2. Fails here: https://travis-ci.org/Miserlou/Zappa/builds

Please add a '--no-strict' or similar so we don't need to do this.

Comments (9)

  1. Ned Batchelder repo owner

    Help me understand your situation: why are you running "coverage combine" if you have no data files to combine? Another solution is to ignore the exit status in your .travis.yml file:

    - coverage combine --append || true
    
  2. Miserlou reporter

    The tests run in parallel, so I assume whichever finishes first is dying with -1. I am not sure how Travis is doing that under the hood. This is the travis yaml:

    language: python
    python:
      - "2.7"
    # command to install dependencies
    cache:
      - pip
    install:
      - "pip install setuptools --upgrade; pip install -r test_requirements.txt; pip install -e git+https://github.com/django/django-contrib-comments.git#egg=django-contrib-comments; python setup.py install" 
    # command to run tests
    env:
      - TESTCASE=tests/test_handler.py
      - TESTCASE=tests/tests_middleware.py
      - TESTCASE=tests/tests_placebo.py
      - TESTCASE=tests/tests.py
    script: 
      - nosetests $TESTCASE --with-coverage --cover-package=zappa --with-timer
      - coverage combine --append
    after_success:
      coveralls
    
  3. Loic Dachary

    Miserlou my understanding is that travis-ci runs a different test for each line in env (i.e. test_handler.py etc.) and each run in a different directory so they cannot share the result of the test and coverage combine will always fail.

    The call to coveralls ( not sure which one is used ) uploads to https://coveralls.io/github/Miserlou/Zappa which combines the result (the server code is not available to verify that but it makes sense to me) if the SHA1 of the commit are identical.

    If this theory is right, removing the coverage combine line should work. What do you say ?

  4. Miserlou reporter

    The problem with that is then they're all submitted independently, so that coveralls.io misrepresents our coverage amount. It says 17, then 60, then 20 (or whatever.) It rests at the last-submitted value, not at the combined value.

  5. Log in to comment