I have a bash script that runs my tests:
#!/bin/bash coverage run --source='directory_for_coverage' manage.py test coverage report --fail-under=87
but when I run the script it only returns an error code if the coverage fails, not if one of the tests fails. I would think that because I am not using the --ignore-errors switch that coverage run should return the error code from the failing test. What am I missing?
--ignore-errors
coverage run
I solved this by adding a set -e command to my script:
set -e
#!/bin/bash set -e coverage run --source='directory_for_coverage' manage.py test coverage report --fail-under=87
1.4m articles
1.4m replys
5 comments
56.9k users