fix exit status

This commit is contained in:
Eric 2025-01-28 20:49:12 +11:00
parent 182b3eec6c
commit 971dadda46
No known key found for this signature in database
2 changed files with 4 additions and 4 deletions

View File

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

View File

@ -72,7 +72,7 @@ proc run() {.async.} =
trace "stopping test manager" trace "stopping test manager"
await manager.stop() await manager.stop()
without wasSuccessful =? manager.testsStatus, error: without wasSuccessful =? manager.allTestsPassed, error:
raiseAssert "Failed to get test status: " & error.msg raiseAssert "Failed to get test status: " & error.msg
if not wasSuccessful: if not wasSuccessful: