playwright-performance-regression 0.1.0-next.0 → 0.1.0-next.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 +18 -0
- package/README.md +3 -1
- package/dist/{chunk-JEHUFIY3.js → chunk-3CLCMD2Q.js} +45 -24
- package/dist/{chunk-LV3O2BAT.cjs → chunk-4SFI55HF.cjs} +1 -1
- package/dist/{chunk-UTTU4FUC.js → chunk-B64P2D5A.js} +2 -2
- package/dist/{chunk-6AB42SPF.js → chunk-HBGADXLP.js} +6 -6
- package/dist/{chunk-HES6BVZT.js → chunk-L5C63HEF.js} +2 -2
- package/dist/{chunk-R2NPYGB7.cjs → chunk-WZVQK7CQ.cjs} +14 -14
- package/dist/cli.js +1177 -253
- package/dist/config.cjs +9 -9
- package/dist/config.js +3 -3
- package/dist/fixture.cjs +4 -4
- package/dist/fixture.js +3 -3
- package/dist/index.js +1 -1
- package/dist/reporter.cjs +84 -66
- package/dist/reporter.js +19 -22
- package/dist/test.cjs +3 -3
- package/dist/test.js +3 -3
- package/package.json +3 -3
package/dist/config.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunk4SFI55HF_cjs = require('./chunk-4SFI55HF.cjs');
|
|
4
4
|
var chunkGCA73FFP_cjs = require('./chunk-GCA73FFP.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 = `${chunk4SFI55HF_cjs.PACKAGE_NAME}/reporter`;
|
|
24
24
|
function projectName(project) {
|
|
25
25
|
return project.name ?? "";
|
|
26
26
|
}
|
|
@@ -218,8 +218,8 @@ function planPerfRun(config, input) {
|
|
|
218
218
|
|
|
219
219
|
// src/config/with-perf.ts
|
|
220
220
|
function withPerf(config, perfConfig) {
|
|
221
|
-
const mode =
|
|
222
|
-
if (!mode.ok) throw new
|
|
221
|
+
const mode = chunk4SFI55HF_cjs.readModeState(process.env);
|
|
222
|
+
if (!mode.ok) throw new chunk4SFI55HF_cjs.ConfigError(mode.issues);
|
|
223
223
|
if (mode.value === null) return config;
|
|
224
224
|
const state = mode.value;
|
|
225
225
|
const resolved = chunkGCA73FFP_cjs.resolveConfig(perfConfig, {
|
|
@@ -227,21 +227,21 @@ function withPerf(config, perfConfig) {
|
|
|
227
227
|
...state.repeat === void 0 ? {} : { repeat: state.repeat },
|
|
228
228
|
...state.env === void 0 ? {} : { env: state.env }
|
|
229
229
|
});
|
|
230
|
-
if (!resolved.ok) throw new
|
|
230
|
+
if (!resolved.ok) throw new chunk4SFI55HF_cjs.ConfigError(resolved.issues);
|
|
231
231
|
const { config: perf, snapshot, warnings } = resolved.value;
|
|
232
232
|
const plan = planPerfRun(config, {
|
|
233
233
|
projects: perf.run.projects,
|
|
234
234
|
keepReporters: perf.run.keepReporters,
|
|
235
235
|
repeat: perf.run.repeat[state.mode],
|
|
236
|
-
ci:
|
|
236
|
+
ci: chunk4SFI55HF_cjs.isCiEnv(process.env),
|
|
237
237
|
reporterPath: reporterEntryPath()
|
|
238
238
|
});
|
|
239
|
-
if (!plan.ok) throw new
|
|
240
|
-
|
|
239
|
+
if (!plan.ok) throw new chunk4SFI55HF_cjs.ConfigError(plan.issues);
|
|
240
|
+
chunk4SFI55HF_cjs.setRegistered({
|
|
241
241
|
config: perf,
|
|
242
242
|
snapshot,
|
|
243
243
|
mode: state,
|
|
244
|
-
packageVersion:
|
|
244
|
+
packageVersion: chunk4SFI55HF_cjs.version,
|
|
245
245
|
measuredProjects: plan.value.measuredProjects,
|
|
246
246
|
runConditions: plan.value.runConditions,
|
|
247
247
|
warnings: [...warnings, ...plan.value.warnings]
|
package/dist/config.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { setRegistered } from './chunk-DYLCGMI2.js';
|
|
2
|
-
import { readModeState, ConfigError, isCiEnv, version, PACKAGE_NAME } from './chunk-
|
|
3
|
-
import { resolveConfig } from './chunk-
|
|
4
|
-
export { definePerfConfig } from './chunk-
|
|
2
|
+
import { readModeState, ConfigError, isCiEnv, version, PACKAGE_NAME } from './chunk-HBGADXLP.js';
|
|
3
|
+
import { resolveConfig } from './chunk-L5C63HEF.js';
|
|
4
|
+
export { definePerfConfig } from './chunk-L5C63HEF.js';
|
|
5
5
|
|
|
6
6
|
// src/config/reporter-path.ts
|
|
7
7
|
function currentFile() {
|
package/dist/fixture.cjs
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('./chunk-
|
|
3
|
+
var chunkWZVQK7CQ_cjs = require('./chunk-WZVQK7CQ.cjs');
|
|
4
|
+
require('./chunk-4SFI55HF.cjs');
|
|
5
5
|
require('./chunk-GCA73FFP.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 chunkWZVQK7CQ_cjs.trackContext; }
|
|
12
12
|
});
|
|
13
13
|
Object.defineProperty(exports, "withPerfFixtures", {
|
|
14
14
|
enumerable: true,
|
|
15
|
-
get: function () { return
|
|
15
|
+
get: function () { return chunkWZVQK7CQ_cjs.withPerfFixtures; }
|
|
16
16
|
});
|
package/dist/fixture.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { trackContext, withPerfFixtures } from './chunk-
|
|
1
|
+
export { trackContext, withPerfFixtures } from './chunk-B64P2D5A.js';
|
|
2
2
|
import './chunk-DYLCGMI2.js';
|
|
3
|
-
import './chunk-
|
|
4
|
-
import './chunk-
|
|
3
|
+
import './chunk-HBGADXLP.js';
|
|
4
|
+
import './chunk-L5C63HEF.js';
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { definePerfConfig, perfDefaults } from './chunk-
|
|
1
|
+
export { definePerfConfig, perfDefaults } from './chunk-L5C63HEF.js';
|
package/dist/reporter.cjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var chunk4SFI55HF_cjs = require('./chunk-4SFI55HF.cjs');
|
|
6
6
|
var chunkGCA73FFP_cjs = require('./chunk-GCA73FFP.cjs');
|
|
7
7
|
var promises = require('fs/promises');
|
|
8
8
|
var path = require('path');
|
|
@@ -927,7 +927,7 @@ function envlessPath(path, env) {
|
|
|
927
927
|
return path.endsWith(suffix) ? `${path.slice(0, -suffix.length)}.json` : path;
|
|
928
928
|
}
|
|
929
929
|
function missingFileWarning(file, env) {
|
|
930
|
-
const derive = `Derive thresholds with \`${
|
|
930
|
+
const derive = `Derive thresholds with \`${chunk4SFI55HF_cjs.CLI_COMMAND} thresholds\`${env === null ? "" : ` (environment "${env}")`}.`;
|
|
931
931
|
const envless = env !== null && file.envlessFileExists ? ` ${envlessPath(file.path, env)} exists but is not used for environment "${env}": thresholds of another environment would give false alarms or hide regressions.` : "";
|
|
932
932
|
return {
|
|
933
933
|
code: "THRESHOLDS_FILE_MISSING",
|
|
@@ -981,7 +981,7 @@ function generatedWarnings(path, generated, cfg, env, source) {
|
|
|
981
981
|
issues.push({
|
|
982
982
|
code: "EVAL_PERCENTILE_MISMATCH",
|
|
983
983
|
message: `Thresholds in ${path} were derived for ${generated.evaluatedPercentile}, but this run evaluates ${level}; the percentile limits are compared with ${level}.`,
|
|
984
|
-
hint: `Derive thresholds again with \`${
|
|
984
|
+
hint: `Derive thresholds again with \`${chunk4SFI55HF_cjs.CLI_COMMAND} thresholds\` after changing checks.time.percentile.level.`
|
|
985
985
|
});
|
|
986
986
|
}
|
|
987
987
|
if (generated.env !== env) {
|
|
@@ -1002,7 +1002,7 @@ function generatedWarnings(path, generated, cfg, env, source) {
|
|
|
1002
1002
|
}
|
|
1003
1003
|
if (keys) {
|
|
1004
1004
|
hints.push(
|
|
1005
|
-
`Another normalization changes the keys: derive thresholds again with \`${
|
|
1005
|
+
`Another normalization changes the keys: derive thresholds again with \`${chunk4SFI55HF_cjs.CLI_COMMAND} thresholds\`.`
|
|
1006
1006
|
);
|
|
1007
1007
|
}
|
|
1008
1008
|
issues.push({
|
|
@@ -1017,14 +1017,14 @@ function unseenWarning(path, unseen) {
|
|
|
1017
1017
|
return {
|
|
1018
1018
|
code: "THRESHOLDS_UNSEEN_ENTRIES",
|
|
1019
1019
|
message: `${plural(unseen.length, "entry", "entries")} in ${path} ${unseen.length === 1 ? "was" : "were"} not seen in this run.`,
|
|
1020
|
-
hint: `Run the full suite, or remove stale entries with \`${
|
|
1020
|
+
hint: `Run the full suite, or remove stale entries with \`${chunk4SFI55HF_cjs.CLI_COMMAND} thresholds --prune\`.`
|
|
1021
1021
|
};
|
|
1022
1022
|
}
|
|
1023
1023
|
function outdatedWarning(path, from, current) {
|
|
1024
1024
|
return {
|
|
1025
1025
|
code: "THRESHOLDS_FILE_OUTDATED",
|
|
1026
1026
|
message: `Thresholds file ${path} has format version ${from}; it was read after migration to version ${current}.`,
|
|
1027
|
-
hint: `The next \`${
|
|
1027
|
+
hint: `The next \`${chunk4SFI55HF_cjs.CLI_COMMAND} thresholds\` writes it in the current version and keeps locked entries.`
|
|
1028
1028
|
};
|
|
1029
1029
|
}
|
|
1030
1030
|
function fileInfo(file, unseenKeys) {
|
|
@@ -1145,7 +1145,7 @@ var ABORT_FAILURE_TEXTS = Object.freeze([
|
|
|
1145
1145
|
"NS_BINDING_ABORTED",
|
|
1146
1146
|
"NS_ERROR_ABORT",
|
|
1147
1147
|
"cancelled",
|
|
1148
|
-
|
|
1148
|
+
chunk4SFI55HF_cjs.CONTEXT_CLOSED_FAILURE_TEXT
|
|
1149
1149
|
]);
|
|
1150
1150
|
var ABORT_TEXTS = new Set(ABORT_FAILURE_TEXTS);
|
|
1151
1151
|
function requestStatusLabel(sample) {
|
|
@@ -1915,7 +1915,7 @@ function evaluate(aggregates, thresholds, cfg, opts) {
|
|
|
1915
1915
|
warnings.push({
|
|
1916
1916
|
code: "THRESHOLDS_ENTRIES_NOT_EVALUATED",
|
|
1917
1917
|
message: `${plural(notEvaluated, "key")} with an entry in the thresholds file had too few samples and ${notEvaluated === 1 ? "was" : "were"} not evaluated.`,
|
|
1918
|
-
hint: `Run more repetitions (run.repeat or \`${
|
|
1918
|
+
hint: `Run more repetitions (run.repeat or \`${chunk4SFI55HF_cjs.CLI_COMMAND} test --repeat\`), or accept that the endpoint is called rarely.`
|
|
1919
1919
|
});
|
|
1920
1920
|
}
|
|
1921
1921
|
const mutedKeys = KINDS2.flatMap(
|
|
@@ -2502,7 +2502,7 @@ function entrySelfConsistent(entry, aggregate2, kind2, cfg) {
|
|
|
2502
2502
|
var MS_LIMITS = /* @__PURE__ */ new Set(["t", "median", "percentile", "p99"]);
|
|
2503
2503
|
var TIME_LIMITS = ["median", "percentile", "p99"];
|
|
2504
2504
|
function isComplete(entry) {
|
|
2505
|
-
return
|
|
2505
|
+
return chunk4SFI55HF_cjs.LIMIT_NAMES.every((name) => entry[name] !== void 0);
|
|
2506
2506
|
}
|
|
2507
2507
|
function limitsOf(entry) {
|
|
2508
2508
|
return {
|
|
@@ -2519,7 +2519,7 @@ function atMost(a, b) {
|
|
|
2519
2519
|
return Math.round(a * 1e6) <= Math.round(b * 1e6);
|
|
2520
2520
|
}
|
|
2521
2521
|
function withinHysteresis(before, after, hysteresis) {
|
|
2522
|
-
return
|
|
2522
|
+
return chunk4SFI55HF_cjs.LIMIT_NAMES.every((name) => {
|
|
2523
2523
|
const a = before[name];
|
|
2524
2524
|
const b = after[name];
|
|
2525
2525
|
if (a === null || b === null) return a === b;
|
|
@@ -2574,7 +2574,7 @@ function refusal(report, cfg, existing) {
|
|
|
2574
2574
|
{
|
|
2575
2575
|
code: "THRESHOLDS_SOURCE_INCOMPLETE",
|
|
2576
2576
|
message: `The source report is incomplete or untrustworthy (${incomplete.join("; ")}); no thresholds file was written.`,
|
|
2577
|
-
hint: `Fix the cause and derive again with \`${
|
|
2577
|
+
hint: `Fix the cause and derive again with \`${chunk4SFI55HF_cjs.CLI_COMMAND} thresholds\`: thresholds are derived from complete runs only.`
|
|
2578
2578
|
}
|
|
2579
2579
|
];
|
|
2580
2580
|
}
|
|
@@ -2595,7 +2595,7 @@ function refusal(report, cfg, existing) {
|
|
|
2595
2595
|
{
|
|
2596
2596
|
code: "THRESHOLDS_NOTHING_TO_DERIVE",
|
|
2597
2597
|
message: `No key has at least ${minDeriveSamples(cfg.checks)} successful samples (checks.time.median.minSamples); no thresholds file was written.`,
|
|
2598
|
-
hint: `Run more repetitions (run.repeat.thresholds or \`${
|
|
2598
|
+
hint: `Run more repetitions (run.repeat.thresholds or \`${chunk4SFI55HF_cjs.CLI_COMMAND} thresholds --repeat\`).`
|
|
2599
2599
|
}
|
|
2600
2600
|
];
|
|
2601
2601
|
}
|
|
@@ -2612,7 +2612,7 @@ function generatedBlock(report, cfg, kind2, opts) {
|
|
|
2612
2612
|
0
|
|
2613
2613
|
);
|
|
2614
2614
|
return {
|
|
2615
|
-
tool: { name:
|
|
2615
|
+
tool: { name: chunk4SFI55HF_cjs.PACKAGE_NAME, version: opts.toolVersion },
|
|
2616
2616
|
env: opts.env,
|
|
2617
2617
|
sourceRunId: report.runId,
|
|
2618
2618
|
sourceRunStartedAt: report.startedAt,
|
|
@@ -2651,7 +2651,7 @@ function deriveKind(report, cfg, file, opts) {
|
|
|
2651
2651
|
warnings.push({
|
|
2652
2652
|
code: "THRESHOLDS_KIND_SKIPPED",
|
|
2653
2653
|
message: `No ${KIND_NOUN2[kind2]} key has at least ${minDeriveSamples(cfg.checks)} successful samples; ${file.path} was not written.`,
|
|
2654
|
-
hint: `Run more repetitions (run.repeat.thresholds or \`${
|
|
2654
|
+
hint: `Run more repetitions (run.repeat.thresholds or \`${chunk4SFI55HF_cjs.CLI_COMMAND} thresholds --repeat\`).`
|
|
2655
2655
|
});
|
|
2656
2656
|
}
|
|
2657
2657
|
return { file: { kind: kind2, content: null, changed: false }, warnings, loosenedMuch: 0 };
|
|
@@ -2674,12 +2674,12 @@ function deriveKind(report, cfg, file, opts) {
|
|
|
2674
2674
|
const hints = [];
|
|
2675
2675
|
if (timing) {
|
|
2676
2676
|
hints.push(
|
|
2677
|
-
`Deriving on another machine, browser or Playwright version shifts all limits at once: derive on the CI infrastructure that evaluates the runs (\`${
|
|
2677
|
+
`Deriving on another machine, browser or Playwright version shifts all limits at once: derive on the CI infrastructure that evaluates the runs (\`${chunk4SFI55HF_cjs.CLI_COMMAND} thresholds --from\` with the report from CI).`
|
|
2678
2678
|
);
|
|
2679
2679
|
}
|
|
2680
2680
|
if (keysDiffer) {
|
|
2681
2681
|
hints.push(
|
|
2682
|
-
`Another normalization changes the keys: entries of old keys are kept as unseen until removed with \`${
|
|
2682
|
+
`Another normalization changes the keys: entries of old keys are kept as unseen until removed with \`${chunk4SFI55HF_cjs.CLI_COMMAND} thresholds --prune\`.`
|
|
2683
2683
|
);
|
|
2684
2684
|
}
|
|
2685
2685
|
warnings.push({
|
|
@@ -2765,7 +2765,7 @@ function deriveThresholds(report, cfg, existing, opts) {
|
|
|
2765
2765
|
warnings.push({
|
|
2766
2766
|
code: "THRESHOLDS_SOURCE_TEST_MODE",
|
|
2767
2767
|
message: "The source report comes from test mode, which runs fewer repetitions than a thresholds run.",
|
|
2768
|
-
hint: `Prefer a report of \`${
|
|
2768
|
+
hint: `Prefer a report of \`${chunk4SFI55HF_cjs.CLI_COMMAND} thresholds\` as the source.`
|
|
2769
2769
|
});
|
|
2770
2770
|
}
|
|
2771
2771
|
const files = [];
|
|
@@ -2794,7 +2794,7 @@ function limitChanges(before, after, loosenWarnRelative) {
|
|
|
2794
2794
|
const a = limitsOf(before);
|
|
2795
2795
|
const b = limitsOf(after);
|
|
2796
2796
|
const changes = [];
|
|
2797
|
-
for (const limit of
|
|
2797
|
+
for (const limit of chunk4SFI55HF_cjs.LIMIT_NAMES) {
|
|
2798
2798
|
const direction = changeDirection(limit, a[limit], b[limit]);
|
|
2799
2799
|
if (direction === null) continue;
|
|
2800
2800
|
const change = { limit, before: a[limit], after: b[limit], direction };
|
|
@@ -2823,7 +2823,7 @@ function keptKey(key2, before, after, stats2, kind2, cfg) {
|
|
|
2823
2823
|
}
|
|
2824
2824
|
const fresh = cfg.thresholds.update === "all" ? deriveEntry(stats2, kind2, cfg) : null;
|
|
2825
2825
|
const old = limitsOf(before);
|
|
2826
|
-
const kept = fresh !== null &&
|
|
2826
|
+
const kept = fresh !== null && chunk4SFI55HF_cjs.LIMIT_NAMES.some((name) => fresh[name] !== old[name]);
|
|
2827
2827
|
return { key: key2, category: "unchanged", changes: [], ...kept ? { withinHysteresis: true } : {} };
|
|
2828
2828
|
}
|
|
2829
2829
|
function diffThresholds(before, after, report, cfg) {
|
|
@@ -2856,7 +2856,7 @@ function diffThresholds(before, after, report, cfg) {
|
|
|
2856
2856
|
if (muting !== null) diff.muted = { until: muting.until, expired: muting.expired };
|
|
2857
2857
|
diffs.push(diff);
|
|
2858
2858
|
}
|
|
2859
|
-
const counts = Object.fromEntries(
|
|
2859
|
+
const counts = Object.fromEntries(chunk4SFI55HF_cjs.DIFF_CATEGORIES.map((c) => [c, 0]));
|
|
2860
2860
|
for (const diff of diffs) counts[diff.category] += 1;
|
|
2861
2861
|
return {
|
|
2862
2862
|
kind: kind2,
|
|
@@ -2882,15 +2882,15 @@ function formatThresholdsDiffMarkdown(diffs, paths) {
|
|
|
2882
2882
|
"",
|
|
2883
2883
|
`## ${cell(path)} (${diff.fileStatus === "not-written" ? "not written" : diff.fileStatus})`,
|
|
2884
2884
|
"",
|
|
2885
|
-
|
|
2885
|
+
chunk4SFI55HF_cjs.diffCountsText(diff)
|
|
2886
2886
|
);
|
|
2887
|
-
const listed = diff.keys.filter((k) =>
|
|
2887
|
+
const listed = diff.keys.filter((k) => chunk4SFI55HF_cjs.LISTED_CATEGORIES.has(k.category));
|
|
2888
2888
|
if (listed.length > 0) {
|
|
2889
2889
|
lines.push("", "| | Key | Before | After |", "|---|---|---|---|");
|
|
2890
2890
|
for (const k of listed) {
|
|
2891
|
-
const before =
|
|
2892
|
-
const after =
|
|
2893
|
-
lines.push(`| ${
|
|
2891
|
+
const before = chunk4SFI55HF_cjs.diffValuesText(k, "before", diff.level, " \xB7 ");
|
|
2892
|
+
const after = chunk4SFI55HF_cjs.diffValuesText(k, "after", diff.level, " \xB7 ");
|
|
2893
|
+
lines.push(`| ${chunk4SFI55HF_cjs.diffMarker(k)} | ${code(k.key)} | ${cell(before)} | ${cell(after)} |`);
|
|
2894
2894
|
}
|
|
2895
2895
|
}
|
|
2896
2896
|
const expired = diff.keys.filter((k) => k.muted?.expired === true);
|
|
@@ -2912,6 +2912,29 @@ function formatThresholdsDiffMarkdown(diffs, paths) {
|
|
|
2912
2912
|
`;
|
|
2913
2913
|
}
|
|
2914
2914
|
|
|
2915
|
+
// src/console/color.ts
|
|
2916
|
+
var ANSI = {
|
|
2917
|
+
green: "\x1B[32m",
|
|
2918
|
+
red: "\x1B[31m",
|
|
2919
|
+
yellow: "\x1B[33m",
|
|
2920
|
+
cyan: "\x1B[36m",
|
|
2921
|
+
dim: "\x1B[2m",
|
|
2922
|
+
bold: "\x1B[1m"
|
|
2923
|
+
};
|
|
2924
|
+
var RESET = "\x1B[0m";
|
|
2925
|
+
function colorEnabled(stream, env) {
|
|
2926
|
+
if ((env.NO_COLOR ?? "") !== "") return false;
|
|
2927
|
+
const force = env.FORCE_COLOR;
|
|
2928
|
+
if (force !== void 0) return force !== "0";
|
|
2929
|
+
return stream.isTTY === true && env.TERM !== "dumb";
|
|
2930
|
+
}
|
|
2931
|
+
function paint(text, style, enabled) {
|
|
2932
|
+
return enabled && text !== "" ? `${ANSI[style]}${text}${RESET}` : text;
|
|
2933
|
+
}
|
|
2934
|
+
function painter(enabled) {
|
|
2935
|
+
return (text, style) => paint(text, style, enabled);
|
|
2936
|
+
}
|
|
2937
|
+
|
|
2915
2938
|
// src/console/text.ts
|
|
2916
2939
|
function compareText5(a, b) {
|
|
2917
2940
|
return a < b ? -1 : a > b ? 1 : 0;
|
|
@@ -2956,8 +2979,6 @@ var TIME_RULES2 = /* @__PURE__ */ new Set([
|
|
|
2956
2979
|
"percentile",
|
|
2957
2980
|
"p99"
|
|
2958
2981
|
]);
|
|
2959
|
-
var ANSI = { red: "\x1B[31m", yellow: "\x1B[33m", green: "\x1B[32m", bold: "\x1B[1m" };
|
|
2960
|
-
var RESET = "\x1B[0m";
|
|
2961
2982
|
function exceedance(check2) {
|
|
2962
2983
|
if (check2.rule === "apdex") return check2.actual === 0 ? Infinity : check2.limit / check2.actual;
|
|
2963
2984
|
return check2.limit === 0 ? Infinity : check2.actual / check2.limit;
|
|
@@ -3072,7 +3093,7 @@ function formatActual(check2) {
|
|
|
3072
3093
|
function formatLimit(check2) {
|
|
3073
3094
|
return TIME_RULES2.has(check2.rule) ? formatTime(check2.limit) : check2.limit.toFixed(3);
|
|
3074
3095
|
}
|
|
3075
|
-
function tableLines(report, list2, width,
|
|
3096
|
+
function tableLines(report, list2, width, paint2) {
|
|
3076
3097
|
const level = report.config.checks?.time?.percentile?.level ?? "percentile";
|
|
3077
3098
|
const shown = list2.slice(0, MAX_VIOLATION_ROWS);
|
|
3078
3099
|
const rows = shown.map((v) => ({
|
|
@@ -3114,8 +3135,8 @@ function tableLines(report, list2, width, paint) {
|
|
|
3114
3135
|
const fixed = 4 + widths.kind + widths.rule + widths.actual + widths.limit + widths.over + widths.n + widths.src + widths.flag + 2 * 8;
|
|
3115
3136
|
const keyWidth = Math.max(MIN_KEY_WIDTH, Math.min(width - fixed, w("key")));
|
|
3116
3137
|
const line = (r, isHead) => {
|
|
3117
|
-
const marker = isHead || r.marker === " " ? r.marker :
|
|
3118
|
-
const flag = r.flag.includes("HARD") && !isHead ?
|
|
3138
|
+
const marker = isHead || r.marker === " " ? r.marker : paint2(r.marker, r.marker === "\u2716" ? "red" : "yellow");
|
|
3139
|
+
const flag = r.flag.includes("HARD") && !isHead ? paint2(r.flag, "red") : r.flag;
|
|
3119
3140
|
return [
|
|
3120
3141
|
` ${marker} ${padEnd(r.kind, widths.kind)}`,
|
|
3121
3142
|
padEnd(truncateMiddle(r.key, keyWidth), keyWidth),
|
|
@@ -3152,7 +3173,7 @@ function slowestLines(report, list2) {
|
|
|
3152
3173
|
}
|
|
3153
3174
|
return lines;
|
|
3154
3175
|
}
|
|
3155
|
-
function resultLine(report,
|
|
3176
|
+
function resultLine(report, paint2) {
|
|
3156
3177
|
const counts = report.evaluation.counts;
|
|
3157
3178
|
const sum = (field2) => counts.api[field2] + counts.custom[field2];
|
|
3158
3179
|
const gate = report.config.gate;
|
|
@@ -3179,7 +3200,7 @@ function resultLine(report, paint) {
|
|
|
3179
3200
|
reason = `no violations in ${plural2(sum("keys") - sum("notEvaluated"), "evaluated key")}`;
|
|
3180
3201
|
}
|
|
3181
3202
|
const informational = report.mode === "thresholds" ? " (informational, gate disabled)" : "";
|
|
3182
|
-
return `${
|
|
3203
|
+
return `${paint2(word, style)}: ${reason}${informational}`;
|
|
3183
3204
|
}
|
|
3184
3205
|
function toSlash(path) {
|
|
3185
3206
|
return path.replace(/\\/gu, "/");
|
|
@@ -3224,21 +3245,21 @@ function reportLine(report, cwd, html2) {
|
|
|
3224
3245
|
return [`Report: ${files.map((f) => relativePath(cwd, `${dir}/${f}`)).join(" \xB7 ")}`];
|
|
3225
3246
|
}
|
|
3226
3247
|
function formatSummary(report, opts) {
|
|
3227
|
-
const
|
|
3248
|
+
const paint2 = painter(opts.color);
|
|
3228
3249
|
const list2 = violations(report);
|
|
3229
3250
|
const lines = [header(report), ""];
|
|
3230
|
-
lines.push(...issueLines("Errors:", report.toolErrors, Infinity,
|
|
3251
|
+
lines.push(...issueLines("Errors:", report.toolErrors, Infinity, paint2("\u2716", "red"), "errors"));
|
|
3231
3252
|
lines.push(
|
|
3232
|
-
...issueLines("Warnings:", report.warnings, MAX_WARNINGS,
|
|
3253
|
+
...issueLines("Warnings:", report.warnings, MAX_WARNINGS, paint2("!", "yellow"), "warnings")
|
|
3233
3254
|
);
|
|
3234
3255
|
lines.push(...counterLines(report), ...mutedLines(report), "");
|
|
3235
3256
|
if (list2.length > 0) {
|
|
3236
|
-
lines.push(...tableLines(report, list2, opts.width,
|
|
3257
|
+
lines.push(...tableLines(report, list2, opts.width, paint2));
|
|
3237
3258
|
const slowest = slowestLines(report, list2);
|
|
3238
3259
|
if (slowest.length > 0) lines.push("", ...slowest);
|
|
3239
3260
|
lines.push("");
|
|
3240
3261
|
}
|
|
3241
|
-
lines.push(resultLine(report,
|
|
3262
|
+
lines.push(resultLine(report, paint2), ...reportLine(report, opts.cwd, opts.html));
|
|
3242
3263
|
return `${lines.join("\n")}
|
|
3243
3264
|
`;
|
|
3244
3265
|
}
|
|
@@ -3246,8 +3267,6 @@ function formatSummary(report, opts) {
|
|
|
3246
3267
|
// src/console/thresholds-diff.ts
|
|
3247
3268
|
var MAX_DIFF_ROWS = 30;
|
|
3248
3269
|
var MIN_KEY_WIDTH2 = 30;
|
|
3249
|
-
var ANSI2 = { red: "\x1B[31m", yellow: "\x1B[33m", green: "\x1B[32m" };
|
|
3250
|
-
var RESET2 = "\x1B[0m";
|
|
3251
3270
|
var MARKER_STYLE = {
|
|
3252
3271
|
"+": "green",
|
|
3253
3272
|
"-": "red",
|
|
@@ -3255,17 +3274,17 @@ var MARKER_STYLE = {
|
|
|
3255
3274
|
"\u2193": "green",
|
|
3256
3275
|
"\xB1": "yellow"
|
|
3257
3276
|
};
|
|
3258
|
-
function fileLines(diff, path, opts,
|
|
3277
|
+
function fileLines(diff, path, opts, paint2) {
|
|
3259
3278
|
const lines = [`Thresholds: ${path} (${fileStatusText(diff)})`];
|
|
3260
|
-
const listed = diff.keys.filter((k) =>
|
|
3279
|
+
const listed = diff.keys.filter((k) => chunk4SFI55HF_cjs.LISTED_CATEGORIES.has(k.category));
|
|
3261
3280
|
const expired = diff.keys.filter((k) => k.muted?.expired === true);
|
|
3262
|
-
if (diff.fileStatus !== "unchanged") lines.push(` ${
|
|
3281
|
+
if (diff.fileStatus !== "unchanged") lines.push(` ${chunk4SFI55HF_cjs.diffCountsText(diff)}`);
|
|
3263
3282
|
if (listed.length > 0) {
|
|
3264
3283
|
const shown = listed.slice(0, MAX_DIFF_ROWS);
|
|
3265
3284
|
const rows = shown.map((k) => ({
|
|
3266
|
-
marker:
|
|
3285
|
+
marker: chunk4SFI55HF_cjs.diffMarker(k),
|
|
3267
3286
|
key: k.key,
|
|
3268
|
-
change:
|
|
3287
|
+
change: chunk4SFI55HF_cjs.diffChangeText(k, diff.level, " ") + mutedSuffix(k)
|
|
3269
3288
|
}));
|
|
3270
3289
|
const markerWidth = Math.max(...rows.map((r) => textWidth(r.marker)));
|
|
3271
3290
|
const changeWidth = Math.max(...rows.map((r) => textWidth(r.change)));
|
|
@@ -3276,7 +3295,7 @@ function fileLines(diff, path, opts, paint) {
|
|
|
3276
3295
|
for (const r of rows) {
|
|
3277
3296
|
const head = r.marker.slice(0, 1);
|
|
3278
3297
|
const style = MARKER_STYLE[head] ?? "yellow";
|
|
3279
|
-
const marker =
|
|
3298
|
+
const marker = paint2(head, style) + (r.marker.length > 1 ? paint2(r.marker.slice(1), "red") : "");
|
|
3280
3299
|
const pad2 = " ".repeat(markerWidth - textWidth(r.marker));
|
|
3281
3300
|
lines.push(
|
|
3282
3301
|
` ${marker}${pad2} ${padEnd(truncateMiddle(r.key, keyWidth), keyWidth)} ${r.change}`.trimEnd()
|
|
@@ -3289,7 +3308,7 @@ function fileLines(diff, path, opts, paint) {
|
|
|
3289
3308
|
if (expired.length > 0) {
|
|
3290
3309
|
lines.push("");
|
|
3291
3310
|
for (const k of expired) {
|
|
3292
|
-
lines.push(` ${
|
|
3311
|
+
lines.push(` ${paint2("!", "yellow")} ${k.key} muted (expired ${k.muted?.until ?? ""})`);
|
|
3293
3312
|
}
|
|
3294
3313
|
}
|
|
3295
3314
|
const unseen = diff.counts.unseen;
|
|
@@ -3310,10 +3329,10 @@ function mutedSuffix(k) {
|
|
|
3310
3329
|
return k.muted !== void 0 && !k.muted.expired ? ` (muted until ${k.muted.until})` : "";
|
|
3311
3330
|
}
|
|
3312
3331
|
function formatThresholdsDiff(diffs, opts) {
|
|
3313
|
-
const
|
|
3332
|
+
const paint2 = painter(opts.color);
|
|
3314
3333
|
const lines = [];
|
|
3315
3334
|
diffs.forEach((diff, i) => {
|
|
3316
|
-
lines.push(...fileLines(diff, opts.paths[i] ?? `${diff.kind} thresholds`, opts,
|
|
3335
|
+
lines.push(...fileLines(diff, opts.paths[i] ?? `${diff.kind} thresholds`, opts, paint2));
|
|
3317
3336
|
});
|
|
3318
3337
|
const written = diffs.some((d) => d.fileStatus === "created" || d.fileStatus === "updated");
|
|
3319
3338
|
lines.push("");
|
|
@@ -3980,7 +3999,7 @@ function configuration(report) {
|
|
|
3980
3999
|
);
|
|
3981
4000
|
}
|
|
3982
4001
|
function footer(report) {
|
|
3983
|
-
return html`<footer>Generated by <a href="${
|
|
4002
|
+
return html`<footer>Generated by <a href="${chunk4SFI55HF_cjs.REPOSITORY_URL}" rel="noopener noreferrer">${report.tool.name}</a> v${report.tool.version}</footer>`;
|
|
3984
4003
|
}
|
|
3985
4004
|
function keySections(data, report) {
|
|
3986
4005
|
const level = percentileLevel(report);
|
|
@@ -3990,7 +4009,7 @@ function keySections(data, report) {
|
|
|
3990
4009
|
return join2(
|
|
3991
4010
|
html`<section aria-labelledby="endpoints-h"><h2 id="endpoints-h">Endpoints</h2>`,
|
|
3992
4011
|
html`<p>No requests or custom measurements were recorded. See the `,
|
|
3993
|
-
html`<a href="${`${
|
|
4012
|
+
html`<a href="${`${chunk4SFI55HF_cjs.REPOSITORY_URL}#readme`}" rel="noopener noreferrer">documentation</a>`,
|
|
3994
4013
|
html` for setting up the measured tests.</p></section>`
|
|
3995
4014
|
);
|
|
3996
4015
|
}
|
|
@@ -4007,7 +4026,7 @@ function renderHtmlReport(report) {
|
|
|
4007
4026
|
html`<meta http-equiv="Content-Security-Policy" content="${CONTENT_SECURITY_POLICY}">`,
|
|
4008
4027
|
html`<meta name="viewport" content="width=device-width, initial-scale=1">`,
|
|
4009
4028
|
html`<meta name="color-scheme" content="light dark">`,
|
|
4010
|
-
html`<meta name="generator" content="${`${
|
|
4029
|
+
html`<meta name="generator" content="${`${chunk4SFI55HF_cjs.PACKAGE_NAME} ${report.tool.version}`}">`,
|
|
4011
4030
|
html`<link rel="icon" href="data:,"><title>Performance report ${report.runId}</title>`,
|
|
4012
4031
|
html`<style>${trustedHtml(STYLES)}</style></head>`
|
|
4013
4032
|
);
|
|
@@ -4149,7 +4168,7 @@ function testMeta(test, result, file) {
|
|
|
4149
4168
|
};
|
|
4150
4169
|
}
|
|
4151
4170
|
function sampleAttachments(result) {
|
|
4152
|
-
return result.attachments.filter((a) => a.name ===
|
|
4171
|
+
return result.attachments.filter((a) => a.name === chunk4SFI55HF_cjs.SAMPLES_ATTACHMENT_NAME).map((a) => a.body === void 0 ? "" : a.body.toString("utf8"));
|
|
4153
4172
|
}
|
|
4154
4173
|
function hasTraceOrVideo(result) {
|
|
4155
4174
|
return result.attachments.some((a) => a.name === "trace" || a.name === "video");
|
|
@@ -4172,7 +4191,7 @@ function runSettings(registered, env, packageVersion) {
|
|
|
4172
4191
|
toolErrors: []
|
|
4173
4192
|
};
|
|
4174
4193
|
}
|
|
4175
|
-
const read2 =
|
|
4194
|
+
const read2 = chunk4SFI55HF_cjs.readModeState(env);
|
|
4176
4195
|
if (read2.ok && read2.value === null) return null;
|
|
4177
4196
|
const mode2 = read2.ok && read2.value !== null ? read2.value : { mode: "test" };
|
|
4178
4197
|
const resolved = chunkGCA73FFP_cjs.resolveConfig(void 0, {
|
|
@@ -4189,7 +4208,7 @@ function runSettings(registered, env, packageVersion) {
|
|
|
4189
4208
|
measuredProjects: null,
|
|
4190
4209
|
runConditions: { overridden: [], removedProjects: [], removedReporters: [] },
|
|
4191
4210
|
registered: false,
|
|
4192
|
-
warnings: [
|
|
4211
|
+
warnings: [chunk4SFI55HF_cjs.notWrappedWarning()],
|
|
4193
4212
|
toolErrors: read2.ok ? [] : read2.issues
|
|
4194
4213
|
};
|
|
4195
4214
|
}
|
|
@@ -4235,7 +4254,7 @@ var RunSession = class {
|
|
|
4235
4254
|
this.warnings = [...settings.warnings];
|
|
4236
4255
|
this.toolErrors = [...settings.toolErrors];
|
|
4237
4256
|
this.startedAt = host.now();
|
|
4238
|
-
this.runId = settings.mode.runId ??
|
|
4257
|
+
this.runId = settings.mode.runId ?? chunk4SFI55HF_cjs.generateRunId(this.startedAt, host.random);
|
|
4239
4258
|
this.configDir = host.cwd;
|
|
4240
4259
|
this.conditions = { workers: 1, projects: [], overriddenSettings: [] };
|
|
4241
4260
|
const keys = settings.config.keys;
|
|
@@ -4261,7 +4280,7 @@ var RunSession = class {
|
|
|
4261
4280
|
});
|
|
4262
4281
|
}
|
|
4263
4282
|
info(line) {
|
|
4264
|
-
this.host.stdout.write(`${
|
|
4283
|
+
this.host.stdout.write(`${chunk4SFI55HF_cjs.PACKAGE_NAME}: ${line}
|
|
4265
4284
|
`);
|
|
4266
4285
|
}
|
|
4267
4286
|
/** A hook threw: the error goes to the report and the outcome file (01-REQ-16). */
|
|
@@ -4273,7 +4292,7 @@ var RunSession = class {
|
|
|
4273
4292
|
this.playwrightVersion = config.version;
|
|
4274
4293
|
this.startedAt = this.host.now();
|
|
4275
4294
|
if (this.settings.mode.runId === void 0) {
|
|
4276
|
-
this.runId =
|
|
4295
|
+
this.runId = chunk4SFI55HF_cjs.generateRunId(this.startedAt, this.host.random);
|
|
4277
4296
|
}
|
|
4278
4297
|
const io = this.host.io;
|
|
4279
4298
|
this.configDir = config.configFile === void 0 ? config.rootDir : io.directoryOf(config.configFile);
|
|
@@ -4335,7 +4354,7 @@ var RunSession = class {
|
|
|
4335
4354
|
if (bodies.length > 1) {
|
|
4336
4355
|
this.warnings.push({
|
|
4337
4356
|
code: "ATTACHMENT_DUPLICATE",
|
|
4338
|
-
message: `Test "${meta.title}" has ${bodies.length} ${
|
|
4357
|
+
message: `Test "${meta.title}" has ${bodies.length} ${chunk4SFI55HF_cjs.SAMPLES_ATTACHMENT_NAME} attachments; all of them were processed.`,
|
|
4339
4358
|
hint: "Apply withPerfFixtures() once per test object."
|
|
4340
4359
|
});
|
|
4341
4360
|
}
|
|
@@ -4370,7 +4389,7 @@ var RunSession = class {
|
|
|
4370
4389
|
if (this.notInstrumented > 0) {
|
|
4371
4390
|
issues.push({
|
|
4372
4391
|
code: "TESTS_NOT_INSTRUMENTED",
|
|
4373
|
-
message: `${plural5(this.notInstrumented, "test result")} of measured projects ${this.notInstrumented === 1 ? "has" : "have"} no ${
|
|
4392
|
+
message: `${plural5(this.notInstrumented, "test result")} of measured projects ${this.notInstrumented === 1 ? "has" : "have"} no ${chunk4SFI55HF_cjs.SAMPLES_ATTACHMENT_NAME} attachment, so ${this.notInstrumented === 1 ? "it was" : "they were"} not measured.`,
|
|
4374
4393
|
hint: 'Import test from a test object wrapped with withPerfFixtures() (or from "playwright-performance-regression/test"); a crashed worker also loses the attachment.'
|
|
4375
4394
|
});
|
|
4376
4395
|
}
|
|
@@ -4419,7 +4438,7 @@ var RunSession = class {
|
|
|
4419
4438
|
reportInput(status, finishedAt, aggregates, evaluation, warnings, toolErrors) {
|
|
4420
4439
|
return {
|
|
4421
4440
|
meta: {
|
|
4422
|
-
tool: { name:
|
|
4441
|
+
tool: { name: chunk4SFI55HF_cjs.PACKAGE_NAME, version: this.settings.packageVersion },
|
|
4423
4442
|
runId: this.runId,
|
|
4424
4443
|
mode: this.mode,
|
|
4425
4444
|
startedAt: this.startedAt.toISOString(),
|
|
@@ -4442,10 +4461,9 @@ var RunSession = class {
|
|
|
4442
4461
|
}
|
|
4443
4462
|
terminal() {
|
|
4444
4463
|
const out = this.host.stdout;
|
|
4445
|
-
const noColor = (this.host.env.NO_COLOR ?? "") !== "";
|
|
4446
4464
|
return {
|
|
4447
4465
|
width: out.isTTY === true && out.columns !== void 0 && out.columns > 0 ? out.columns : DEFAULT_WIDTH,
|
|
4448
|
-
color: out.
|
|
4466
|
+
color: colorEnabled(out, this.host.env)
|
|
4449
4467
|
};
|
|
4450
4468
|
}
|
|
4451
4469
|
/**
|
|
@@ -4461,7 +4479,7 @@ var RunSession = class {
|
|
|
4461
4479
|
this.recordInternalError("onEnd", error);
|
|
4462
4480
|
outcome = this.fallbackOutcome(result);
|
|
4463
4481
|
for (const issue2 of outcome.toolErrors) {
|
|
4464
|
-
this.host.stderr.write(`${
|
|
4482
|
+
this.host.stderr.write(`${chunk4SFI55HF_cjs.PACKAGE_NAME}: ${issue2.code}: ${issue2.message}
|
|
4465
4483
|
`);
|
|
4466
4484
|
}
|
|
4467
4485
|
}
|
|
@@ -4594,7 +4612,7 @@ var RunSession = class {
|
|
|
4594
4612
|
return {
|
|
4595
4613
|
code: "HTML_WRITE_FAILED",
|
|
4596
4614
|
message: `The HTML report could not be written to ${path}: ${error instanceof Error ? error.message : String(error)}`,
|
|
4597
|
-
hint: `Check that report.dir is writable; \`${
|
|
4615
|
+
hint: `Check that report.dir is writable; \`${chunk4SFI55HF_cjs.CLI_COMMAND} report\` renders it again from report.json.`
|
|
4598
4616
|
};
|
|
4599
4617
|
}
|
|
4600
4618
|
}
|
|
@@ -4677,7 +4695,7 @@ var RunSession = class {
|
|
|
4677
4695
|
await this.host.io.writeJsonStable(file, outcome);
|
|
4678
4696
|
} catch (error) {
|
|
4679
4697
|
this.host.stderr.write(
|
|
4680
|
-
`${
|
|
4698
|
+
`${chunk4SFI55HF_cjs.PACKAGE_NAME}: OUTCOME_WRITE_FAILED: the outcome file could not be written to ${file}: ${error instanceof Error ? error.message : String(error)}
|
|
4681
4699
|
`
|
|
4682
4700
|
);
|
|
4683
4701
|
}
|
|
@@ -4718,7 +4736,7 @@ var PerfReporter = class {
|
|
|
4718
4736
|
let startError;
|
|
4719
4737
|
try {
|
|
4720
4738
|
const host = processHost();
|
|
4721
|
-
const settings = runSettings(
|
|
4739
|
+
const settings = runSettings(chunk4SFI55HF_cjs.getRegistered(), host.env, chunk4SFI55HF_cjs.version);
|
|
4722
4740
|
session = settings === null ? null : new RunSession(host, settings);
|
|
4723
4741
|
} catch (error) {
|
|
4724
4742
|
startError = error;
|