Skip to content

Commit fd93545

Browse files
authored
Fail in RunFunctionalTests if tests throw exceptions. (#1273)
1 parent 98ad9a2 commit fd93545

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

cmstestsuite/RunFunctionalTests.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,8 @@ def main():
225225
runner = TestRunner(test_list, contest_id=args.contest, workers=4)
226226
failures = []
227227

228+
testing_general_failure = False
229+
228230
try:
229231
# Submit and wait for all tests to complete.
230232
runner.submit_tests()
@@ -238,13 +240,18 @@ def main():
238240
with open("./log/cms/last.log", "rt", encoding="utf-8") as f:
239241
print(f.read())
240242
print("\n\n===== END OF LOG DUMP =====\n\n")
243+
logging.error("Failure while running tests", exc_info=True)
244+
testing_general_failure = True
241245
finally:
242246
# And good night!
243247
runner.shutdown()
244248
runner.log_elapsed_time()
245249

246250
combine_coverage()
247251

252+
if testing_general_failure:
253+
return 1
254+
248255
logger.info("Executed: %s", tests)
249256
logger.info("Failed: %s", len(failures))
250257
if not failures:

0 commit comments

Comments
 (0)