Send '.coverage' docker output to coveralls from travis
See original GitHub issueThe pytest-cov documentation states the following:
These three report options output to files without showing anything on the terminal:
py.test --cov-report html --cov-report xml --cov-report annotate --cov=myproj tests/
The output location for each of these reports can be specified. The output location for the XML report is a file. Where as the output location for the HTML and annotated source code reports are directories:
py.test --cov-report html:cov_html --cov-report xml:cov.xml --cov-report annotate:cov_annotate --cov=myproj tests/
The final report option can also suppress printing to the terminal:
py.test --cov-report= --cov=myproj tests/
This mode can be especially useful on continuous integration servers, where a coverage file is needed for subsequent processing, but no local report needs to be viewed. For example, tests run on Travis-CI could produce a .coverage file for use with Coveralls.
But, how do I send the redirected report generated from --cov-report
, to coveralls? I am currently using this framework within a series of docker containers, which my .travis.yml
spins up for unit testing. This framework generates the coverage report, and copied from a docker container, to the host for the Travis CI. Then, my implementation of python-coveralls, used explicitly by Travis is responsible for sending the coverage report to coveralls:
pytest.main([
'--cov', '.',
'--cov-report', 'xml:/var/machine-learning/coverage.xml',
'test/live_server'
])
However, it seems the xml option is an invalid format for sending to coveralls.
Note: this is the associated issue I’m working on corresponding to the above statement.
Issue Analytics
- State:
- Created 7 years ago
- Comments:26 (13 by maintainers)
Top GitHub Comments
https://pypi.python.org/pypi/coveralls works by reading the datafiles (those
.coverage
files) - nothing else needed (ok, maybe acoverage combine
if you have multiple datafiles).I think we ca close this then. If you want nicer handling complain in coverage’s bugtracker.