playwright-performance-regression 1.0.0 → 1.1.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 +112 -0
- package/README.md +11 -4
- package/dist/chunk-JS7SBYOF.js +11226 -0
- package/dist/{chunk-4WX3Z5MJ.js → chunk-PTQWKPHU.js} +276 -11
- package/dist/{chunk-5Y34Q4DR.js → chunk-Q73KMM6D.js} +95 -30
- package/dist/{chunk-PWK5XSP2.cjs → chunk-VBNIFMNE.cjs} +298 -32
- package/dist/{chunk-VREOANPX.cjs → chunk-VXGTC6DB.cjs} +78 -6
- package/dist/{chunk-W7NEFS5V.cjs → chunk-VYODYUEL.cjs} +95 -29
- package/dist/{chunk-YKBX6SAT.js → chunk-ZEQ2IGDC.js} +160 -11
- package/dist/cli.js +380 -15
- package/dist/config.cjs +16 -16
- package/dist/config.js +3 -4
- package/dist/fixture.cjs +6 -6
- package/dist/fixture.js +3 -4
- package/dist/index.cjs +3 -3
- package/dist/index.d.cts +85 -1
- package/dist/index.d.ts +85 -1
- package/dist/index.js +1 -1
- package/dist/reporter.cjs +1864 -622
- package/dist/reporter.js +7 -8137
- package/dist/test.cjs +4 -4
- package/dist/test.js +3 -4
- package/package.json +3 -3
- package/schemas/config.schema.json +91 -0
- package/schemas/run-report.schema.json +162 -7
- package/schemas/samples.schema.json +12 -3
- package/schemas/thresholds.schema.json +29 -1
- package/dist/chunk-B4XTLSRN.js +0 -1788
- package/dist/chunk-S6UH6QPK.js +0 -68
package/dist/index.d.cts
CHANGED
|
@@ -89,6 +89,10 @@ interface PackageConfig {
|
|
|
89
89
|
* @minItems 1
|
|
90
90
|
*/
|
|
91
91
|
successStatuses?: [string, ...string[]];
|
|
92
|
+
/**
|
|
93
|
+
* The first N timed samples of every key in each pass are cold (first call after the start of the application, which webServer starts again in every pass): they stay out of the evaluated time statistics when at least checks.time.median.minSamples warm samples are left (08-REQ-41, 08-REQ-42). 0 turns it off.
|
|
94
|
+
*/
|
|
95
|
+
coldSamples?: number;
|
|
92
96
|
/**
|
|
93
97
|
* Durations of test.step steps as keys of kind 'step' (06). true (default) enables with defaults, false disables, an object enables with settings (03-REQ-18).
|
|
94
98
|
*/
|
|
@@ -204,6 +208,22 @@ interface PackageConfig {
|
|
|
204
208
|
* Query parameter names always removed from the key (e.g. cache busters with fixed names).
|
|
205
209
|
*/
|
|
206
210
|
dropQueryParams?: string[];
|
|
211
|
+
/**
|
|
212
|
+
* Endpoints that get a key per operation (18): GraphQL ('graphql': operationName or the first named operation, batches by the sorted names) and tRPC ('trpc': procedure names from the path), e.g. [{"type": "graphql", "match": "/graphql"}] gives 'POST /graphql#GetTickets'. match is tested against the URL path without the query; the first matching entry wins. The request body is read only for POST requests matching a graphql entry, up to 64 KB, in the worker, and never written anywhere.
|
|
213
|
+
*/
|
|
214
|
+
operations?: {
|
|
215
|
+
/**
|
|
216
|
+
* Built-in operation extractor.
|
|
217
|
+
*/
|
|
218
|
+
type: 'graphql' | 'trpc';
|
|
219
|
+
/**
|
|
220
|
+
* A string matches as a case-sensitive substring of the full URL; {regex, flags} is a JavaScript regular expression.
|
|
221
|
+
*/
|
|
222
|
+
match: string | {
|
|
223
|
+
regex: string;
|
|
224
|
+
flags?: string;
|
|
225
|
+
};
|
|
226
|
+
}[];
|
|
207
227
|
/**
|
|
208
228
|
* Snapshot only: "[function]" when a custom keyBuilder function was configured (TypeScript/JavaScript config).
|
|
209
229
|
*/
|
|
@@ -526,6 +546,45 @@ interface PackageConfig {
|
|
|
526
546
|
min?: number;
|
|
527
547
|
};
|
|
528
548
|
};
|
|
549
|
+
/**
|
|
550
|
+
* Share of responses outside measure.successStatuses (e.g. fast 401s) must not exceed the limit; lower Wilson bound compared (09-REQ-38). Endpoint keys only.
|
|
551
|
+
*/
|
|
552
|
+
nonSuccess?: {
|
|
553
|
+
/**
|
|
554
|
+
* Run this rule.
|
|
555
|
+
*/
|
|
556
|
+
enabled?: boolean;
|
|
557
|
+
/**
|
|
558
|
+
* Minimum samples for the rule to run (09-REQ-07).
|
|
559
|
+
*/
|
|
560
|
+
minSamples?: number;
|
|
561
|
+
/**
|
|
562
|
+
* Limit for keys without an entry in the thresholds file. null (default): the rule runs only for keys whose entry has maxNonSuccessRate.
|
|
563
|
+
*/
|
|
564
|
+
limit?: {
|
|
565
|
+
/**
|
|
566
|
+
* Endpoint keys: maximum share of responses outside measure.successStatuses, or null.
|
|
567
|
+
*/
|
|
568
|
+
api?: number | null;
|
|
569
|
+
};
|
|
570
|
+
/**
|
|
571
|
+
* Headroom added to the source run value when deriving this limit (10, chapter 5).
|
|
572
|
+
*/
|
|
573
|
+
margin?: {
|
|
574
|
+
/**
|
|
575
|
+
* Multiplier of the source non-success rate.
|
|
576
|
+
*/
|
|
577
|
+
factor?: number;
|
|
578
|
+
/**
|
|
579
|
+
* Added after multiplying.
|
|
580
|
+
*/
|
|
581
|
+
add?: number;
|
|
582
|
+
/**
|
|
583
|
+
* Minimum derived limit.
|
|
584
|
+
*/
|
|
585
|
+
min?: number;
|
|
586
|
+
};
|
|
587
|
+
};
|
|
529
588
|
};
|
|
530
589
|
/**
|
|
531
590
|
* Gate policy: when violations fail the run (09, D-16, D-17).
|
|
@@ -589,6 +648,15 @@ interface PackageConfig {
|
|
|
589
648
|
* Warn (THRESHOLDS_LOOSENED_MUCH) when a derived time limit grows by more than this share (10-REQ-20).
|
|
590
649
|
*/
|
|
591
650
|
loosenWarnRelative?: number;
|
|
651
|
+
/**
|
|
652
|
+
* Warning THRESHOLDS_WORKLOAD_SHIFT when a key gets a different number of samples per pass than in the thresholds run (09-REQ-41).
|
|
653
|
+
*/
|
|
654
|
+
workloadShift?: {
|
|
655
|
+
/**
|
|
656
|
+
* Warn when samples per pass change by this factor or more in either direction; null turns the warning off.
|
|
657
|
+
*/
|
|
658
|
+
factor?: number | null;
|
|
659
|
+
};
|
|
592
660
|
};
|
|
593
661
|
/**
|
|
594
662
|
* Run outputs (02, 11).
|
|
@@ -669,6 +737,15 @@ interface KeyBuilderInput {
|
|
|
669
737
|
/** Raw URL. */
|
|
670
738
|
url: string;
|
|
671
739
|
resourceType: string;
|
|
740
|
+
/** Operation names read by keys.operations, in request order, or null. Never the request body (18-REQ-10). */
|
|
741
|
+
operation: readonly string[] | null;
|
|
742
|
+
}
|
|
743
|
+
/** Built-in operation extractors of keys.operations (18-REQ-02). */
|
|
744
|
+
type OperationType = 'graphql' | 'trpc';
|
|
745
|
+
/** An entry of keys.operations (18-REQ-01): match is tested against the URL path without the query. */
|
|
746
|
+
interface OperationEntryInput {
|
|
747
|
+
type: OperationType;
|
|
748
|
+
match: UrlPattern;
|
|
672
749
|
}
|
|
673
750
|
/** Return a key, or undefined to fall back to the built-in normalization (07). */
|
|
674
751
|
type KeyBuilder = (req: KeyBuilderInput) => string | undefined;
|
|
@@ -682,6 +759,7 @@ type PerfConfigInput = DeepPartial<Override<PerfConfigJson, {
|
|
|
682
759
|
keys: {
|
|
683
760
|
extraIdPatterns: UrlPattern[];
|
|
684
761
|
keyBuilder: KeyBuilder;
|
|
762
|
+
operations: OperationEntryInput[];
|
|
685
763
|
};
|
|
686
764
|
}>>;
|
|
687
765
|
interface StepPatternsInput {
|
|
@@ -714,11 +792,17 @@ type ResolvedConfig = Omit<ResolvedConfigJson, 'measure' | 'keys'> & {
|
|
|
714
792
|
exclude: ResolvedUrlPattern[];
|
|
715
793
|
steps: ResolvedStepsSettings;
|
|
716
794
|
};
|
|
717
|
-
keys: Omit<ResolvedConfigJson['keys'], 'extraIdPatterns' | 'keyBuilder'> & {
|
|
795
|
+
keys: Omit<ResolvedConfigJson['keys'], 'extraIdPatterns' | 'keyBuilder' | 'operations'> & {
|
|
718
796
|
extraIdPatterns: ResolvedUrlPattern[];
|
|
719
797
|
keyBuilder: KeyBuilder | undefined;
|
|
798
|
+
operations: ResolvedOperationEntry[];
|
|
720
799
|
};
|
|
721
800
|
};
|
|
801
|
+
/** keys.operations entry after resolution: the pattern compiled (18-REQ-01). */
|
|
802
|
+
interface ResolvedOperationEntry {
|
|
803
|
+
type: OperationType;
|
|
804
|
+
match: ResolvedUrlPattern;
|
|
805
|
+
}
|
|
722
806
|
/** measure.steps after resolution: full object, patterns compiled (03-REQ-18). */
|
|
723
807
|
type ResolvedStepsSettings = Omit<StepsSettingsJson, 'include' | 'exclude'> & {
|
|
724
808
|
include: ResolvedUrlPattern[];
|
package/dist/index.d.ts
CHANGED
|
@@ -89,6 +89,10 @@ interface PackageConfig {
|
|
|
89
89
|
* @minItems 1
|
|
90
90
|
*/
|
|
91
91
|
successStatuses?: [string, ...string[]];
|
|
92
|
+
/**
|
|
93
|
+
* The first N timed samples of every key in each pass are cold (first call after the start of the application, which webServer starts again in every pass): they stay out of the evaluated time statistics when at least checks.time.median.minSamples warm samples are left (08-REQ-41, 08-REQ-42). 0 turns it off.
|
|
94
|
+
*/
|
|
95
|
+
coldSamples?: number;
|
|
92
96
|
/**
|
|
93
97
|
* Durations of test.step steps as keys of kind 'step' (06). true (default) enables with defaults, false disables, an object enables with settings (03-REQ-18).
|
|
94
98
|
*/
|
|
@@ -204,6 +208,22 @@ interface PackageConfig {
|
|
|
204
208
|
* Query parameter names always removed from the key (e.g. cache busters with fixed names).
|
|
205
209
|
*/
|
|
206
210
|
dropQueryParams?: string[];
|
|
211
|
+
/**
|
|
212
|
+
* Endpoints that get a key per operation (18): GraphQL ('graphql': operationName or the first named operation, batches by the sorted names) and tRPC ('trpc': procedure names from the path), e.g. [{"type": "graphql", "match": "/graphql"}] gives 'POST /graphql#GetTickets'. match is tested against the URL path without the query; the first matching entry wins. The request body is read only for POST requests matching a graphql entry, up to 64 KB, in the worker, and never written anywhere.
|
|
213
|
+
*/
|
|
214
|
+
operations?: {
|
|
215
|
+
/**
|
|
216
|
+
* Built-in operation extractor.
|
|
217
|
+
*/
|
|
218
|
+
type: 'graphql' | 'trpc';
|
|
219
|
+
/**
|
|
220
|
+
* A string matches as a case-sensitive substring of the full URL; {regex, flags} is a JavaScript regular expression.
|
|
221
|
+
*/
|
|
222
|
+
match: string | {
|
|
223
|
+
regex: string;
|
|
224
|
+
flags?: string;
|
|
225
|
+
};
|
|
226
|
+
}[];
|
|
207
227
|
/**
|
|
208
228
|
* Snapshot only: "[function]" when a custom keyBuilder function was configured (TypeScript/JavaScript config).
|
|
209
229
|
*/
|
|
@@ -526,6 +546,45 @@ interface PackageConfig {
|
|
|
526
546
|
min?: number;
|
|
527
547
|
};
|
|
528
548
|
};
|
|
549
|
+
/**
|
|
550
|
+
* Share of responses outside measure.successStatuses (e.g. fast 401s) must not exceed the limit; lower Wilson bound compared (09-REQ-38). Endpoint keys only.
|
|
551
|
+
*/
|
|
552
|
+
nonSuccess?: {
|
|
553
|
+
/**
|
|
554
|
+
* Run this rule.
|
|
555
|
+
*/
|
|
556
|
+
enabled?: boolean;
|
|
557
|
+
/**
|
|
558
|
+
* Minimum samples for the rule to run (09-REQ-07).
|
|
559
|
+
*/
|
|
560
|
+
minSamples?: number;
|
|
561
|
+
/**
|
|
562
|
+
* Limit for keys without an entry in the thresholds file. null (default): the rule runs only for keys whose entry has maxNonSuccessRate.
|
|
563
|
+
*/
|
|
564
|
+
limit?: {
|
|
565
|
+
/**
|
|
566
|
+
* Endpoint keys: maximum share of responses outside measure.successStatuses, or null.
|
|
567
|
+
*/
|
|
568
|
+
api?: number | null;
|
|
569
|
+
};
|
|
570
|
+
/**
|
|
571
|
+
* Headroom added to the source run value when deriving this limit (10, chapter 5).
|
|
572
|
+
*/
|
|
573
|
+
margin?: {
|
|
574
|
+
/**
|
|
575
|
+
* Multiplier of the source non-success rate.
|
|
576
|
+
*/
|
|
577
|
+
factor?: number;
|
|
578
|
+
/**
|
|
579
|
+
* Added after multiplying.
|
|
580
|
+
*/
|
|
581
|
+
add?: number;
|
|
582
|
+
/**
|
|
583
|
+
* Minimum derived limit.
|
|
584
|
+
*/
|
|
585
|
+
min?: number;
|
|
586
|
+
};
|
|
587
|
+
};
|
|
529
588
|
};
|
|
530
589
|
/**
|
|
531
590
|
* Gate policy: when violations fail the run (09, D-16, D-17).
|
|
@@ -589,6 +648,15 @@ interface PackageConfig {
|
|
|
589
648
|
* Warn (THRESHOLDS_LOOSENED_MUCH) when a derived time limit grows by more than this share (10-REQ-20).
|
|
590
649
|
*/
|
|
591
650
|
loosenWarnRelative?: number;
|
|
651
|
+
/**
|
|
652
|
+
* Warning THRESHOLDS_WORKLOAD_SHIFT when a key gets a different number of samples per pass than in the thresholds run (09-REQ-41).
|
|
653
|
+
*/
|
|
654
|
+
workloadShift?: {
|
|
655
|
+
/**
|
|
656
|
+
* Warn when samples per pass change by this factor or more in either direction; null turns the warning off.
|
|
657
|
+
*/
|
|
658
|
+
factor?: number | null;
|
|
659
|
+
};
|
|
592
660
|
};
|
|
593
661
|
/**
|
|
594
662
|
* Run outputs (02, 11).
|
|
@@ -669,6 +737,15 @@ interface KeyBuilderInput {
|
|
|
669
737
|
/** Raw URL. */
|
|
670
738
|
url: string;
|
|
671
739
|
resourceType: string;
|
|
740
|
+
/** Operation names read by keys.operations, in request order, or null. Never the request body (18-REQ-10). */
|
|
741
|
+
operation: readonly string[] | null;
|
|
742
|
+
}
|
|
743
|
+
/** Built-in operation extractors of keys.operations (18-REQ-02). */
|
|
744
|
+
type OperationType = 'graphql' | 'trpc';
|
|
745
|
+
/** An entry of keys.operations (18-REQ-01): match is tested against the URL path without the query. */
|
|
746
|
+
interface OperationEntryInput {
|
|
747
|
+
type: OperationType;
|
|
748
|
+
match: UrlPattern;
|
|
672
749
|
}
|
|
673
750
|
/** Return a key, or undefined to fall back to the built-in normalization (07). */
|
|
674
751
|
type KeyBuilder = (req: KeyBuilderInput) => string | undefined;
|
|
@@ -682,6 +759,7 @@ type PerfConfigInput = DeepPartial<Override<PerfConfigJson, {
|
|
|
682
759
|
keys: {
|
|
683
760
|
extraIdPatterns: UrlPattern[];
|
|
684
761
|
keyBuilder: KeyBuilder;
|
|
762
|
+
operations: OperationEntryInput[];
|
|
685
763
|
};
|
|
686
764
|
}>>;
|
|
687
765
|
interface StepPatternsInput {
|
|
@@ -714,11 +792,17 @@ type ResolvedConfig = Omit<ResolvedConfigJson, 'measure' | 'keys'> & {
|
|
|
714
792
|
exclude: ResolvedUrlPattern[];
|
|
715
793
|
steps: ResolvedStepsSettings;
|
|
716
794
|
};
|
|
717
|
-
keys: Omit<ResolvedConfigJson['keys'], 'extraIdPatterns' | 'keyBuilder'> & {
|
|
795
|
+
keys: Omit<ResolvedConfigJson['keys'], 'extraIdPatterns' | 'keyBuilder' | 'operations'> & {
|
|
718
796
|
extraIdPatterns: ResolvedUrlPattern[];
|
|
719
797
|
keyBuilder: KeyBuilder | undefined;
|
|
798
|
+
operations: ResolvedOperationEntry[];
|
|
720
799
|
};
|
|
721
800
|
};
|
|
801
|
+
/** keys.operations entry after resolution: the pattern compiled (18-REQ-01). */
|
|
802
|
+
interface ResolvedOperationEntry {
|
|
803
|
+
type: OperationType;
|
|
804
|
+
match: ResolvedUrlPattern;
|
|
805
|
+
}
|
|
722
806
|
/** measure.steps after resolution: full object, patterns compiled (03-REQ-18). */
|
|
723
807
|
type ResolvedStepsSettings = Omit<StepsSettingsJson, 'include' | 'exclude'> & {
|
|
724
808
|
include: ResolvedUrlPattern[];
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { definePerfConfig, perfDefaults } from './chunk-
|
|
1
|
+
export { definePerfConfig, perfDefaults } from './chunk-Q73KMM6D.js';
|