question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Send '.coverage' docker output to coveralls from travis

See original GitHub issue

The 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:closed
  • Created 7 years ago
  • Comments:26 (13 by maintainers)

github_iconTop GitHub Comments

1reaction
ionelmccommented, Jan 16, 2017

https://pypi.python.org/pypi/coveralls works by reading the datafiles (those .coverage files) - nothing else needed (ok, maybe a coverage combine if you have multiple datafiles).

0reactions
ionelmccommented, Jan 16, 2017

I think we ca close this then. If you want nicer handling complain in coverage’s bugtracker.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Coveralls - Travis CI Docs
Coveralls is a hosted analysis tool, providing statistics about your code coverage. Configuring your Travis CI build to send results to Coveralls always...
Read more >
Coveralls is not being submitted on a Django app with Docker
I'm working on a Django project using Docker. I have configured Travis-Ci and I want to submit test coverage to coveralls.
Read more >
How I Made Docker, Travis, and Coveralls to Play Nice Together
I use Travis for continuous integration, which creates a Docker container to run the app's unit tests. Travis then uploads the code coverage...
Read more >
Build a Modern JS Project - #11 Travis CI & Coveralls - YouTube
In this video, we'll walk through setting up a build pipeline with Travis CI and collecting coverage reports from our unit tests using ......
Read more >
Docker CI with GitHub Actions - S-ENDA's documentation!
... e.g., Travis CI and Coveralls for monitoring test coverage. ... Live example at GitHub metno/pycsw-container and result at Docker Hub metno/pycsw.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found