Update npm packages (73 packages including @jqhtml 2.3.36)
Update npm registry domain from privatenpm.hanson.xyz to npm.internal.hanson.xyz 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
33
node_modules/playwright/lib/reporters/merge.js
generated
vendored
33
node_modules/playwright/lib/reporters/merge.js
generated
vendored
@@ -55,10 +55,15 @@ async function createMergedReport(config, dir, reporterDescriptions, rootDirOver
|
||||
throw new Error(`No report files found in ${dir}`);
|
||||
const eventData = await mergeEvents(dir, shardFiles, stringPool, printStatus, rootDirOverride);
|
||||
const pathSeparator = rootDirOverride ? import_path.default.sep : eventData.pathSeparatorFromMetadata ?? import_path.default.sep;
|
||||
const pathPackage = pathSeparator === "/" ? import_path.default.posix : import_path.default.win32;
|
||||
const receiver = new import_teleReceiver.TeleReporterReceiver(multiplexer, {
|
||||
mergeProjects: false,
|
||||
mergeTestCases: false,
|
||||
resolvePath: (rootDir, relativePath) => stringPool.internString(rootDir + pathSeparator + relativePath),
|
||||
// When merging on a different OS, an absolute path like `C:\foo\bar` from win may look like
|
||||
// a relative path on posix, and vice versa.
|
||||
// Therefore, we cannot use `path.resolve()` here - it will resolve relative-looking paths
|
||||
// against `process.cwd()`, while we just want to normalize ".." and "." segments.
|
||||
resolvePath: (rootDir, relativePath) => stringPool.internString(pathPackage.normalize(pathPackage.join(rootDir, relativePath))),
|
||||
configOverrides: config.config
|
||||
});
|
||||
printStatus(`processing test events`);
|
||||
@@ -72,7 +77,7 @@ async function createMergedReport(config, dir, reporterDescriptions, rootDirOver
|
||||
}
|
||||
};
|
||||
await dispatchEvents(eventData.prologue);
|
||||
for (const { reportFile, eventPatchers, metadata, tags } of eventData.reports) {
|
||||
for (const { reportFile, eventPatchers, metadata, tags, startTime, duration } of eventData.reports) {
|
||||
const reportJsonl = await import_fs.default.promises.readFile(reportFile);
|
||||
const events = parseTestEvents(reportJsonl);
|
||||
new import_stringInternPool.JsonStringInternalizer(stringPool).traverse(events);
|
||||
@@ -83,6 +88,12 @@ async function createMergedReport(config, dir, reporterDescriptions, rootDirOver
|
||||
eventPatchers.patchers.push(new GlobalErrorPatcher(tags.join(" ")));
|
||||
eventPatchers.patchEvents(events);
|
||||
await dispatchEvents(events);
|
||||
multiplexer.onMachineEnd({
|
||||
startTime: new Date(startTime),
|
||||
duration,
|
||||
tag: tags,
|
||||
shardIndex: metadata.shard?.current
|
||||
});
|
||||
}
|
||||
await dispatchEvents(eventData.epilogue);
|
||||
}
|
||||
@@ -181,6 +192,8 @@ async function mergeEvents(dir, shardReportFiles, stringPool, printStatus, rootD
|
||||
eventPatchers.patchers.push(new PathSeparatorPatcher(metadata.pathSeparator));
|
||||
eventPatchers.patchEvents(parsedEvents);
|
||||
let tags = [];
|
||||
let startTime = 0;
|
||||
let duration = 0;
|
||||
for (const event of parsedEvents) {
|
||||
if (event.method === "onConfigure") {
|
||||
configureEvents.push(event);
|
||||
@@ -188,14 +201,18 @@ async function mergeEvents(dir, shardReportFiles, stringPool, printStatus, rootD
|
||||
} else if (event.method === "onProject") {
|
||||
projectEvents.push(event);
|
||||
} else if (event.method === "onEnd") {
|
||||
endEvents.push(event);
|
||||
endEvents.push({ event, metadata, tags });
|
||||
startTime = event.params.result.startTime;
|
||||
duration = event.params.result.duration;
|
||||
}
|
||||
}
|
||||
reports.push({
|
||||
eventPatchers,
|
||||
reportFile: localPath,
|
||||
metadata,
|
||||
tags
|
||||
tags,
|
||||
startTime,
|
||||
duration
|
||||
});
|
||||
}
|
||||
return {
|
||||
@@ -270,8 +287,8 @@ function mergeConfigs(to, from) {
|
||||
function mergeEndEvents(endEvents) {
|
||||
let startTime = endEvents.length ? 1e13 : Date.now();
|
||||
let status = "passed";
|
||||
let duration = 0;
|
||||
for (const event of endEvents) {
|
||||
let endTime = 0;
|
||||
for (const { event } of endEvents) {
|
||||
const shardResult = event.params.result;
|
||||
if (shardResult.status === "failed")
|
||||
status = "failed";
|
||||
@@ -280,12 +297,12 @@ function mergeEndEvents(endEvents) {
|
||||
else if (shardResult.status === "interrupted" && status !== "failed" && status !== "timedout")
|
||||
status = "interrupted";
|
||||
startTime = Math.min(startTime, shardResult.startTime);
|
||||
duration = Math.max(duration, shardResult.duration);
|
||||
endTime = Math.max(endTime, shardResult.startTime + shardResult.duration);
|
||||
}
|
||||
const result = {
|
||||
status,
|
||||
startTime,
|
||||
duration
|
||||
duration: endTime - startTime
|
||||
};
|
||||
return {
|
||||
method: "onEnd",
|
||||
|
||||
Reference in New Issue
Block a user