Skip to content

Commit

Permalink
Fail in RunFunctionalTests if tests throw exceptions. (#1273)
Browse files Browse the repository at this point in the history
  • Loading branch information
veluca93 authored Nov 16, 2024
1 parent 98ad9a2 commit fd93545
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions cmstestsuite/RunFunctionalTests.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,8 @@ def main():
runner = TestRunner(test_list, contest_id=args.contest, workers=4)
failures = []

testing_general_failure = False

try:
# Submit and wait for all tests to complete.
runner.submit_tests()
Expand All @@ -238,13 +240,18 @@ def main():
with open("./log/cms/last.log", "rt", encoding="utf-8") as f:
print(f.read())
print("\n\n===== END OF LOG DUMP =====\n\n")
logging.error("Failure while running tests", exc_info=True)
testing_general_failure = True
finally:
# And good night!
runner.shutdown()
runner.log_elapsed_time()

combine_coverage()

if testing_general_failure:
return 1

logger.info("Executed: %s", tests)
logger.info("Failed: %s", len(failures))
if not failures:
Expand Down

0 comments on commit fd93545

Please sign in to comment.