Don't fail empty results if failOnError is False

This also changes how the check is created, failing the check on failing tests.
This resolves #217  and also resolves #161.
This commit is contained in:
Tomass Wilson 2022-12-19 15:18:05 +01:00 committed by GitHub
parent e9fa2f582c
commit afd11d4524
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -135,7 +135,7 @@ class TestReporter {
return
}
if (results.length === 0) {
if (this.failOnError && results.length === 0) {
core.setFailed(`No test report files were found`)
return
}
@ -179,7 +179,7 @@ class TestReporter {
core.info('Creating annotations')
const annotations = getAnnotations(results, this.maxAnnotations)
const isFailed = this.failOnError && results.some(tr => tr.result === 'failed')
const isFailed = results.some(tr => tr.result === 'failed')
const conclusion = isFailed ? 'failure' : 'success'
const icon = isFailed ? Icon.fail : Icon.success