I am using Travis CI and Codecov with my Django project, and using the coverage package to generate coverage reports. The project has two apps, app1 and app2, each with their own tests.py. My .travis.yml currently looks like this:
language: python
python:
- "3.6"
install:
- pip install -r requirements.txt
script:
- coverage run manage.py test app1
- coverage run manage.py test app2
after_success:
- bash <(curl -s https://codecov.io/bash)
When executing either coverage run manage.py test account or coverage run manage.py test main from the console, all tests pass. However, when I push to github and codecov runs the tests, it only runs the last command For example, when the script block looks like this:
script:
- coverage run manage.py test app1
- coverage run manage.py test app2
both the app1 and the app2 tests are run (as shown in Travis CI), but none of the the app1 tests are included in the coverage report, and when is looks like this:
script:
- coverage run manage.py test app2
- coverage run manage.py test app1
the opposite is true. Like I said, both tests are shown to be executed in Travis CI, so why is only one of them getting included in the coverage report as shown in Codecov?
Aucun commentaire:
Enregistrer un commentaire