From e7733f494f344432331167b1fd1049b4475784c3 Mon Sep 17 00:00:00 2001 From: Trond Einar Snekvik Date: Wed, 30 Nov 2022 13:43:42 +0100 Subject: [PATCH 1/3] 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 --- src/main.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.ts b/src/main.ts index 156d9100..935c7697 100644 --- a/src/main.ts +++ b/src/main.ts @@ -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 From 15ec24088df7ca72a2a22a606f7c9216068fcc9d Mon Sep 17 00:00:00 2001 From: Michal Dorner Date: Wed, 30 Nov 2022 16:53:36 +0100 Subject: [PATCH 2/3] Update dist/index.js --- dist/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dist/index.js b/dist/index.js index 19587c3a..df75f076 100644 --- a/dist/index.js +++ b/dist/index.js @@ -392,7 +392,7 @@ class TestReporter { const summary = (0, get_report_1.getReport)(results, { listSuites, listTests, baseUrl, onlySummary }); core.info('Creating annotations'); const annotations = (0, get_annotations_1.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 ? markdown_utils_1.Icon.fail : markdown_utils_1.Icon.success; core.info(`Updating check run conclusion (${conclusion}) and output`); From 0042016d8ddcbd043f61468e9777a9f06bcccef7 Mon Sep 17 00:00:00 2001 From: Michal Dorner Date: Wed, 30 Nov 2022 18:11:21 +0100 Subject: [PATCH 3/3] Fix eol conversion in dist folder --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 6930c738..10b79a0c 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "format": "prettier --write **/*.ts", "format-check": "prettier --check **/*.ts", "lint": "eslint src/**/*.ts", - "package": "ncc build --license licenses.txt && eolConverter lf dist/*", + "package": "ncc build --license licenses.txt && eolConverter lf 'dist/*'", "test": "jest --ci --reporters=default --reporters=jest-junit", "all": "npm run build && npm run format && npm run lint && npm run package && npm test", "dart-fixture": "cd \"reports/dart\" && dart test --file-reporter=\"json:../../__tests__/fixtures/dart-json.json\"",