mirror of
https://github.com/dorny/test-reporter.git
synced 2025-12-15 13:57:09 +01:00
Merge pull request #144 from ldaneliukas/check_status
Update check title and remove icon
This commit is contained in:
commit
86a2010147
3 changed files with 12 additions and 6 deletions
8
dist/index.js
generated
vendored
8
dist/index.js
generated
vendored
|
|
@ -268,7 +268,6 @@ const mocha_json_parser_1 = __nccwpck_require__(6043);
|
|||
const swift_xunit_parser_1 = __nccwpck_require__(5366);
|
||||
const path_utils_1 = __nccwpck_require__(4070);
|
||||
const github_utils_1 = __nccwpck_require__(3522);
|
||||
const markdown_utils_1 = __nccwpck_require__(6482);
|
||||
function main() {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
try {
|
||||
|
|
@ -403,10 +402,13 @@ class TestReporter {
|
|||
const annotations = (0, get_annotations_1.getAnnotations)(results, this.maxAnnotations);
|
||||
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;
|
||||
const passed = results.reduce((sum, tr) => sum + tr.passed, 0);
|
||||
const failed = results.reduce((sum, tr) => sum + tr.failed, 0);
|
||||
const skipped = results.reduce((sum, tr) => sum + tr.skipped, 0);
|
||||
const shortSummary = `${passed} passed, ${failed} failed and ${skipped} skipped `;
|
||||
core.info(`Updating check run conclusion (${conclusion}) and output`);
|
||||
const resp = yield this.octokit.rest.checks.update(Object.assign({ check_run_id: createResp.data.id, conclusion, status: 'completed', output: {
|
||||
title: `${name} ${icon}`,
|
||||
title: shortSummary,
|
||||
summary,
|
||||
annotations
|
||||
} }, github.context.repo));
|
||||
|
|
|
|||
1
dist/index.js.map
generated
vendored
Normal file
1
dist/index.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
|
|
@ -19,7 +19,6 @@ import {SwiftXunitParser} from './parsers/swift-xunit/swift-xunit-parser'
|
|||
|
||||
import {normalizeDirPath, normalizeFilePath} from './utils/path-utils'
|
||||
import {getCheckRunContext} from './utils/github-utils'
|
||||
import {Icon} from './utils/markdown-utils'
|
||||
|
||||
async function main(): Promise<void> {
|
||||
try {
|
||||
|
|
@ -183,7 +182,11 @@ class TestReporter {
|
|||
|
||||
const isFailed = this.failOnError && results.some(tr => tr.result === 'failed')
|
||||
const conclusion = isFailed ? 'failure' : 'success'
|
||||
const icon = isFailed ? Icon.fail : Icon.success
|
||||
|
||||
const passed = results.reduce((sum, tr) => sum + tr.passed, 0)
|
||||
const failed = results.reduce((sum, tr) => sum + tr.failed, 0)
|
||||
const skipped = results.reduce((sum, tr) => sum + tr.skipped, 0)
|
||||
const shortSummary = `${passed} passed, ${failed} failed and ${skipped} skipped `
|
||||
|
||||
core.info(`Updating check run conclusion (${conclusion}) and output`)
|
||||
const resp = await this.octokit.rest.checks.update({
|
||||
|
|
@ -191,7 +194,7 @@ class TestReporter {
|
|||
conclusion,
|
||||
status: 'completed',
|
||||
output: {
|
||||
title: `${name} ${icon}`,
|
||||
title: shortSummary,
|
||||
summary,
|
||||
annotations
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue