mirror of
https://github.com/codex-storage/nim-codex.git
synced 2025-02-09 11:35:43 +00:00
indicate with exit code 1 if the tests failed
This commit is contained in:
parent
7c21f6457a
commit
a53f470e3b
@ -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)
|
||||
|
@ -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()
|
||||
|
Loading…
x
Reference in New Issue
Block a user