From afd11d4524194c210c33d52ef6a49865447ef6d7 Mon Sep 17 00:00:00 2001 From: Tomass Wilson <39732448+Wilsontomass@users.noreply.github.com> Date: Mon, 19 Dec 2022 15:18:05 +0100 Subject: [PATCH] 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. --- src/main.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.ts b/src/main.ts index d0c5a06e..d325d2fd 100644 --- a/src/main.ts +++ b/src/main.ts @@ -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