-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Closed
Description
This doesn't seem significant enough for me to want to fill out a CLA... / please add this.
I'm trying out Bitbucket Pipelines and noticed that my builds were passing even though tests were failing. This is due to the fact that the testrunner always exits with code 0 (someone else had a similar problem with PHP tests).
I suspect the same is true for other build agents. The following patch takes care of it:
--- a/runner.py Tue Sep 06 17:49:32 2016 +0200
+++ b/runner.py Wed Sep 07 10:56:25 2016 +0200
@@ -76,7 +76,7 @@
# Discover and run tests.
suite = unittest.loader.TestLoader().discover(test_path, "*_test.py")
- unittest.TextTestRunner(verbosity=2).run(suite)
+ return unittest.TextTestRunner(verbosity=2).run(suite)
if __name__ == '__main__':
@@ -88,6 +88,8 @@
sys.exit(1)
SDK_PATH = args[0]
TEST_PATH = args[1]
- main(SDK_PATH, TEST_PATH)
+ result = main(SDK_PATH, TEST_PATH)
+ if not result.wasSuccessful():
+ sys.exit(1)
# [END runner]
Metadata
Metadata
Assignees
Labels
No labels