Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 751821f

Browse filesBrowse files
nodejs-github-bottargos
authored andcommitted
tools: update github_reporter to 1.6.0
PR-URL: #51658 Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent c3dbd7c commit 751821f
Copy full SHA for 751821f

File tree

Expand file treeCollapse file tree

2 files changed

+16
-9
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

2 files changed

+16
-9
lines changed
Open diff view settings
Collapse file

‎tools/github_reporter/index.js‎

Copy file name to clipboardExpand all lines: tools/github_reporter/index.js
+15-8Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19156,6 +19156,18 @@ var DIAGNOSTIC_KEYS = {
1915619156
var DIAGNOSTIC_VALUES = {
1915719157
duration_ms: (value) => `${Number(value).toFixed(3)}ms`
1915819158
};
19159+
function extractLocation(data) {
19160+
let { line, column, file } = data;
19161+
const error = data.details?.error;
19162+
file = getFilePath(file);
19163+
if (error) {
19164+
const errorLocation = parseStack(error, file);
19165+
file = getFilePath(errorLocation?.file ?? file) ?? file;
19166+
line = errorLocation?.line ?? line;
19167+
column = errorLocation?.column ?? column;
19168+
}
19169+
return { file, startLine: line, startColumn: column };
19170+
}
1915919171
module.exports = async function githubReporter(source) {
1916019172
if (!process.env.GITHUB_ACTIONS) {
1916119173
for await (const _ of source)
@@ -19178,23 +19190,18 @@ module.exports = async function githubReporter(source) {
1917819190
if (error?.code === "ERR_TEST_FAILURE" && error?.failureType === "subtestsFailed") {
1917919191
break;
1918019192
}
19181-
let filePath = getFilePath(event.data.file);
19182-
const location = parseStack(error, filePath);
19183-
filePath = getFilePath(location?.file ?? filePath) ?? filePath;
1918419193
core.error(util.inspect(error, { colors: false, breakLength: Infinity }), {
19185-
file: filePath,
19186-
startLine: location?.line,
19187-
startColumn: location?.column,
19194+
...extractLocation(event.data),
1918819195
title: event.data.name
1918919196
});
1919019197
counter.fail += 1;
1919119198
break;
1919219199
}
1919319200
case "test:diagnostic":
19194-
if (event.data.nesting === 0) {
19201+
if (event.data.file === void 0 || event.data.line === void 0 || event.data.column === void 0) {
1919519202
diagnostics.push(event.data.message);
1919619203
} else {
19197-
core.notice(event.data.message, { file: getFilePath(event.data.file) });
19204+
core.notice(event.data.message, extractLocation(event.data));
1919819205
}
1919919206
break;
1920019207
default:
Collapse file

‎tools/github_reporter/package.json‎

Copy file name to clipboardExpand all lines: tools/github_reporter/package.json
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@reporters/github",
3-
"version": "1.5.4",
3+
"version": "1.6.0",
44
"description": "A github actions reporter for `node:test`",
55
"type": "commonjs",
66
"keywords": [

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.