playwright-performance-regression 0.1.0-next.4 → 1.0.0
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 +138 -0
- package/README.md +16 -17
- package/dist/{chunk-E2IX265O.js → chunk-4WX3Z5MJ.js} +2 -2
- package/dist/{chunk-CISGJCFW.js → chunk-5Y34Q4DR.js} +3 -3
- package/dist/{chunk-CXE5IWZY.js → chunk-B4XTLSRN.js} +169 -29
- package/dist/{chunk-KELMALEG.cjs → chunk-PWK5XSP2.cjs} +25 -25
- package/dist/{chunk-IUI4AFE5.cjs → chunk-VREOANPX.cjs} +1 -1
- package/dist/{chunk-LUA4WRIQ.cjs → chunk-W7NEFS5V.cjs} +3 -3
- package/dist/{chunk-RL27E3AB.js → chunk-YKBX6SAT.js} +1 -1
- package/dist/cli.js +398 -786
- package/dist/config.cjs +16 -16
- package/dist/config.js +3 -3
- package/dist/fixture.cjs +6 -6
- package/dist/fixture.js +3 -3
- package/dist/index.cjs +3 -3
- package/dist/index.d.cts +6 -2
- package/dist/index.d.ts +6 -2
- package/dist/index.js +1 -1
- package/dist/reporter.cjs +1356 -644
- package/dist/reporter.js +829 -253
- package/dist/test.cjs +4 -4
- package/dist/test.js +3 -3
- package/package.json +1 -3
- package/schemas/config.schema.json +8 -3
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkVREOANPX_cjs = require('./chunk-VREOANPX.cjs');
|
|
4
|
+
var chunkW7NEFS5V_cjs = require('./chunk-W7NEFS5V.cjs');
|
|
5
5
|
var fs = require('fs');
|
|
6
6
|
var os = require('os');
|
|
7
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(), chunkVREOANPX_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 = chunkVREOANPX_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
|
+
chunkVREOANPX_cjs.ABORT_FAILURE_TEXTS.filter((text) => text !== chunkVREOANPX_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, chunkVREOANPX_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 chunkVREOANPX_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(chunkVREOANPX_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: ${chunkVREOANPX_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 = chunkVREOANPX_cjs.readModeState(process.env);
|
|
847
|
+
if (!mode.ok) throw new chunkVREOANPX_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 = chunkVREOANPX_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
|
-
measure: (state?.config ??
|
|
859
|
-
version:
|
|
858
|
+
measure: (state?.config ?? chunkW7NEFS5V_cjs.perfDefaults).measure,
|
|
859
|
+
version: chunkVREOANPX_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 chunkVREOANPX_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 = chunkVREOANPX_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 ?? chunkVREOANPX_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) chunkVREOANPX_cjs.setActiveCollector(collector);
|
|
890
890
|
await use(buffer);
|
|
891
891
|
if (collector === null) return;
|
|
892
|
-
if (
|
|
892
|
+
if (chunkVREOANPX_cjs.activeCollector() === collector) chunkVREOANPX_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 = chunkVREOANPX_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 = chunkVREOANPX_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
|
+
chunkVREOANPX_cjs.activeCollector()?.track(context);
|
|
934
934
|
}
|
|
935
935
|
function trackRequestContext(requestContext) {
|
|
936
936
|
if (!perfModeOn()) return;
|
|
937
|
-
const state =
|
|
937
|
+
const state = chunkVREOANPX_cjs.getRegistered();
|
|
938
938
|
if (state !== void 0 && !state.config.measure.api) return;
|
|
939
939
|
if (!isApiRequestContext(requestContext)) {
|
|
940
|
-
|
|
940
|
+
chunkVREOANPX_cjs.activeCollector()?.requestContextNotTracked();
|
|
941
941
|
return;
|
|
942
942
|
}
|
|
943
|
-
wrapRequestContext(requestContext, "tracked", void 0,
|
|
943
|
+
wrapRequestContext(requestContext, "tracked", void 0, chunkVREOANPX_cjs.activeCollector);
|
|
944
944
|
}
|
|
945
945
|
|
|
946
946
|
exports.trackContext = trackContext;
|
|
@@ -303,7 +303,7 @@ var DEFAULT_CONFIG = {
|
|
|
303
303
|
".eot"
|
|
304
304
|
],
|
|
305
305
|
include: [],
|
|
306
|
-
exclude: ["/socket.io/"],
|
|
306
|
+
exclude: ["/socket.io/", "/sockjs/", "/sockjs-node/", "/signalr/", "/_blazor/"],
|
|
307
307
|
excludeKnownThirdParty: true,
|
|
308
308
|
successStatuses: ["2xx", "3xx"],
|
|
309
309
|
steps: true,
|
|
@@ -383,7 +383,7 @@ var DEFAULT_CONFIG = {
|
|
|
383
383
|
hysteresis: { relative: 0.1, ratio: 0.01 },
|
|
384
384
|
loosenWarnRelative: 0.5
|
|
385
385
|
},
|
|
386
|
-
report: { dir: "reports/pw-perf", html: true, rawUrls: false },
|
|
386
|
+
report: { dir: "reports/pw-perf", html: true, junit: true, rawUrls: false },
|
|
387
387
|
advanced: { maxSamplesPerKey: 5e3, seed: 1 }
|
|
388
388
|
};
|
|
389
389
|
|
|
@@ -750,7 +750,7 @@ var packageConfig = obj({
|
|
|
750
750
|
hysteresis: obj({ relative: unit, ratio: num({ minimum: 0, maximum: 0.01 }) }),
|
|
751
751
|
loosenWarnRelative: num({ minimum: 0, maximum: 100 })
|
|
752
752
|
}),
|
|
753
|
-
report: obj({ dir: str({ minLength: 1 }), html: bool, rawUrls: bool }),
|
|
753
|
+
report: obj({ dir: str({ minLength: 1 }), html: bool, junit: bool, rawUrls: bool }),
|
|
754
754
|
advanced: obj({
|
|
755
755
|
maxSamplesPerKey: int({ minimum: 100, maximum: 1e5 }),
|
|
756
756
|
seed: int({ minimum: 0, maximum: 4294967295 })
|