Only report failure if fail-on-error is set

The flag is checked when exiting early, but the report update at the end ignores it, causing the test run to be reported as a failure.

Fixes #161.

Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
This commit is contained in:
Trond Einar Snekvik 2022-11-30 13:43:42 +01:00
parent 8bf0c7d9a7
commit e7733f494f

View file

@ -174,7 +174,7 @@ class TestReporter {
core.info('Creating annotations')
const annotations = getAnnotations(results, this.maxAnnotations)
const isFailed = results.some(tr => tr.result === 'failed')
const isFailed = this.failOnError && results.some(tr => tr.result === 'failed')
const conclusion = isFailed ? 'failure' : 'success'
const icon = isFailed ? Icon.fail : Icon.success