python - Travis jobs reporting success, even though tests fail (using tox) -
i'm looking @ following build:
https://travis-ci.org/ababic/wagtailmenus/builds/267670218
all jobs seem reporting successful, though have single, deliberately failing test, , has been happening on different builds on same project @ least last 2 days.
the configuration in .travis.yml hasn't changed in while, apart switching 'trusty' 'precise' - , changing seems not fix issue.
my tox.ini hasn't been changed in while either.
i tried forcing tox earlier version already, didn't seem help.
i know it's got tox or travis, that's knowledge ends. @ appreciated.
i had @ project , has nothing either tox or travis. problem runtests.py
used in tox returns exitcode 0 whatever happens. tox (and in extension travis) needs exitcode != 0 able know went wrong.
relevant code in runtests.py:
[...] def runtests(): [...] try: execute_from_command_line(argv) except: pass if __name__ == '__main__': runtests()
i did not check execute execute_from_command_line reckon returns error code if went wrong (or raises exception if went really wrong).
therefore rewrite code above this:
import sys [...] def runtests(): [...] return execute_from_command_line(argv) if __name__ == '__main__': sys.exit(runtests())
this way pass through whatever function run has report outcome of tests , exit script error code or if exception raised, traceback printed , script returns non 0 code.
wiki
Comments
Post a Comment