mirror of
https://github.com/nodejs/node.git
synced 2026-11-26 21:58:26 -05:00
tools: update github_reporter to 1.6.0
PR-URL: https://github.com/nodejs/node/pull/51658 Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This commit is contained in:
1 parent
c9974f621c
commit
c7ae13e6bc
2 files changed
+16
-9
No files matched your search
@@ -19156,6 +19156,18 @@ var DIAGNOSTIC_KEYS = {
|
||||
var DIAGNOSTIC_VALUES = {
|
||||
duration_ms: (value) => `${Number(value).toFixed(3)}ms`
|
||||
};
|
||||
function extractLocation(data) {
|
||||
let { line, column, file } = data;
|
||||
const error = data.details?.error;
|
||||
file = getFilePath(file);
|
||||
if (error) {
|
||||
const errorLocation = parseStack(error, file);
|
||||
file = getFilePath(errorLocation?.file ?? file) ?? file;
|
||||
line = errorLocation?.line ?? line;
|
||||
column = errorLocation?.column ?? column;
|
||||
}
|
||||
return { file, startLine: line, startColumn: column };
|
||||
}
|
||||
module.exports = async function githubReporter(source) {
|
||||
if (!process.env.GITHUB_ACTIONS) {
|
||||
for await (const _ of source)
|
||||
@@ -19178,23 +19190,18 @@ module.exports = async function githubReporter(source) {
|
||||
if (error?.code === "ERR_TEST_FAILURE" && error?.failureType === "subtestsFailed") {
|
||||
break;
|
||||
}
|
||||
let filePath = getFilePath(event.data.file);
|
||||
const location = parseStack(error, filePath);
|
||||
filePath = getFilePath(location?.file ?? filePath) ?? filePath;
|
||||
core.error(util.inspect(error, { colors: false, breakLength: Infinity }), {
|
||||
file: filePath,
|
||||
startLine: location?.line,
|
||||
startColumn: location?.column,
|
||||
...extractLocation(event.data),
|
||||
title: event.data.name
|
||||
});
|
||||
counter.fail += 1;
|
||||
break;
|
||||
}
|
||||
case "test:diagnostic":
|
||||
if (event.data.nesting === 0) {
|
||||
if (event.data.file === void 0 || event.data.line === void 0 || event.data.column === void 0) {
|
||||
diagnostics.push(event.data.message);
|
||||
} else {
|
||||
core.notice(event.data.message, { file: getFilePath(event.data.file) });
|
||||
core.notice(event.data.message, extractLocation(event.data));
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@reporters/github",
|
||||
"version": "1.5.4",
|
||||
"version": "1.6.0",
|
||||
"description": "A github actions reporter for `node:test`",
|
||||
"type": "commonjs",
|
||||
"keywords": [
|
||||
|
||||
Reference in new issue
Block a user