mirror of
https://github.com/dorny/test-reporter.git
synced 2025-12-17 06:47:09 +01:00
test: log annotations
This commit is contained in:
parent
0582e4d1dc
commit
85f8936ad9
2 changed files with 10 additions and 11 deletions
18
dist/index.js
generated
vendored
18
dist/index.js
generated
vendored
|
|
@ -404,6 +404,7 @@ class TestReporter {
|
||||||
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`);
|
||||||
|
core.info(`Posted annotations: ${annotations}`);
|
||||||
const resp = yield this.octokit.rest.checks.update(Object.assign({ check_run_id: createResp.data.id, conclusion, status: 'completed', 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: `${name} ${icon}`,
|
||||||
summary,
|
summary,
|
||||||
|
|
@ -2367,21 +2368,18 @@ function getBasePath(path, trackedFiles) {
|
||||||
if (trackedFiles.includes(path)) {
|
if (trackedFiles.includes(path)) {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
let max = '';
|
||||||
for (const file of trackedFiles) {
|
for (const file of trackedFiles) {
|
||||||
const pathParts = path.split('/');
|
if (path.endsWith(file) && file.length > max.length) {
|
||||||
const originalLength = pathParts.length;
|
max = file;
|
||||||
const fileParts = file.split('/');
|
|
||||||
while (pathParts.length && pathParts.slice(-1)[0] === fileParts.slice(-1)[0]) {
|
|
||||||
pathParts.pop();
|
|
||||||
fileParts.pop();
|
|
||||||
}
|
|
||||||
// we found some matching path parts
|
|
||||||
if (pathParts.length !== originalLength) {
|
|
||||||
return pathParts.join('/');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (max === '') {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
const base = path.substr(0, path.length - max.length);
|
||||||
|
return base;
|
||||||
|
}
|
||||||
exports.getBasePath = getBasePath;
|
exports.getBasePath = getBasePath;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -185,6 +185,7 @@ class TestReporter {
|
||||||
const icon = isFailed ? Icon.fail : Icon.success
|
const icon = isFailed ? Icon.fail : Icon.success
|
||||||
|
|
||||||
core.info(`Updating check run conclusion (${conclusion}) and output`)
|
core.info(`Updating check run conclusion (${conclusion}) and output`)
|
||||||
|
core.info(`Posted annotations: ${annotations}`)
|
||||||
const resp = await this.octokit.rest.checks.update({
|
const resp = await this.octokit.rest.checks.update({
|
||||||
check_run_id: createResp.data.id,
|
check_run_id: createResp.data.id,
|
||||||
conclusion,
|
conclusion,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue