Skip to content

Commit

Permalink
Only report failure if fail-on-error is set
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Trond Einar Snekvik authored and Trond Einar Snekvik committed Nov 30, 2022
1 parent 8bf0c7d commit e7733f4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit e7733f4

Please sign in to comment.