playwright-performance-regression 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/dist/{chunk-B4XTLSRN.js → chunk-BA37V6SL.js} +18 -3
- package/dist/{chunk-PWK5XSP2.cjs → chunk-CTE5EY35.cjs} +23 -23
- package/dist/{chunk-VREOANPX.cjs → chunk-LEIBG5A4.cjs} +54 -1
- package/dist/{chunk-YKBX6SAT.js → chunk-ORWOFAZ5.js} +54 -2
- package/dist/{chunk-4WX3Z5MJ.js → chunk-ZHJQFWES.js} +1 -1
- package/dist/cli.js +2 -2
- package/dist/config.cjs +13 -13
- package/dist/config.js +1 -1
- package/dist/fixture.cjs +5 -5
- package/dist/fixture.js +2 -2
- package/dist/reporter.cjs +117 -85
- package/dist/reporter.js +23 -6
- package/dist/test.cjs +3 -3
- package/dist/test.js +2 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,18 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [1.0.1] - 2026-11-25
|
|
11
|
+
|
|
12
|
+
A hotfix release.
|
|
13
|
+
|
|
14
|
+
### Fixed
|
|
15
|
+
|
|
16
|
+
- **Later passes repeat your script when it calls `npx playwright test`.** A script such as
|
|
17
|
+
`"e2e:qa": "npm run prep && npx playwright test --grep …"` ran later passes as the bare
|
|
18
|
+
`npx playwright test …` command, because `npx` hides the name of the outer script. The reporter
|
|
19
|
+
now finds the `npm run e2e:qa` process above Playwright and runs `npm run e2e:qa` again, so the
|
|
20
|
+
steps before Playwright run in every pass too. On Windows the behaviour is unchanged.
|
|
21
|
+
|
|
10
22
|
## [1.0.0] - 2026-11-23
|
|
11
23
|
|
|
12
24
|
The first stable release, published under the `latest` dist-tag: install with
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { KINDS } from './chunk-
|
|
1
|
+
import { KINDS } from './chunk-ORWOFAZ5.js';
|
|
2
2
|
import { str, nullable, constant, obj, bool, msOrNull, epochMs, enumOf, oneOf, int, arr, issue, isoDate, ratio, msLimit, fingerprint, hostFingerprint, derivationSettings, percentileName, count, timestamp, runId, envLabelOrNull, tool, kind, record, key, nul, anyObject, ms, num, packageConfig, mode, evaluationStatus, testsStatus, isRecord, Sink, child, expandSteps, DEFAULT_CONFIG } from './chunk-5Y34Q4DR.js';
|
|
3
3
|
import { rmSync, readFileSync, readdirSync, lstatSync, realpathSync, existsSync } from 'fs';
|
|
4
4
|
import { readFile, mkdir, writeFile, rename, rm, access } from 'fs/promises';
|
|
5
5
|
import { tmpdir, homedir, cpus, availableParallelism } from 'os';
|
|
6
6
|
import { join, resolve, dirname, relative, isAbsolute, basename, sep } from 'path';
|
|
7
7
|
import { randomUUID } from 'crypto';
|
|
8
|
-
import { spawn } from 'child_process';
|
|
8
|
+
import { spawn, spawnSync } from 'child_process';
|
|
9
9
|
|
|
10
10
|
function tempPath(name) {
|
|
11
11
|
return join(tmpdir(), name);
|
|
@@ -284,6 +284,21 @@ function runPass(command, env, cwd) {
|
|
|
284
284
|
}
|
|
285
285
|
});
|
|
286
286
|
}
|
|
287
|
+
function readProcessTable() {
|
|
288
|
+
if (process.platform === "win32") return null;
|
|
289
|
+
try {
|
|
290
|
+
const out = spawnSync("ps", ["-A", "-o", "pid=,ppid=,args="], {
|
|
291
|
+
encoding: "utf8",
|
|
292
|
+
timeout: 2e3,
|
|
293
|
+
shell: false,
|
|
294
|
+
windowsHide: true,
|
|
295
|
+
maxBuffer: 16 * 1024 * 1024
|
|
296
|
+
});
|
|
297
|
+
return out.status === 0 && typeof out.stdout === "string" ? out.stdout : null;
|
|
298
|
+
} catch {
|
|
299
|
+
return null;
|
|
300
|
+
}
|
|
301
|
+
}
|
|
287
302
|
function readPackageInfo(dir) {
|
|
288
303
|
for (let current = dir; ; current = dirname(current)) {
|
|
289
304
|
const file = join(current, "package.json");
|
|
@@ -1785,4 +1800,4 @@ function table(columns, rows, opts) {
|
|
|
1785
1800
|
];
|
|
1786
1801
|
}
|
|
1787
1802
|
|
|
1788
|
-
export { SCHEMA_VERSIONS, asciiTerminal, box, boxLines, ceilTo, colorEnabled, compareText, directoryOf, emptyDirSync, exceedance, floorTo, formatActual, formatFactor, formatLimit, formatMs, homeDir, isDirectorySync, listDirSync, loadThresholds, marks, overText, padEnd, paint, painter, parseRunReport, parseSampleBatch, plural, readCiInfo, readHostInfo, readPackageInfo, readSuite, readTextFile, readTextFileSync, realPathSync, relativeSlashPath, removeFileSync, resolvePath, roundMs, roundRatio, runPass, scanDirSync, schemaIssueToIssue, stringifyStable, table, tempPath, textWidth, thresholdsFilePaths, truncateMiddle, writeJsonStable, writeTextAtomic };
|
|
1803
|
+
export { SCHEMA_VERSIONS, asciiTerminal, box, boxLines, ceilTo, colorEnabled, compareText, directoryOf, emptyDirSync, exceedance, floorTo, formatActual, formatFactor, formatLimit, formatMs, homeDir, isDirectorySync, listDirSync, loadThresholds, marks, overText, padEnd, paint, painter, parseRunReport, parseSampleBatch, plural, readCiInfo, readHostInfo, readPackageInfo, readProcessTable, readSuite, readTextFile, readTextFileSync, realPathSync, relativeSlashPath, removeFileSync, resolvePath, roundMs, roundRatio, runPass, scanDirSync, schemaIssueToIssue, stringifyStable, table, tempPath, textWidth, thresholdsFilePaths, truncateMiddle, writeJsonStable, writeTextAtomic };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkLEIBG5A4_cjs = require('./chunk-LEIBG5A4.cjs');
|
|
4
4
|
var chunkW7NEFS5V_cjs = require('./chunk-W7NEFS5V.cjs');
|
|
5
5
|
var fs = require('fs');
|
|
6
6
|
var os = require('os');
|
|
@@ -8,7 +8,7 @@ var path = require('path');
|
|
|
8
8
|
|
|
9
9
|
var memory = { files: [], ran: 0 };
|
|
10
10
|
function checkStatePath(runId) {
|
|
11
|
-
return path.join(os.tmpdir(),
|
|
11
|
+
return path.join(os.tmpdir(), chunkLEIBG5A4_cjs.checkStateFileName(runId));
|
|
12
12
|
}
|
|
13
13
|
function load(path) {
|
|
14
14
|
if (path === null) return memory;
|
|
@@ -78,7 +78,7 @@ function isPromise(value) {
|
|
|
78
78
|
return typeof value === "object" && value !== null && typeof value.then === "function";
|
|
79
79
|
}
|
|
80
80
|
function wrapRequestContext(context, source, baseURL, recorder) {
|
|
81
|
-
const wrapped =
|
|
81
|
+
const wrapped = chunkLEIBG5A4_cjs.wrappedRequestContexts();
|
|
82
82
|
if (wrapped.has(context)) return false;
|
|
83
83
|
wrapped.add(context);
|
|
84
84
|
const target = context;
|
|
@@ -266,7 +266,7 @@ var NO_TIMING = {
|
|
|
266
266
|
};
|
|
267
267
|
var BODYLESS = /* @__PURE__ */ new Set([204, 205, 304]);
|
|
268
268
|
var ABORTED_AFTER_RESPONSE = new Set(
|
|
269
|
-
|
|
269
|
+
chunkLEIBG5A4_cjs.ABORT_FAILURE_TEXTS.filter((text) => text !== chunkLEIBG5A4_cjs.CONTEXT_CLOSED_FAILURE_TEXT)
|
|
270
270
|
);
|
|
271
271
|
var RequestTracker = class {
|
|
272
272
|
context;
|
|
@@ -436,7 +436,7 @@ var RequestTracker = class {
|
|
|
436
436
|
}
|
|
437
437
|
#closedByClient(request, entry) {
|
|
438
438
|
this.#settle(request);
|
|
439
|
-
this.#sink.finished(failed(request, entry,
|
|
439
|
+
this.#sink.finished(failed(request, entry, chunkLEIBG5A4_cjs.CONTEXT_CLOSED_FAILURE_TEXT, safeTiming(request)));
|
|
440
440
|
}
|
|
441
441
|
/** A request still in flight after the wait (05-REQ-13 step 4, 05-REQ-31). */
|
|
442
442
|
#leftover(request, entry) {
|
|
@@ -529,7 +529,7 @@ function pageOf(request) {
|
|
|
529
529
|
|
|
530
530
|
// src/collector/test-collector.ts
|
|
531
531
|
function currentRecorder() {
|
|
532
|
-
return
|
|
532
|
+
return chunkLEIBG5A4_cjs.activeCollector();
|
|
533
533
|
}
|
|
534
534
|
function firstLine(error) {
|
|
535
535
|
const line = errorText(error).split("\n", 1)[0]?.trim() ?? "";
|
|
@@ -822,10 +822,10 @@ var TestCollector = class {
|
|
|
822
822
|
try {
|
|
823
823
|
await this.drain();
|
|
824
824
|
const body = JSON.stringify(this.batch());
|
|
825
|
-
await testInfo.attach(
|
|
825
|
+
await testInfo.attach(chunkLEIBG5A4_cjs.SAMPLES_ATTACHMENT_NAME, { body, contentType: "application/json" });
|
|
826
826
|
} catch (error) {
|
|
827
827
|
process.stderr.write(
|
|
828
|
-
`COLLECTOR_ATTACH_FAILED: ${
|
|
828
|
+
`COLLECTOR_ATTACH_FAILED: ${chunkLEIBG5A4_cjs.SAMPLES_ATTACHMENT_NAME} could not be attached to the test result: ${errorText(error)}
|
|
829
829
|
`
|
|
830
830
|
);
|
|
831
831
|
}
|
|
@@ -843,34 +843,34 @@ function engineOf(context) {
|
|
|
843
843
|
var now = () => performance.now();
|
|
844
844
|
var wallNow = () => Date.now();
|
|
845
845
|
function perfModeOn() {
|
|
846
|
-
const mode =
|
|
847
|
-
if (!mode.ok) throw new
|
|
846
|
+
const mode = chunkLEIBG5A4_cjs.readModeState(process.env);
|
|
847
|
+
if (!mode.ok) throw new chunkLEIBG5A4_cjs.ConfigError(mode.issues);
|
|
848
848
|
return mode.value !== null;
|
|
849
849
|
}
|
|
850
850
|
var PASSIVE_API = createPerfApi(() => {
|
|
851
851
|
});
|
|
852
852
|
function openBuffer(browserName, baseURL, testInfo) {
|
|
853
|
-
const state =
|
|
853
|
+
const state = chunkLEIBG5A4_cjs.getRegistered();
|
|
854
854
|
if (state !== void 0 && (!state.config.measure.api || !state.measuredProjects.includes(testInfo.project.name))) {
|
|
855
855
|
return { collector: null, api: PASSIVE_API };
|
|
856
856
|
}
|
|
857
857
|
const collector = new TestCollector({
|
|
858
858
|
measure: (state?.config ?? chunkW7NEFS5V_cjs.perfDefaults).measure,
|
|
859
|
-
version:
|
|
859
|
+
version: chunkLEIBG5A4_cjs.version,
|
|
860
860
|
browserName,
|
|
861
861
|
testTimeout: () => testInfo.timeout,
|
|
862
862
|
baseURL,
|
|
863
863
|
now,
|
|
864
864
|
wallNow
|
|
865
865
|
});
|
|
866
|
-
for (const context of
|
|
866
|
+
for (const context of chunkLEIBG5A4_cjs.trackedContexts()) collector.track(context);
|
|
867
867
|
return { collector, api: collector.api };
|
|
868
868
|
}
|
|
869
869
|
function skipInCheck(testInfo) {
|
|
870
|
-
const state =
|
|
870
|
+
const state = chunkLEIBG5A4_cjs.getRegistered();
|
|
871
871
|
if (state === void 0 || state.mode.mode !== "check") return;
|
|
872
872
|
if (!state.measuredProjects.includes(testInfo.project.name)) return;
|
|
873
|
-
const max = state.mode.maxTests ??
|
|
873
|
+
const max = state.mode.maxTests ?? chunkLEIBG5A4_cjs.DEFAULT_MAX_TESTS;
|
|
874
874
|
if (!checkRunsTest(state.mode.runId, max, testInfo.project.name, testInfo.file)) {
|
|
875
875
|
testInfo.skip(true, "PW_PERF_MODE=check: only the first test of each file runs");
|
|
876
876
|
}
|
|
@@ -886,10 +886,10 @@ var perfFixtures = {
|
|
|
886
886
|
skipInCheck(testInfo);
|
|
887
887
|
const buffer = openBuffer(browserName ?? null, baseURL, testInfo);
|
|
888
888
|
const { collector } = buffer;
|
|
889
|
-
if (collector !== null)
|
|
889
|
+
if (collector !== null) chunkLEIBG5A4_cjs.setActiveCollector(collector);
|
|
890
890
|
await use(buffer);
|
|
891
891
|
if (collector === null) return;
|
|
892
|
-
if (
|
|
892
|
+
if (chunkLEIBG5A4_cjs.activeCollector() === collector) chunkLEIBG5A4_cjs.setActiveCollector(void 0);
|
|
893
893
|
collector.markTeardownStart();
|
|
894
894
|
await collector.attach(testInfo);
|
|
895
895
|
},
|
|
@@ -916,7 +916,7 @@ var perfFixtures = {
|
|
|
916
916
|
}
|
|
917
917
|
};
|
|
918
918
|
function withPerfFixtures(base2) {
|
|
919
|
-
const wrapped =
|
|
919
|
+
const wrapped = chunkLEIBG5A4_cjs.wrappedTests();
|
|
920
920
|
if (wrapped.has(base2)) return base2;
|
|
921
921
|
const extend = base2.extend;
|
|
922
922
|
const result = extend.call(base2, perfModeOn() ? perfFixtures : passiveFixtures);
|
|
@@ -925,22 +925,22 @@ function withPerfFixtures(base2) {
|
|
|
925
925
|
}
|
|
926
926
|
function trackContext(context) {
|
|
927
927
|
if (!perfModeOn()) return;
|
|
928
|
-
const contexts =
|
|
928
|
+
const contexts = chunkLEIBG5A4_cjs.trackedContexts();
|
|
929
929
|
if (!contexts.has(context)) {
|
|
930
930
|
contexts.add(context);
|
|
931
931
|
context.once("close", () => contexts.delete(context));
|
|
932
932
|
}
|
|
933
|
-
|
|
933
|
+
chunkLEIBG5A4_cjs.activeCollector()?.track(context);
|
|
934
934
|
}
|
|
935
935
|
function trackRequestContext(requestContext) {
|
|
936
936
|
if (!perfModeOn()) return;
|
|
937
|
-
const state =
|
|
937
|
+
const state = chunkLEIBG5A4_cjs.getRegistered();
|
|
938
938
|
if (state !== void 0 && !state.config.measure.api) return;
|
|
939
939
|
if (!isApiRequestContext(requestContext)) {
|
|
940
|
-
|
|
940
|
+
chunkLEIBG5A4_cjs.activeCollector()?.requestContextNotTracked();
|
|
941
941
|
return;
|
|
942
942
|
}
|
|
943
|
-
wrapRequestContext(requestContext, "tracked", void 0,
|
|
943
|
+
wrapRequestContext(requestContext, "tracked", void 0, chunkLEIBG5A4_cjs.activeCollector);
|
|
944
944
|
}
|
|
945
945
|
|
|
946
946
|
exports.trackContext = trackContext;
|
|
@@ -374,6 +374,58 @@ function passCommand(input) {
|
|
|
374
374
|
}
|
|
375
375
|
return { file: input.execPath, args: input.argv.slice(1) };
|
|
376
376
|
}
|
|
377
|
+
function parseProcessTable(text) {
|
|
378
|
+
const rows = [];
|
|
379
|
+
for (const line of text.split(/\r?\n/u)) {
|
|
380
|
+
const match = /^\s*(\d+)\s+(\d+)\s+(.*)$/u.exec(line);
|
|
381
|
+
if (match === null) continue;
|
|
382
|
+
rows.push({ pid: Number(match[1]), ppid: Number(match[2]), args: match[3] ?? "" });
|
|
383
|
+
}
|
|
384
|
+
return rows;
|
|
385
|
+
}
|
|
386
|
+
var MANAGER = /^(npm|pnpm|yarn|bun)(-cli)?(\.[cm]?js)?$/iu;
|
|
387
|
+
var MAX_DEPTH = 16;
|
|
388
|
+
function runScriptName(args) {
|
|
389
|
+
const w = args.split(/\s+/u).filter((word) => word !== "");
|
|
390
|
+
let i = 0;
|
|
391
|
+
if (!MANAGER.test(baseName(w[0] ?? ""))) {
|
|
392
|
+
if (!/^node(\.exe)?$/iu.test(baseName(w[0] ?? ""))) return null;
|
|
393
|
+
i = 1;
|
|
394
|
+
if (!MANAGER.test(baseName(w[1] ?? ""))) return null;
|
|
395
|
+
}
|
|
396
|
+
i += 1;
|
|
397
|
+
while ((w[i] ?? "").startsWith("-")) i += 1;
|
|
398
|
+
if (w[i] !== "run" && w[i] !== "run-script") return null;
|
|
399
|
+
return w[i + 1] ?? null;
|
|
400
|
+
}
|
|
401
|
+
function ancestorScript(input) {
|
|
402
|
+
const byPid = new Map(input.rows.map((row) => [row.pid, row]));
|
|
403
|
+
let current = byPid.get(input.pid)?.ppid;
|
|
404
|
+
for (let depth = 0; depth < MAX_DEPTH && current !== void 0 && current > 0; depth += 1) {
|
|
405
|
+
const row = byPid.get(current);
|
|
406
|
+
if (row === void 0) return null;
|
|
407
|
+
const name = runScriptName(row.args);
|
|
408
|
+
if (name !== null && Object.hasOwn(input.scripts, name) && /playwright/u.test(input.scripts[name] ?? "")) {
|
|
409
|
+
return name;
|
|
410
|
+
}
|
|
411
|
+
if (row.ppid === row.pid) return null;
|
|
412
|
+
current = row.ppid;
|
|
413
|
+
}
|
|
414
|
+
return null;
|
|
415
|
+
}
|
|
416
|
+
function scriptEnv(input) {
|
|
417
|
+
const { env, scripts } = input;
|
|
418
|
+
const event = env["npm_lifecycle_event"];
|
|
419
|
+
const manager = env["npm_execpath"];
|
|
420
|
+
if (event === void 0 || event === "" || manager === void 0 || manager === "" || scripts === null || scripts === void 0 || Object.hasOwn(scripts, event) || input.pid === void 0 || input.processTable === void 0) {
|
|
421
|
+
return env;
|
|
422
|
+
}
|
|
423
|
+
const text = input.processTable();
|
|
424
|
+
if (text === null) return env;
|
|
425
|
+
const name = ancestorScript({ rows: parseProcessTable(text), pid: input.pid, scripts });
|
|
426
|
+
if (name === null) return env;
|
|
427
|
+
return { ...env, npm_lifecycle_event: name, npm_lifecycle_script: scripts[name] ?? "" };
|
|
428
|
+
}
|
|
377
429
|
|
|
378
430
|
// src/mode/index.ts
|
|
379
431
|
var MODE = "PW_PERF_MODE";
|
|
@@ -613,7 +665,7 @@ function setActiveCollector(collector) {
|
|
|
613
665
|
}
|
|
614
666
|
|
|
615
667
|
// package.json
|
|
616
|
-
var version = "1.0.
|
|
668
|
+
var version = "1.0.1";
|
|
617
669
|
|
|
618
670
|
exports.ABORT_FAILURE_TEXTS = ABORT_FAILURE_TEXTS;
|
|
619
671
|
exports.CONFIG_FILE_BASENAME = CONFIG_FILE_BASENAME;
|
|
@@ -646,6 +698,7 @@ exports.notWrappedWarning = notWrappedWarning;
|
|
|
646
698
|
exports.passCommand = passCommand;
|
|
647
699
|
exports.readModeState = readModeState;
|
|
648
700
|
exports.runShape = runShape;
|
|
701
|
+
exports.scriptEnv = scriptEnv;
|
|
649
702
|
exports.setActiveCollector = setActiveCollector;
|
|
650
703
|
exports.setRegistered = setRegistered;
|
|
651
704
|
exports.skippedReasonText = skippedReasonText;
|
|
@@ -373,6 +373,58 @@ function passCommand(input) {
|
|
|
373
373
|
}
|
|
374
374
|
return { file: input.execPath, args: input.argv.slice(1) };
|
|
375
375
|
}
|
|
376
|
+
function parseProcessTable(text) {
|
|
377
|
+
const rows = [];
|
|
378
|
+
for (const line of text.split(/\r?\n/u)) {
|
|
379
|
+
const match = /^\s*(\d+)\s+(\d+)\s+(.*)$/u.exec(line);
|
|
380
|
+
if (match === null) continue;
|
|
381
|
+
rows.push({ pid: Number(match[1]), ppid: Number(match[2]), args: match[3] ?? "" });
|
|
382
|
+
}
|
|
383
|
+
return rows;
|
|
384
|
+
}
|
|
385
|
+
var MANAGER = /^(npm|pnpm|yarn|bun)(-cli)?(\.[cm]?js)?$/iu;
|
|
386
|
+
var MAX_DEPTH = 16;
|
|
387
|
+
function runScriptName(args) {
|
|
388
|
+
const w = args.split(/\s+/u).filter((word) => word !== "");
|
|
389
|
+
let i = 0;
|
|
390
|
+
if (!MANAGER.test(baseName(w[0] ?? ""))) {
|
|
391
|
+
if (!/^node(\.exe)?$/iu.test(baseName(w[0] ?? ""))) return null;
|
|
392
|
+
i = 1;
|
|
393
|
+
if (!MANAGER.test(baseName(w[1] ?? ""))) return null;
|
|
394
|
+
}
|
|
395
|
+
i += 1;
|
|
396
|
+
while ((w[i] ?? "").startsWith("-")) i += 1;
|
|
397
|
+
if (w[i] !== "run" && w[i] !== "run-script") return null;
|
|
398
|
+
return w[i + 1] ?? null;
|
|
399
|
+
}
|
|
400
|
+
function ancestorScript(input) {
|
|
401
|
+
const byPid = new Map(input.rows.map((row) => [row.pid, row]));
|
|
402
|
+
let current = byPid.get(input.pid)?.ppid;
|
|
403
|
+
for (let depth = 0; depth < MAX_DEPTH && current !== void 0 && current > 0; depth += 1) {
|
|
404
|
+
const row = byPid.get(current);
|
|
405
|
+
if (row === void 0) return null;
|
|
406
|
+
const name = runScriptName(row.args);
|
|
407
|
+
if (name !== null && Object.hasOwn(input.scripts, name) && /playwright/u.test(input.scripts[name] ?? "")) {
|
|
408
|
+
return name;
|
|
409
|
+
}
|
|
410
|
+
if (row.ppid === row.pid) return null;
|
|
411
|
+
current = row.ppid;
|
|
412
|
+
}
|
|
413
|
+
return null;
|
|
414
|
+
}
|
|
415
|
+
function scriptEnv(input) {
|
|
416
|
+
const { env, scripts } = input;
|
|
417
|
+
const event = env["npm_lifecycle_event"];
|
|
418
|
+
const manager = env["npm_execpath"];
|
|
419
|
+
if (event === void 0 || event === "" || manager === void 0 || manager === "" || scripts === null || scripts === void 0 || Object.hasOwn(scripts, event) || input.pid === void 0 || input.processTable === void 0) {
|
|
420
|
+
return env;
|
|
421
|
+
}
|
|
422
|
+
const text = input.processTable();
|
|
423
|
+
if (text === null) return env;
|
|
424
|
+
const name = ancestorScript({ rows: parseProcessTable(text), pid: input.pid, scripts });
|
|
425
|
+
if (name === null) return env;
|
|
426
|
+
return { ...env, npm_lifecycle_event: name, npm_lifecycle_script: scripts[name] ?? "" };
|
|
427
|
+
}
|
|
376
428
|
|
|
377
429
|
// src/mode/index.ts
|
|
378
430
|
var MODE = "PW_PERF_MODE";
|
|
@@ -587,9 +639,9 @@ function readInitEnv(env, languages) {
|
|
|
587
639
|
var RUN_ID_ENV = RUN_ID;
|
|
588
640
|
|
|
589
641
|
// package.json
|
|
590
|
-
var version = "1.0.
|
|
642
|
+
var version = "1.0.1";
|
|
591
643
|
var peerDependencies = {
|
|
592
644
|
"@playwright/test": ">=1.57.0"
|
|
593
645
|
};
|
|
594
646
|
|
|
595
|
-
export { ABORT_FAILURE_TEXTS, CONFIG_FILE_BASENAME, CONFIG_FILE_EXTENSIONS, CONTEXT_CLOSED_FAILURE_TEXT, ConfigError, DEFAULT_MAX_TESTS, DIFF_CATEGORIES, DOCS_CONFIG_URL, INIT_COMMAND, KINDS, LIMIT_NAMES, LISTED_CATEGORIES, PACKAGE_NAME, PRUNE_COMMAND, REPOSITORY_URL, REQUEST_KEY_PREFIX, RUN_ID_ENV, SAMPLES_ATTACHMENT_NAME, THRESHOLDS_COMMAND, argvWarnings, checkStateFileName, diffChangeText, diffCountsText, diffMarker, diffValuesText, generateRunId, isRequestKey, parsePasses, passCommand, peerDependencies, readInitEnv, readModeState, runShape, skippedReasonText, testArgsFromArgv, testFilters, version, writeModeState };
|
|
647
|
+
export { ABORT_FAILURE_TEXTS, CONFIG_FILE_BASENAME, CONFIG_FILE_EXTENSIONS, CONTEXT_CLOSED_FAILURE_TEXT, ConfigError, DEFAULT_MAX_TESTS, DIFF_CATEGORIES, DOCS_CONFIG_URL, INIT_COMMAND, KINDS, LIMIT_NAMES, LISTED_CATEGORIES, PACKAGE_NAME, PRUNE_COMMAND, REPOSITORY_URL, REQUEST_KEY_PREFIX, RUN_ID_ENV, SAMPLES_ATTACHMENT_NAME, THRESHOLDS_COMMAND, argvWarnings, checkStateFileName, diffChangeText, diffCountsText, diffMarker, diffValuesText, generateRunId, isRequestKey, parsePasses, passCommand, peerDependencies, readInitEnv, readModeState, runShape, scriptEnv, skippedReasonText, testArgsFromArgv, testFilters, version, writeModeState };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { wrappedTests, trackedContexts, activeCollector, getRegistered, setActiveCollector, wrappedRequestContexts } from './chunk-S6UH6QPK.js';
|
|
2
|
-
import { ABORT_FAILURE_TEXTS, CONTEXT_CLOSED_FAILURE_TEXT, readModeState, ConfigError, DEFAULT_MAX_TESTS, version, SAMPLES_ATTACHMENT_NAME, checkStateFileName } from './chunk-
|
|
2
|
+
import { ABORT_FAILURE_TEXTS, CONTEXT_CLOSED_FAILURE_TEXT, readModeState, ConfigError, DEFAULT_MAX_TESTS, version, SAMPLES_ATTACHMENT_NAME, checkStateFileName } from './chunk-ORWOFAZ5.js';
|
|
3
3
|
import { perfDefaults } from './chunk-5Y34Q4DR.js';
|
|
4
4
|
import { readFileSync, writeFileSync } from 'fs';
|
|
5
5
|
import { tmpdir } from 'os';
|
package/dist/cli.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { readTextFile, colorEnabled, painter, asciiTerminal, box, marks, paint, stringifyStable, SCHEMA_VERSIONS } from './chunk-
|
|
3
|
-
import { INIT_COMMAND, CONFIG_FILE_EXTENSIONS, CONFIG_FILE_BASENAME, readInitEnv, PACKAGE_NAME, REPOSITORY_URL, peerDependencies, parsePasses, writeModeState, DOCS_CONFIG_URL } from './chunk-
|
|
2
|
+
import { readTextFile, colorEnabled, painter, asciiTerminal, box, marks, paint, stringifyStable, SCHEMA_VERSIONS } from './chunk-BA37V6SL.js';
|
|
3
|
+
import { INIT_COMMAND, CONFIG_FILE_EXTENSIONS, CONFIG_FILE_BASENAME, readInitEnv, PACKAGE_NAME, REPOSITORY_URL, peerDependencies, parsePasses, writeModeState, DOCS_CONFIG_URL } from './chunk-ORWOFAZ5.js';
|
|
4
4
|
import { DEFAULT_CONFIG, resolveConfig, MARGIN_PRESETS } from './chunk-5Y34Q4DR.js';
|
|
5
5
|
import { createInterface } from 'readline/promises';
|
|
6
6
|
import { spawn } from 'child_process';
|
package/dist/config.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkLEIBG5A4_cjs = require('./chunk-LEIBG5A4.cjs');
|
|
4
4
|
var chunkW7NEFS5V_cjs = require('./chunk-W7NEFS5V.cjs');
|
|
5
5
|
|
|
6
6
|
// src/config/reporter-path.ts
|
|
@@ -20,7 +20,7 @@ function reporterEntryPath() {
|
|
|
20
20
|
// src/config/run-conditions.ts
|
|
21
21
|
var CONSOLE_REPORTERS = /* @__PURE__ */ new Set(["list", "line", "dot", "github"]);
|
|
22
22
|
var ARTIFACTS = ["trace", "video", "screenshot"];
|
|
23
|
-
var PACKAGE_REPORTER = `${
|
|
23
|
+
var PACKAGE_REPORTER = `${chunkLEIBG5A4_cjs.PACKAGE_NAME}/reporter`;
|
|
24
24
|
function projectName(project) {
|
|
25
25
|
return project.name ?? "";
|
|
26
26
|
}
|
|
@@ -170,11 +170,11 @@ function planPerfRun(config, input) {
|
|
|
170
170
|
|
|
171
171
|
// src/config/with-perf.ts
|
|
172
172
|
function withPerf(config, perfConfig) {
|
|
173
|
-
const first =
|
|
174
|
-
if (!first.ok) throw new
|
|
173
|
+
const first = chunkLEIBG5A4_cjs.readModeState(process.env);
|
|
174
|
+
if (!first.ok) throw new chunkLEIBG5A4_cjs.ConfigError(first.issues);
|
|
175
175
|
if (first.value === null) return config;
|
|
176
176
|
const argvIssues = mainProcessSetup(first.value.mode);
|
|
177
|
-
const mode =
|
|
177
|
+
const mode = chunkLEIBG5A4_cjs.readModeState(process.env);
|
|
178
178
|
if (!mode.ok || mode.value === null) throw new Error("withPerf: the mode state changed");
|
|
179
179
|
const state = mode.value;
|
|
180
180
|
const resolved = chunkW7NEFS5V_cjs.resolveConfig(perfConfig, {
|
|
@@ -184,7 +184,7 @@ function withPerf(config, perfConfig) {
|
|
|
184
184
|
...state.thresholdsDir === void 0 ? {} : { thresholdsDir: state.thresholdsDir },
|
|
185
185
|
...state.minSamples === void 0 ? {} : { minSamples: state.minSamples }
|
|
186
186
|
});
|
|
187
|
-
if (!resolved.ok) throw new
|
|
187
|
+
if (!resolved.ok) throw new chunkLEIBG5A4_cjs.ConfigError(resolved.issues);
|
|
188
188
|
const { config: perf, snapshot, warnings } = resolved.value;
|
|
189
189
|
const plan = planPerfRun(config, {
|
|
190
190
|
keepReporters: perf.run.keepReporters,
|
|
@@ -192,11 +192,11 @@ function withPerf(config, perfConfig) {
|
|
|
192
192
|
overrideSlowMo: perf.run.overrideSlowMo,
|
|
193
193
|
reporterPath: reporterEntryPath()
|
|
194
194
|
});
|
|
195
|
-
|
|
195
|
+
chunkLEIBG5A4_cjs.setRegistered({
|
|
196
196
|
config: perf,
|
|
197
197
|
snapshot,
|
|
198
198
|
mode: state,
|
|
199
|
-
packageVersion:
|
|
199
|
+
packageVersion: chunkLEIBG5A4_cjs.version,
|
|
200
200
|
measuredProjects: plan.value.measuredProjects,
|
|
201
201
|
runConditions: plan.value.runConditions,
|
|
202
202
|
warnings: [...warnings, ...argvIssues],
|
|
@@ -215,16 +215,16 @@ function mainProcessSetup(mode) {
|
|
|
215
215
|
const store = globalThis;
|
|
216
216
|
const done = store[SETUP_DONE];
|
|
217
217
|
if (done !== void 0) return done;
|
|
218
|
-
if ((process.env[
|
|
219
|
-
process.env[
|
|
218
|
+
if ((process.env[chunkLEIBG5A4_cjs.RUN_ID_ENV] ?? "") === "") {
|
|
219
|
+
process.env[chunkLEIBG5A4_cjs.RUN_ID_ENV] = chunkLEIBG5A4_cjs.generateRunId(/* @__PURE__ */ new Date(), Math.random);
|
|
220
220
|
}
|
|
221
|
-
const found =
|
|
222
|
-
if (found.reporter !== null && mode !== "check") throw new
|
|
221
|
+
const found = chunkLEIBG5A4_cjs.argvWarnings(process.argv, chunkLEIBG5A4_cjs.PACKAGE_NAME, mode);
|
|
222
|
+
if (found.reporter !== null && mode !== "check") throw new chunkLEIBG5A4_cjs.ConfigError([found.reporter]);
|
|
223
223
|
const report = [];
|
|
224
224
|
for (const issue of [found.reporter, found.unsupported]) {
|
|
225
225
|
if (issue === null) continue;
|
|
226
226
|
process.stderr.write(
|
|
227
|
-
`${
|
|
227
|
+
`${chunkLEIBG5A4_cjs.PACKAGE_NAME}: warning ${issue.code}: ${issue.message}
|
|
228
228
|
Hint: ${issue.hint}
|
|
229
229
|
`
|
|
230
230
|
);
|
package/dist/config.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { setRegistered } from './chunk-S6UH6QPK.js';
|
|
2
|
-
import { readModeState, ConfigError, version, RUN_ID_ENV, generateRunId, argvWarnings, PACKAGE_NAME } from './chunk-
|
|
2
|
+
import { readModeState, ConfigError, version, RUN_ID_ENV, generateRunId, argvWarnings, PACKAGE_NAME } from './chunk-ORWOFAZ5.js';
|
|
3
3
|
import { resolveConfig } from './chunk-5Y34Q4DR.js';
|
|
4
4
|
export { definePerfConfig } from './chunk-5Y34Q4DR.js';
|
|
5
5
|
|
package/dist/fixture.cjs
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('./chunk-
|
|
3
|
+
var chunkCTE5EY35_cjs = require('./chunk-CTE5EY35.cjs');
|
|
4
|
+
require('./chunk-LEIBG5A4.cjs');
|
|
5
5
|
require('./chunk-W7NEFS5V.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
Object.defineProperty(exports, "trackContext", {
|
|
10
10
|
enumerable: true,
|
|
11
|
-
get: function () { return
|
|
11
|
+
get: function () { return chunkCTE5EY35_cjs.trackContext; }
|
|
12
12
|
});
|
|
13
13
|
Object.defineProperty(exports, "trackRequestContext", {
|
|
14
14
|
enumerable: true,
|
|
15
|
-
get: function () { return
|
|
15
|
+
get: function () { return chunkCTE5EY35_cjs.trackRequestContext; }
|
|
16
16
|
});
|
|
17
17
|
Object.defineProperty(exports, "withPerfFixtures", {
|
|
18
18
|
enumerable: true,
|
|
19
|
-
get: function () { return
|
|
19
|
+
get: function () { return chunkCTE5EY35_cjs.withPerfFixtures; }
|
|
20
20
|
});
|
package/dist/fixture.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { trackContext, trackRequestContext, withPerfFixtures } from './chunk-
|
|
1
|
+
export { trackContext, trackRequestContext, withPerfFixtures } from './chunk-ZHJQFWES.js';
|
|
2
2
|
import './chunk-S6UH6QPK.js';
|
|
3
|
-
import './chunk-
|
|
3
|
+
import './chunk-ORWOFAZ5.js';
|
|
4
4
|
import './chunk-5Y34Q4DR.js';
|