mirror of
https://github.com/dorny/test-reporter.git
synced 2025-12-16 06:17:10 +01:00
Merge pull request #214 from trond-snekvik/fail-on-error
Only report failure if fail-on-error is set
This commit is contained in:
commit
75b0cadf5f
3 changed files with 3 additions and 3 deletions
2
dist/index.js
generated
vendored
2
dist/index.js
generated
vendored
|
|
@ -392,7 +392,7 @@ class TestReporter {
|
||||||
const summary = (0, get_report_1.getReport)(results, { listSuites, listTests, baseUrl, onlySummary });
|
const summary = (0, get_report_1.getReport)(results, { listSuites, listTests, baseUrl, onlySummary });
|
||||||
core.info('Creating annotations');
|
core.info('Creating annotations');
|
||||||
const annotations = (0, get_annotations_1.getAnnotations)(results, this.maxAnnotations);
|
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 conclusion = isFailed ? 'failure' : 'success';
|
||||||
const icon = isFailed ? markdown_utils_1.Icon.fail : markdown_utils_1.Icon.success;
|
const icon = isFailed ? markdown_utils_1.Icon.fail : markdown_utils_1.Icon.success;
|
||||||
core.info(`Updating check run conclusion (${conclusion}) and output`);
|
core.info(`Updating check run conclusion (${conclusion}) and output`);
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@
|
||||||
"format": "prettier --write **/*.ts",
|
"format": "prettier --write **/*.ts",
|
||||||
"format-check": "prettier --check **/*.ts",
|
"format-check": "prettier --check **/*.ts",
|
||||||
"lint": "eslint src/**/*.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",
|
"test": "jest --ci --reporters=default --reporters=jest-junit",
|
||||||
"all": "npm run build && npm run format && npm run lint && npm run package && npm test",
|
"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\"",
|
"dart-fixture": "cd \"reports/dart\" && dart test --file-reporter=\"json:../../__tests__/fixtures/dart-json.json\"",
|
||||||
|
|
|
||||||
|
|
@ -174,7 +174,7 @@ class TestReporter {
|
||||||
core.info('Creating annotations')
|
core.info('Creating annotations')
|
||||||
const annotations = getAnnotations(results, this.maxAnnotations)
|
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 conclusion = isFailed ? 'failure' : 'success'
|
||||||
const icon = isFailed ? Icon.fail : Icon.success
|
const icon = isFailed ? Icon.fail : Icon.success
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue