indicate with exit code 1 if the tests failed

This commit is contained in:
Eric 2025-01-28 18:58:43 +11:00
parent 7c21f6457a
commit a53f470e3b
No known key found for this signature in database
2 changed files with 16 additions and 0 deletions

View File

@ -157,6 +157,16 @@ proc duration(manager: TestManager): Duration =
let now = Moment.now()
(manager.timeEnd |? now) - (manager.timeStart |? now)
proc testsStatus*(manager: TestManager): ?!bool =
for test in manager.tests:
if test.status in {IntegrationTestStatus.New, IntegrationTestStatus.Running}:
return failure "Integration tests not complete"
if test.status != IntegrationTestStatus.Ok:
return success true
return success false
proc duration(test: IntegrationTest): Duration =
let now = Moment.now()
(test.timeEnd |? now) - (test.timeStart |? now)

View File

@ -72,4 +72,10 @@ proc run() {.async.} =
trace "stopping test manager"
await manager.stop()
without wasSuccessful =? manager.testsStatus, error:
raiseAssert "Failed to get test status: " & error.msg
if not wasSuccessful:
quit(1) # indicate with a non-zero exit code that the tests failed
waitFor run()