modestbench 0.2.0 → 0.3.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 +27 -0
- package/README.md +131 -34
- package/dist/cli/commands/analyze.cjs +60 -0
- package/dist/cli/commands/analyze.cjs.map +1 -0
- package/dist/cli/commands/analyze.d.cts +35 -0
- package/dist/cli/commands/analyze.d.cts.map +1 -0
- package/dist/cli/commands/analyze.d.ts +35 -0
- package/dist/cli/commands/analyze.d.ts.map +1 -0
- package/dist/cli/commands/analyze.js +56 -0
- package/dist/cli/commands/analyze.js.map +1 -0
- package/dist/cli/commands/baseline.cjs +404 -0
- package/dist/cli/commands/baseline.cjs.map +1 -0
- package/dist/cli/commands/baseline.d.cts +72 -0
- package/dist/cli/commands/baseline.d.cts.map +1 -0
- package/dist/cli/commands/baseline.d.ts +72 -0
- package/dist/cli/commands/baseline.d.ts.map +1 -0
- package/dist/cli/commands/baseline.js +396 -0
- package/dist/cli/commands/baseline.js.map +1 -0
- package/dist/cli/commands/history.d.cts +1 -1
- package/dist/cli/commands/history.d.cts.map +1 -1
- package/dist/cli/commands/history.d.ts +1 -1
- package/dist/cli/commands/history.d.ts.map +1 -1
- package/dist/cli/commands/init.cjs +99 -166
- package/dist/cli/commands/init.cjs.map +1 -1
- package/dist/cli/commands/init.d.cts +4 -4
- package/dist/cli/commands/init.d.cts.map +1 -1
- package/dist/cli/commands/init.d.ts +4 -4
- package/dist/cli/commands/init.d.ts.map +1 -1
- package/dist/cli/commands/init.js +99 -166
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/run.cjs +146 -127
- package/dist/cli/commands/run.cjs.map +1 -1
- package/dist/cli/commands/run.d.cts +16 -3
- package/dist/cli/commands/run.d.cts.map +1 -1
- package/dist/cli/commands/run.d.ts +16 -3
- package/dist/cli/commands/run.d.ts.map +1 -1
- package/dist/cli/commands/run.js +145 -93
- package/dist/cli/commands/run.js.map +1 -1
- package/dist/cli/index.cjs +583 -394
- package/dist/cli/index.cjs.map +1 -1
- package/dist/cli/index.d.cts +4 -16
- package/dist/cli/index.d.cts.map +1 -1
- package/dist/cli/index.d.ts +4 -16
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +575 -386
- package/dist/cli/index.js.map +1 -1
- package/dist/config/budget-schema.cjs +172 -0
- package/dist/config/budget-schema.cjs.map +1 -0
- package/dist/config/budget-schema.d.cts +59 -0
- package/dist/config/budget-schema.d.cts.map +1 -0
- package/dist/config/budget-schema.d.ts +59 -0
- package/dist/config/budget-schema.d.ts.map +1 -0
- package/dist/config/budget-schema.js +166 -0
- package/dist/config/budget-schema.js.map +1 -0
- package/dist/config/schema.cjs +182 -2
- package/dist/config/schema.cjs.map +1 -1
- package/dist/config/schema.d.cts +122 -3
- package/dist/config/schema.d.cts.map +1 -1
- package/dist/config/schema.d.ts +122 -3
- package/dist/config/schema.d.ts.map +1 -1
- package/dist/config/schema.js +180 -1
- package/dist/config/schema.js.map +1 -1
- package/dist/constants.cjs +45 -2
- package/dist/constants.cjs.map +1 -1
- package/dist/constants.d.cts +41 -0
- package/dist/constants.d.cts.map +1 -1
- package/dist/constants.d.ts +41 -0
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +44 -1
- package/dist/constants.js.map +1 -1
- package/dist/core/engine.cjs +114 -23
- package/dist/core/engine.cjs.map +1 -1
- package/dist/core/engine.d.cts +7 -7
- package/dist/core/engine.d.cts.map +1 -1
- package/dist/core/engine.d.ts +7 -7
- package/dist/core/engine.d.ts.map +1 -1
- package/dist/core/engine.js +115 -24
- package/dist/core/engine.js.map +1 -1
- package/dist/core/engines/accurate-engine.cjs +171 -36
- package/dist/core/engines/accurate-engine.cjs.map +1 -1
- package/dist/core/engines/accurate-engine.d.cts +5 -0
- package/dist/core/engines/accurate-engine.d.cts.map +1 -1
- package/dist/core/engines/accurate-engine.d.ts +5 -0
- package/dist/core/engines/accurate-engine.d.ts.map +1 -1
- package/dist/core/engines/accurate-engine.js +171 -36
- package/dist/core/engines/accurate-engine.js.map +1 -1
- package/dist/core/engines/tinybench-engine.cjs +3 -2
- package/dist/core/engines/tinybench-engine.cjs.map +1 -1
- package/dist/core/engines/tinybench-engine.d.cts.map +1 -1
- package/dist/core/engines/tinybench-engine.d.ts.map +1 -1
- package/dist/core/engines/tinybench-engine.js +3 -2
- package/dist/core/engines/tinybench-engine.js.map +1 -1
- package/dist/core/output-path-resolver.cjs +8 -1
- package/dist/core/output-path-resolver.cjs.map +1 -1
- package/dist/core/output-path-resolver.d.cts.map +1 -1
- package/dist/core/output-path-resolver.d.ts.map +1 -1
- package/dist/core/output-path-resolver.js +9 -2
- package/dist/core/output-path-resolver.js.map +1 -1
- package/dist/errors/base.cjs +12 -3
- package/dist/errors/base.cjs.map +1 -1
- package/dist/errors/base.d.cts +7 -0
- package/dist/errors/base.d.cts.map +1 -1
- package/dist/errors/base.d.ts +7 -0
- package/dist/errors/base.d.ts.map +1 -1
- package/dist/errors/base.js +10 -2
- package/dist/errors/base.js.map +1 -1
- package/dist/errors/budget.cjs +37 -0
- package/dist/errors/budget.cjs.map +1 -0
- package/dist/errors/budget.d.cts +31 -0
- package/dist/errors/budget.d.cts.map +1 -0
- package/dist/errors/budget.d.ts +31 -0
- package/dist/errors/budget.d.ts.map +1 -0
- package/dist/errors/budget.js +33 -0
- package/dist/errors/budget.js.map +1 -0
- package/dist/errors/index.cjs +4 -1
- package/dist/errors/index.cjs.map +1 -1
- package/dist/errors/index.d.cts +1 -0
- package/dist/errors/index.d.cts.map +1 -1
- package/dist/errors/index.d.ts +1 -0
- package/dist/errors/index.d.ts.map +1 -1
- package/dist/errors/index.js +2 -0
- package/dist/errors/index.js.map +1 -1
- package/dist/index.cjs +13 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -0
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -1
- package/dist/reporters/csv.cjs +37 -17
- package/dist/reporters/csv.cjs.map +1 -1
- package/dist/reporters/csv.d.cts +3 -6
- package/dist/reporters/csv.d.cts.map +1 -1
- package/dist/reporters/csv.d.ts +3 -6
- package/dist/reporters/csv.d.ts.map +1 -1
- package/dist/reporters/csv.js +37 -17
- package/dist/reporters/csv.js.map +1 -1
- package/dist/reporters/human.cjs +290 -67
- package/dist/reporters/human.cjs.map +1 -1
- package/dist/reporters/human.d.cts +25 -13
- package/dist/reporters/human.d.cts.map +1 -1
- package/dist/reporters/human.d.ts +25 -13
- package/dist/reporters/human.d.ts.map +1 -1
- package/dist/reporters/human.js +290 -67
- package/dist/reporters/human.js.map +1 -1
- package/dist/reporters/json.cjs +23 -48
- package/dist/reporters/json.cjs.map +1 -1
- package/dist/reporters/json.d.cts +2 -28
- package/dist/reporters/json.d.cts.map +1 -1
- package/dist/reporters/json.d.ts +2 -28
- package/dist/reporters/json.d.ts.map +1 -1
- package/dist/reporters/json.js +25 -50
- package/dist/reporters/json.js.map +1 -1
- package/dist/reporters/profile-human.cjs +154 -0
- package/dist/reporters/profile-human.cjs.map +1 -0
- package/dist/reporters/profile-human.d.cts +44 -0
- package/dist/reporters/profile-human.d.cts.map +1 -0
- package/dist/reporters/profile-human.d.ts +44 -0
- package/dist/reporters/profile-human.d.ts.map +1 -0
- package/dist/reporters/profile-human.js +147 -0
- package/dist/reporters/profile-human.js.map +1 -0
- package/dist/reporters/simple.cjs +67 -45
- package/dist/reporters/simple.cjs.map +1 -1
- package/dist/reporters/simple.d.cts +14 -14
- package/dist/reporters/simple.d.cts.map +1 -1
- package/dist/reporters/simple.d.ts +14 -14
- package/dist/reporters/simple.d.ts.map +1 -1
- package/dist/reporters/simple.js +67 -45
- package/dist/reporters/simple.js.map +1 -1
- package/dist/schema/modestbench-config.schema.json +153 -0
- package/dist/services/baseline-storage.cjs +151 -0
- package/dist/services/baseline-storage.cjs.map +1 -0
- package/dist/services/baseline-storage.d.cts +55 -0
- package/dist/services/baseline-storage.d.cts.map +1 -0
- package/dist/services/baseline-storage.d.ts +55 -0
- package/dist/services/baseline-storage.d.ts.map +1 -0
- package/dist/services/baseline-storage.js +147 -0
- package/dist/services/baseline-storage.js.map +1 -0
- package/dist/services/budget-evaluator.cjs +146 -0
- package/dist/services/budget-evaluator.cjs.map +1 -0
- package/dist/services/budget-evaluator.d.cts +29 -0
- package/dist/services/budget-evaluator.d.cts.map +1 -0
- package/dist/services/budget-evaluator.d.ts +29 -0
- package/dist/services/budget-evaluator.d.ts.map +1 -0
- package/dist/services/budget-evaluator.js +142 -0
- package/dist/services/budget-evaluator.js.map +1 -0
- package/dist/services/config-manager.cjs +24 -10
- package/dist/services/config-manager.cjs.map +1 -1
- package/dist/services/config-manager.d.cts +6 -1
- package/dist/services/config-manager.d.cts.map +1 -1
- package/dist/services/config-manager.d.ts +6 -1
- package/dist/services/config-manager.d.ts.map +1 -1
- package/dist/services/config-manager.js +24 -10
- package/dist/services/config-manager.js.map +1 -1
- package/dist/services/file-loader.cjs +3 -6
- package/dist/services/file-loader.cjs.map +1 -1
- package/dist/services/file-loader.d.cts.map +1 -1
- package/dist/services/file-loader.d.ts.map +1 -1
- package/dist/services/file-loader.js +3 -6
- package/dist/services/file-loader.js.map +1 -1
- package/dist/services/profiler/profile-filter.cjs +116 -0
- package/dist/services/profiler/profile-filter.cjs.map +1 -0
- package/dist/services/profiler/profile-filter.d.cts +20 -0
- package/dist/services/profiler/profile-filter.d.cts.map +1 -0
- package/dist/services/profiler/profile-filter.d.ts +20 -0
- package/dist/services/profiler/profile-filter.d.ts.map +1 -0
- package/dist/services/profiler/profile-filter.js +112 -0
- package/dist/services/profiler/profile-filter.js.map +1 -0
- package/dist/services/profiler/profile-parser.cjs +139 -0
- package/dist/services/profiler/profile-parser.cjs.map +1 -0
- package/dist/services/profiler/profile-parser.d.cts +18 -0
- package/dist/services/profiler/profile-parser.d.cts.map +1 -0
- package/dist/services/profiler/profile-parser.d.ts +18 -0
- package/dist/services/profiler/profile-parser.d.ts.map +1 -0
- package/dist/services/profiler/profile-parser.js +132 -0
- package/dist/services/profiler/profile-parser.js.map +1 -0
- package/dist/services/profiler/profile-runner.cjs +90 -0
- package/dist/services/profiler/profile-runner.cjs.map +1 -0
- package/dist/services/profiler/profile-runner.d.cts +29 -0
- package/dist/services/profiler/profile-runner.d.cts.map +1 -0
- package/dist/services/profiler/profile-runner.d.ts +29 -0
- package/dist/services/profiler/profile-runner.d.ts.map +1 -0
- package/dist/services/profiler/profile-runner.js +86 -0
- package/dist/services/profiler/profile-runner.js.map +1 -0
- package/dist/services/progress-manager.cjs +10 -2
- package/dist/services/progress-manager.cjs.map +1 -1
- package/dist/services/progress-manager.d.cts +2 -0
- package/dist/services/progress-manager.d.cts.map +1 -1
- package/dist/services/progress-manager.d.ts +2 -0
- package/dist/services/progress-manager.d.ts.map +1 -1
- package/dist/services/progress-manager.js +10 -2
- package/dist/services/progress-manager.js.map +1 -1
- package/dist/services/reporter-registry.cjs +18 -24
- package/dist/services/reporter-registry.cjs.map +1 -1
- package/dist/services/reporter-registry.d.cts +18 -40
- package/dist/services/reporter-registry.d.cts.map +1 -1
- package/dist/services/reporter-registry.d.ts +18 -40
- package/dist/services/reporter-registry.d.ts.map +1 -1
- package/dist/services/reporter-registry.js +18 -24
- package/dist/services/reporter-registry.js.map +1 -1
- package/dist/types/budgets.cjs +8 -0
- package/dist/types/budgets.cjs.map +1 -0
- package/dist/types/budgets.d.cts +149 -0
- package/dist/types/budgets.d.cts.map +1 -0
- package/dist/types/budgets.d.ts +149 -0
- package/dist/types/budgets.d.ts.map +1 -0
- package/dist/types/budgets.js +7 -0
- package/dist/types/budgets.js.map +1 -0
- package/dist/types/cli.cjs +2 -11
- package/dist/types/cli.cjs.map +1 -1
- package/dist/types/cli.d.cts +3 -227
- package/dist/types/cli.d.cts.map +1 -1
- package/dist/types/cli.d.ts +3 -227
- package/dist/types/cli.d.ts.map +1 -1
- package/dist/types/cli.js +2 -11
- package/dist/types/cli.js.map +1 -1
- package/dist/types/core.cjs +6 -1
- package/dist/types/core.cjs.map +1 -1
- package/dist/types/core.d.cts +15 -2
- package/dist/types/core.d.cts.map +1 -1
- package/dist/types/core.d.ts +15 -2
- package/dist/types/core.d.ts.map +1 -1
- package/dist/types/core.js +2 -1
- package/dist/types/core.js.map +1 -1
- package/dist/types/index.cjs +5 -0
- package/dist/types/index.cjs.map +1 -1
- package/dist/types/index.d.cts +2 -0
- package/dist/types/index.d.cts.map +1 -1
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +2 -0
- package/dist/types/index.js.map +1 -1
- package/dist/types/interfaces.d.cts +19 -8
- package/dist/types/interfaces.d.cts.map +1 -1
- package/dist/types/interfaces.d.ts +19 -8
- package/dist/types/interfaces.d.ts.map +1 -1
- package/dist/types/profiler.cjs +11 -0
- package/dist/types/profiler.cjs.map +1 -0
- package/dist/types/profiler.d.cts +102 -0
- package/dist/types/profiler.d.cts.map +1 -0
- package/dist/types/profiler.d.ts +102 -0
- package/dist/types/profiler.d.ts.map +1 -0
- package/dist/types/profiler.js +10 -0
- package/dist/types/profiler.js.map +1 -0
- package/dist/types/utility.cjs.map +1 -1
- package/dist/types/utility.d.cts +0 -8
- package/dist/types/utility.d.cts.map +1 -1
- package/dist/types/utility.d.ts +0 -8
- package/dist/types/utility.d.ts.map +1 -1
- package/dist/types/utility.js.map +1 -1
- package/dist/utils/identifiers.cjs +32 -0
- package/dist/utils/identifiers.cjs.map +1 -0
- package/dist/utils/identifiers.d.cts +32 -0
- package/dist/utils/identifiers.d.cts.map +1 -0
- package/dist/utils/identifiers.d.ts +32 -0
- package/dist/utils/identifiers.d.ts.map +1 -0
- package/dist/utils/identifiers.js +27 -0
- package/dist/utils/identifiers.js.map +1 -0
- package/dist/utils/package.cjs +40 -0
- package/dist/utils/package.cjs.map +1 -0
- package/dist/utils/package.d.cts +15 -0
- package/dist/utils/package.d.cts.map +1 -0
- package/dist/utils/package.d.ts +15 -0
- package/dist/utils/package.d.ts.map +1 -0
- package/dist/utils/package.js +33 -0
- package/dist/utils/package.js.map +1 -0
- package/dist/utils/type-guards.cjs +48 -0
- package/dist/utils/type-guards.cjs.map +1 -0
- package/dist/utils/type-guards.d.cts +22 -0
- package/dist/utils/type-guards.d.cts.map +1 -0
- package/dist/utils/type-guards.d.ts +22 -0
- package/dist/utils/type-guards.d.ts.map +1 -0
- package/dist/utils/type-guards.js +43 -0
- package/dist/utils/type-guards.js.map +1 -0
- package/package.json +18 -19
- package/src/cli/commands/analyze.ts +101 -0
- package/src/cli/commands/baseline.ts +577 -0
- package/src/cli/commands/history.ts +1 -1
- package/src/cli/commands/init.ts +116 -194
- package/src/cli/commands/run.ts +183 -113
- package/src/cli/index.ts +425 -183
- package/src/config/budget-schema.ts +189 -0
- package/src/config/schema.ts +260 -1
- package/src/constants.ts +53 -1
- package/src/core/engine.ts +169 -22
- package/src/core/engines/accurate-engine.ts +195 -44
- package/src/core/engines/tinybench-engine.ts +3 -2
- package/src/core/output-path-resolver.ts +10 -2
- package/src/errors/base.ts +11 -2
- package/src/errors/budget.ts +38 -0
- package/src/errors/index.ts +3 -0
- package/src/index.ts +9 -0
- package/src/reporters/csv.ts +54 -25
- package/src/reporters/human.ts +434 -115
- package/src/reporters/json.ts +26 -71
- package/src/reporters/profile-human.ts +210 -0
- package/src/reporters/simple.ts +88 -54
- package/src/services/baseline-storage.ts +199 -0
- package/src/services/budget-evaluator.ts +182 -0
- package/src/services/config-manager.ts +24 -9
- package/src/services/file-loader.ts +3 -6
- package/src/services/profiler/profile-filter.ts +147 -0
- package/src/services/profiler/profile-parser.ts +194 -0
- package/src/services/profiler/profile-runner.ts +121 -0
- package/src/services/progress-manager.ts +12 -2
- package/src/services/reporter-registry.ts +46 -81
- package/src/types/budgets.ts +180 -0
- package/src/types/cli.ts +5 -238
- package/src/types/core.ts +52 -10
- package/src/types/index.ts +5 -0
- package/src/types/interfaces.ts +24 -6
- package/src/types/profiler.ts +135 -0
- package/src/types/utility.ts +0 -10
- package/src/utils/identifiers.ts +58 -0
- package/src/utils/package.ts +35 -0
- package/src/utils/type-guards.ts +51 -0
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Performance budget types for benchmark thresholds
|
|
3
|
+
*
|
|
4
|
+
* @module types/budgets
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Absolute performance budgets (time-based)
|
|
9
|
+
*/
|
|
10
|
+
export interface AbsoluteBudget {
|
|
11
|
+
/** Maximum 99th percentile in nanoseconds */
|
|
12
|
+
readonly maxP99?: number;
|
|
13
|
+
|
|
14
|
+
/** Maximum mean execution time in nanoseconds */
|
|
15
|
+
readonly maxTime?: number;
|
|
16
|
+
|
|
17
|
+
/** Minimum operations per second */
|
|
18
|
+
readonly minOpsPerSec?: number;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Named baseline reference
|
|
23
|
+
*/
|
|
24
|
+
export interface BaselineReference {
|
|
25
|
+
/** Git branch (if available) */
|
|
26
|
+
readonly branch?: string;
|
|
27
|
+
|
|
28
|
+
/** Git commit (if available) */
|
|
29
|
+
readonly commit?: string;
|
|
30
|
+
|
|
31
|
+
/** Date baseline was created */
|
|
32
|
+
readonly date: Date;
|
|
33
|
+
|
|
34
|
+
/** Baseline name */
|
|
35
|
+
readonly name: string;
|
|
36
|
+
|
|
37
|
+
/** Run ID this baseline points to */
|
|
38
|
+
readonly runId: RunId;
|
|
39
|
+
|
|
40
|
+
/** Summary of benchmark results for quick comparison */
|
|
41
|
+
readonly summary: Record<TaskId, BaselineSummaryData>;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Baseline storage file format
|
|
46
|
+
*/
|
|
47
|
+
export interface BaselineStorage {
|
|
48
|
+
/** Named baselines */
|
|
49
|
+
readonly baselines: Record<string, BaselineReference>;
|
|
50
|
+
|
|
51
|
+
/** Default baseline name (optional) */
|
|
52
|
+
readonly default?: string;
|
|
53
|
+
|
|
54
|
+
/** Schema version */
|
|
55
|
+
readonly version: string;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Baseline summary data for a single task
|
|
60
|
+
*/
|
|
61
|
+
export interface BaselineSummaryData {
|
|
62
|
+
/** Mean execution time in nanoseconds */
|
|
63
|
+
readonly mean: number;
|
|
64
|
+
|
|
65
|
+
/** Operations per second */
|
|
66
|
+
readonly opsPerSecond: number;
|
|
67
|
+
|
|
68
|
+
/** 99th percentile (if available) */
|
|
69
|
+
readonly p99?: number;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Complete budget definition
|
|
74
|
+
*/
|
|
75
|
+
export interface Budget {
|
|
76
|
+
/** Absolute thresholds */
|
|
77
|
+
readonly absolute?: AbsoluteBudget;
|
|
78
|
+
|
|
79
|
+
/** Relative thresholds */
|
|
80
|
+
readonly relative?: RelativeBudget;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Budget evaluation result for a single task
|
|
85
|
+
*/
|
|
86
|
+
export interface BudgetResult {
|
|
87
|
+
/** Actual measured values */
|
|
88
|
+
readonly actual: {
|
|
89
|
+
readonly mean: number;
|
|
90
|
+
readonly opsPerSecond: number;
|
|
91
|
+
readonly p99?: number;
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
/** Baseline values (if relative budget) */
|
|
95
|
+
readonly baseline?: {
|
|
96
|
+
readonly mean: number;
|
|
97
|
+
readonly opsPerSecond: number;
|
|
98
|
+
readonly p99?: number;
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
/** Budget that was checked */
|
|
102
|
+
readonly budget: Budget;
|
|
103
|
+
|
|
104
|
+
/** Whether budget passed */
|
|
105
|
+
readonly passed: boolean;
|
|
106
|
+
|
|
107
|
+
/** Task identifier (file/suite/task) */
|
|
108
|
+
readonly taskId: TaskId;
|
|
109
|
+
|
|
110
|
+
/** Violations (what thresholds were exceeded) */
|
|
111
|
+
readonly violations: BudgetViolation[];
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Budget evaluation summary for entire run
|
|
116
|
+
*/
|
|
117
|
+
export interface BudgetSummary {
|
|
118
|
+
/** Number failed */
|
|
119
|
+
readonly failed: number;
|
|
120
|
+
|
|
121
|
+
/** Number passed */
|
|
122
|
+
readonly passed: number;
|
|
123
|
+
|
|
124
|
+
/** Individual results */
|
|
125
|
+
readonly results: BudgetResult[];
|
|
126
|
+
|
|
127
|
+
/** Total budgets checked */
|
|
128
|
+
readonly total: number;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Specific budget violation
|
|
133
|
+
*/
|
|
134
|
+
export interface BudgetViolation {
|
|
135
|
+
/** Actual measured value */
|
|
136
|
+
readonly actual: number;
|
|
137
|
+
|
|
138
|
+
/** How much over/under threshold (as decimal, e.g., 0.15 = 15% over) */
|
|
139
|
+
readonly delta: number;
|
|
140
|
+
|
|
141
|
+
/** Human-readable message */
|
|
142
|
+
readonly message: string;
|
|
143
|
+
|
|
144
|
+
/** Expected threshold */
|
|
145
|
+
readonly threshold: number;
|
|
146
|
+
|
|
147
|
+
/** Type of budget that was violated */
|
|
148
|
+
readonly type: 'maxP99' | 'maxRegression' | 'maxTime' | 'minOpsPerSec';
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* Relative performance budgets (comparison-based)
|
|
153
|
+
*/
|
|
154
|
+
export interface RelativeBudget {
|
|
155
|
+
/** Name of baseline to compare against */
|
|
156
|
+
readonly baseline?: string;
|
|
157
|
+
|
|
158
|
+
/** Maximum performance regression as decimal (0.10 = 10%) */
|
|
159
|
+
readonly maxRegression?: number;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* Branded type for benchmark run identifiers
|
|
164
|
+
*
|
|
165
|
+
* RunId is a 7-character alphanumeric string that uniquely identifies a
|
|
166
|
+
* benchmark run. Using a branded type prevents accidental mixing with regular
|
|
167
|
+
* strings or TaskIds.
|
|
168
|
+
*/
|
|
169
|
+
export type RunId = string & { readonly __brand: 'RunId' };
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* Branded type for task identifiers
|
|
173
|
+
*
|
|
174
|
+
* TaskId follows the format: `{filePath}/{suiteName}/{taskName}` Example:
|
|
175
|
+
* `benchmarks/array.bench.js/Array Operations/Array.push()`
|
|
176
|
+
*
|
|
177
|
+
* Using a branded type prevents accidental mixing with regular strings or
|
|
178
|
+
* RunIds.
|
|
179
|
+
*/
|
|
180
|
+
export type TaskId = string & { readonly __brand: 'TaskId' };
|
package/src/types/cli.ts
CHANGED
|
@@ -5,17 +5,9 @@
|
|
|
5
5
|
* definitions, argument parsing, and CLI-specific configuration structures.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
export const ExitCodes = {
|
|
12
|
-
ConfigurationError: 2,
|
|
13
|
-
ExecutionError: 5,
|
|
14
|
-
FileDiscoveryError: 3,
|
|
15
|
-
GeneralError: 1,
|
|
16
|
-
Success: 0,
|
|
17
|
-
ValidationError: 4,
|
|
18
|
-
} as const;
|
|
8
|
+
import { ExitCodes } from '../constants.js';
|
|
9
|
+
|
|
10
|
+
export { ExitCodes };
|
|
19
11
|
|
|
20
12
|
/**
|
|
21
13
|
* CLI argument specification for a command
|
|
@@ -39,56 +31,6 @@ export interface ArgumentSpec {
|
|
|
39
31
|
readonly validate?: (value: unknown) => boolean | string;
|
|
40
32
|
}
|
|
41
33
|
|
|
42
|
-
/**
|
|
43
|
-
* Base command interface
|
|
44
|
-
*/
|
|
45
|
-
export interface CliCommand {
|
|
46
|
-
/** Command aliases */
|
|
47
|
-
readonly aliases?: string[];
|
|
48
|
-
/** Command description */
|
|
49
|
-
readonly description: string;
|
|
50
|
-
/** Execute the command */
|
|
51
|
-
execute(args: CommandArguments): Promise<ExitCode>;
|
|
52
|
-
/** Command name */
|
|
53
|
-
readonly name: string;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
* CLI configuration
|
|
58
|
-
*/
|
|
59
|
-
export interface CliConfig {
|
|
60
|
-
/** Available commands */
|
|
61
|
-
readonly commands: CommandSpec[];
|
|
62
|
-
/** Application description */
|
|
63
|
-
readonly description: string;
|
|
64
|
-
/** Global options */
|
|
65
|
-
readonly globalOptions: ArgumentSpec[];
|
|
66
|
-
/** Application name */
|
|
67
|
-
readonly name: string;
|
|
68
|
-
/** Application version */
|
|
69
|
-
readonly version: string;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
/**
|
|
73
|
-
* Color theme for CLI output
|
|
74
|
-
*/
|
|
75
|
-
export interface ColorTheme {
|
|
76
|
-
/** Error color */
|
|
77
|
-
readonly error: string;
|
|
78
|
-
/** Highlight color */
|
|
79
|
-
readonly highlight: string;
|
|
80
|
-
/** Info color */
|
|
81
|
-
readonly info: string;
|
|
82
|
-
/** Muted/secondary text color */
|
|
83
|
-
readonly muted: string;
|
|
84
|
-
/** Primary color for branding */
|
|
85
|
-
readonly primary: string;
|
|
86
|
-
/** Success color */
|
|
87
|
-
readonly success: string;
|
|
88
|
-
/** Warning color */
|
|
89
|
-
readonly warning: string;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
34
|
/**
|
|
93
35
|
* Parsed command-line arguments
|
|
94
36
|
*/
|
|
@@ -119,118 +61,9 @@ export interface CommandSpec {
|
|
|
119
61
|
readonly subcommands?: CommandSpec[];
|
|
120
62
|
}
|
|
121
63
|
|
|
122
|
-
export type
|
|
123
|
-
|
|
124
|
-
/**
|
|
125
|
-
* Global CLI options available to all commands
|
|
126
|
-
*/
|
|
127
|
-
export interface GlobalOptions {
|
|
128
|
-
readonly c?: string;
|
|
129
|
-
/** Configuration file */
|
|
130
|
-
readonly config?: string;
|
|
131
|
-
/** Working directory */
|
|
132
|
-
readonly cwd?: string;
|
|
133
|
-
readonly h?: boolean;
|
|
134
|
-
/** Help flag */
|
|
135
|
-
readonly help?: boolean;
|
|
136
|
-
/** Log level */
|
|
137
|
-
readonly logLevel?: 'debug' | 'error' | 'info' | 'silent' | 'warn';
|
|
138
|
-
/** No color output */
|
|
139
|
-
readonly noColor?: boolean;
|
|
140
|
-
/** Version flag */
|
|
141
|
-
readonly version?: boolean;
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
/**
|
|
145
|
-
* CLI help information
|
|
146
|
-
*/
|
|
147
|
-
export interface HelpInfo {
|
|
148
|
-
/** Command name */
|
|
149
|
-
readonly command: string;
|
|
150
|
-
/** Command description */
|
|
151
|
-
readonly description: string;
|
|
152
|
-
/** Examples */
|
|
153
|
-
readonly examples?: string[];
|
|
154
|
-
/** Available options */
|
|
155
|
-
readonly options: Array<{
|
|
156
|
-
readonly default?: string;
|
|
157
|
-
readonly description: string;
|
|
158
|
-
readonly flags: string;
|
|
159
|
-
}>;
|
|
160
|
-
/** Available subcommands */
|
|
161
|
-
readonly subcommands?: Array<{
|
|
162
|
-
readonly description: string;
|
|
163
|
-
readonly name: string;
|
|
164
|
-
}>;
|
|
165
|
-
/** Usage string */
|
|
166
|
-
readonly usage: string;
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
/**
|
|
170
|
-
* Arguments for the history command
|
|
171
|
-
*/
|
|
172
|
-
export interface HistoryCommandArgs extends CommandArguments {
|
|
173
|
-
readonly f?: 'csv' | 'json' | 'table';
|
|
174
|
-
/** Output format */
|
|
175
|
-
readonly format?: 'csv' | 'json' | 'table';
|
|
176
|
-
readonly l?: number;
|
|
177
|
-
/** Limit number of results */
|
|
178
|
-
readonly limit?: number;
|
|
179
|
-
/** Pattern to match */
|
|
180
|
-
readonly pattern?: string;
|
|
181
|
-
/** Run IDs for show/compare commands */
|
|
182
|
-
readonly runIds?: string[];
|
|
183
|
-
/** Filter by date */
|
|
184
|
-
readonly since?: string;
|
|
185
|
-
/** History subcommand */
|
|
186
|
-
readonly subcommand?: 'clean' | 'compare' | 'list' | 'show' | 'trends';
|
|
187
|
-
/** Tags to filter by */
|
|
188
|
-
readonly tags?: string | string[];
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
/**
|
|
192
|
-
* Arguments for the init command
|
|
193
|
-
*/
|
|
194
|
-
export interface InitCommandArgs extends CommandArguments {
|
|
195
|
-
/** Configuration file type */
|
|
196
|
-
readonly configType?: 'js' | 'json' | 'ts' | 'yaml';
|
|
197
|
-
/** Create example files */
|
|
198
|
-
readonly examples?: boolean;
|
|
199
|
-
/** Force overwrite existing files */
|
|
200
|
-
readonly force?: boolean;
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
/**
|
|
204
|
-
* Output formatting options
|
|
205
|
-
*/
|
|
206
|
-
export interface OutputFormat {
|
|
207
|
-
/** Compact output mode */
|
|
208
|
-
readonly compact: boolean;
|
|
209
|
-
/** Progress display options */
|
|
210
|
-
readonly progress: ProgressDisplayOptions;
|
|
211
|
-
/** Color theme */
|
|
212
|
-
readonly theme: ColorTheme;
|
|
213
|
-
/** Use colors in output */
|
|
214
|
-
readonly useColors: boolean;
|
|
215
|
-
/** Use Unicode symbols */
|
|
216
|
-
readonly useUnicode: boolean;
|
|
217
|
-
}
|
|
64
|
+
export type Engine = 'accurate' | 'tinybench';
|
|
218
65
|
|
|
219
|
-
|
|
220
|
-
* CLI parser result
|
|
221
|
-
*/
|
|
222
|
-
export interface ParseResult {
|
|
223
|
-
/** Parsed arguments */
|
|
224
|
-
readonly args: CommandArguments;
|
|
225
|
-
/** Parsed command name */
|
|
226
|
-
readonly command: string;
|
|
227
|
-
/** Parsing errors */
|
|
228
|
-
readonly errors: string[];
|
|
229
|
-
/** Whether help was requested */
|
|
230
|
-
readonly help: boolean;
|
|
231
|
-
/** Whether version was requested */
|
|
232
|
-
readonly version: boolean;
|
|
233
|
-
}
|
|
66
|
+
export type ExitCode = (typeof ExitCodes)[keyof typeof ExitCodes];
|
|
234
67
|
|
|
235
68
|
/**
|
|
236
69
|
* Progress display options
|
|
@@ -247,69 +80,3 @@ export interface ProgressDisplayOptions {
|
|
|
247
80
|
/** Update interval in milliseconds */
|
|
248
81
|
readonly updateInterval: number;
|
|
249
82
|
}
|
|
250
|
-
|
|
251
|
-
/**
|
|
252
|
-
* Arguments for the run command
|
|
253
|
-
*/
|
|
254
|
-
export interface RunCommandArgs extends CommandArguments {
|
|
255
|
-
/** Stop on first failure */
|
|
256
|
-
readonly bail?: boolean;
|
|
257
|
-
readonly c?: string;
|
|
258
|
-
/** Configuration file path */
|
|
259
|
-
readonly config?: string;
|
|
260
|
-
readonly e?: 'accurate' | 'tinybench';
|
|
261
|
-
/** Benchmark engine to use */
|
|
262
|
-
readonly engine?: 'accurate' | 'tinybench';
|
|
263
|
-
/** Files to exclude */
|
|
264
|
-
readonly exclude?: string | string[];
|
|
265
|
-
/** Tags to exclude */
|
|
266
|
-
readonly excludeTags?: string | string[];
|
|
267
|
-
readonly i?: number;
|
|
268
|
-
/** Number of iterations */
|
|
269
|
-
readonly iterations?: number;
|
|
270
|
-
/** How to limit benchmark execution */
|
|
271
|
-
readonly limitBy?: 'all' | 'any' | 'iterations' | 'time';
|
|
272
|
-
readonly o?: string;
|
|
273
|
-
readonly of?: string;
|
|
274
|
-
/** Output directory */
|
|
275
|
-
readonly output?: string;
|
|
276
|
-
/** Custom output filename (works with single reporter only) */
|
|
277
|
-
readonly outputFile?: string;
|
|
278
|
-
/** Pattern for discovering benchmark files */
|
|
279
|
-
readonly pattern?: string;
|
|
280
|
-
readonly q?: boolean;
|
|
281
|
-
/** Quiet output */
|
|
282
|
-
readonly quiet?: boolean;
|
|
283
|
-
readonly r?: string | string[];
|
|
284
|
-
/** Reporters to use */
|
|
285
|
-
readonly reporters?: string | string[];
|
|
286
|
-
readonly t?: number;
|
|
287
|
-
/** Tags to include */
|
|
288
|
-
readonly tags?: string | string[];
|
|
289
|
-
/** Time limit in milliseconds */
|
|
290
|
-
readonly time?: number;
|
|
291
|
-
/** Timeout per task */
|
|
292
|
-
readonly timeout?: number;
|
|
293
|
-
readonly v?: boolean;
|
|
294
|
-
/** Verbose output */
|
|
295
|
-
readonly verbose?: boolean;
|
|
296
|
-
readonly w?: number;
|
|
297
|
-
/** Warmup iterations */
|
|
298
|
-
readonly warmup?: number;
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
/**
|
|
302
|
-
* Terminal capabilities
|
|
303
|
-
*/
|
|
304
|
-
export interface TerminalCapabilities {
|
|
305
|
-
/** Terminal height in rows */
|
|
306
|
-
readonly height: number;
|
|
307
|
-
/** Terminal supports interactive features */
|
|
308
|
-
readonly interactive: boolean;
|
|
309
|
-
/** Terminal supports colors */
|
|
310
|
-
readonly supportsColor: boolean;
|
|
311
|
-
/** Terminal supports Unicode characters */
|
|
312
|
-
readonly supportsUnicode: boolean;
|
|
313
|
-
/** Terminal width in columns */
|
|
314
|
-
readonly width: number;
|
|
315
|
-
}
|
package/src/types/core.ts
CHANGED
|
@@ -1,3 +1,42 @@
|
|
|
1
|
+
// Budget-related types
|
|
2
|
+
import type {
|
|
3
|
+
AbsoluteBudget,
|
|
4
|
+
BaselineReference,
|
|
5
|
+
BaselineStorage,
|
|
6
|
+
BaselineSummaryData,
|
|
7
|
+
Budget,
|
|
8
|
+
BudgetResult,
|
|
9
|
+
BudgetSummary,
|
|
10
|
+
BudgetViolation,
|
|
11
|
+
RelativeBudget,
|
|
12
|
+
RunId,
|
|
13
|
+
TaskId,
|
|
14
|
+
} from './budgets.js';
|
|
15
|
+
|
|
16
|
+
export type {
|
|
17
|
+
AbsoluteBudget,
|
|
18
|
+
BaselineReference,
|
|
19
|
+
BaselineStorage,
|
|
20
|
+
BaselineSummaryData,
|
|
21
|
+
Budget,
|
|
22
|
+
BudgetResult,
|
|
23
|
+
BudgetSummary,
|
|
24
|
+
BudgetViolation,
|
|
25
|
+
RelativeBudget,
|
|
26
|
+
RunId,
|
|
27
|
+
TaskId,
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
// Re-export schema-derived types
|
|
31
|
+
export type {
|
|
32
|
+
BenchmarkDefinition,
|
|
33
|
+
BenchmarkDefinitionInput,
|
|
34
|
+
BenchmarkSuite,
|
|
35
|
+
BenchmarkSuiteInput,
|
|
36
|
+
BenchmarkTask,
|
|
37
|
+
BenchmarkTaskInput,
|
|
38
|
+
} from '../core/benchmark-schema.js';
|
|
39
|
+
|
|
1
40
|
/**
|
|
2
41
|
* ModestBench Core Types
|
|
3
42
|
*
|
|
@@ -10,15 +49,8 @@
|
|
|
10
49
|
* safety and consistency.
|
|
11
50
|
*/
|
|
12
51
|
|
|
13
|
-
// Re-export
|
|
14
|
-
export
|
|
15
|
-
BenchmarkDefinition,
|
|
16
|
-
BenchmarkDefinitionInput,
|
|
17
|
-
BenchmarkSuite,
|
|
18
|
-
BenchmarkSuiteInput,
|
|
19
|
-
BenchmarkTask,
|
|
20
|
-
BenchmarkTaskInput,
|
|
21
|
-
} from '../core/benchmark-schema.js';
|
|
52
|
+
// Re-export identifier helper functions
|
|
53
|
+
export { createRunId, createTaskId } from '../utils/identifiers.js';
|
|
22
54
|
|
|
23
55
|
/**
|
|
24
56
|
* Benchmark file structure after parsing
|
|
@@ -38,6 +70,8 @@ export interface BenchmarkFile {
|
|
|
38
70
|
* Represents a complete benchmark run across multiple files
|
|
39
71
|
*/
|
|
40
72
|
export interface BenchmarkRun {
|
|
73
|
+
/** Budget evaluation summary (if budgets configured) */
|
|
74
|
+
readonly budgetSummary?: BudgetSummary;
|
|
41
75
|
/** CI/CD information if available */
|
|
42
76
|
readonly ci?: CiInfo;
|
|
43
77
|
/** Configuration used for this run */
|
|
@@ -53,7 +87,7 @@ export interface BenchmarkRun {
|
|
|
53
87
|
/** Git information if available */
|
|
54
88
|
readonly git?: GitInfo;
|
|
55
89
|
/** Unique identifier for this run */
|
|
56
|
-
readonly id:
|
|
90
|
+
readonly id: RunId;
|
|
57
91
|
/** Custom run-level metadata */
|
|
58
92
|
readonly metadata?: Record<string, unknown>;
|
|
59
93
|
/** Timestamp when run started */
|
|
@@ -277,6 +311,12 @@ export interface ModestBenchConfig {
|
|
|
277
311
|
readonly $schema?: string | undefined;
|
|
278
312
|
/** Whether to stop on first failure */
|
|
279
313
|
readonly bail: boolean;
|
|
314
|
+
/** Name of baseline to use for relative budget comparisons */
|
|
315
|
+
readonly baseline?: string | undefined;
|
|
316
|
+
/** How to handle budget violations: 'fail', 'warn', or 'report' */
|
|
317
|
+
readonly budgetMode?: 'fail' | 'report' | 'warn' | undefined;
|
|
318
|
+
/** Performance budgets mapped by task identifier */
|
|
319
|
+
readonly budgets?: Record<string, unknown> | undefined;
|
|
280
320
|
/** Patterns to exclude from discovery */
|
|
281
321
|
readonly exclude: string[];
|
|
282
322
|
/** Tags to exclude from execution */
|
|
@@ -363,6 +403,8 @@ export interface SuiteResult {
|
|
|
363
403
|
* Represents a single benchmark task execution result
|
|
364
404
|
*/
|
|
365
405
|
export interface TaskResult {
|
|
406
|
+
/** Whether the task was aborted (via Ctrl+C or signal) */
|
|
407
|
+
readonly aborted?: boolean;
|
|
366
408
|
/** Coefficient of variation (stdDev/mean × 100) */
|
|
367
409
|
readonly cv: number;
|
|
368
410
|
/** Any error that occurred during execution */
|
package/src/types/index.ts
CHANGED
|
@@ -10,9 +10,14 @@ export * from './cli.js';
|
|
|
10
10
|
|
|
11
11
|
// Core data types
|
|
12
12
|
export type * from './core.js';
|
|
13
|
+
// Helper functions from core (value exports)
|
|
14
|
+
export { createRunId, createTaskId } from './core.js';
|
|
13
15
|
|
|
14
16
|
// Interface contracts
|
|
15
17
|
export type * from './interfaces.js';
|
|
16
18
|
|
|
19
|
+
// Profiler types
|
|
20
|
+
export type * from './profiler.js';
|
|
21
|
+
|
|
17
22
|
// Utility types and helpers
|
|
18
23
|
export * from './utility.js';
|
package/src/types/interfaces.ts
CHANGED
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
import type {
|
|
10
10
|
BenchmarkFile,
|
|
11
11
|
BenchmarkRun,
|
|
12
|
+
BudgetSummary,
|
|
12
13
|
FileResult,
|
|
13
14
|
ModestBenchConfig,
|
|
14
15
|
SuiteResult,
|
|
@@ -76,6 +77,7 @@ export interface ConfigurationManager {
|
|
|
76
77
|
load(
|
|
77
78
|
configPath?: string,
|
|
78
79
|
cliArgs?: Record<string, unknown>,
|
|
80
|
+
commandDefaults?: Partial<ModestBenchConfig>,
|
|
79
81
|
): Promise<ModestBenchConfig>;
|
|
80
82
|
|
|
81
83
|
/**
|
|
@@ -266,8 +268,16 @@ export interface ProgressState {
|
|
|
266
268
|
|
|
267
269
|
/**
|
|
268
270
|
* Base reporter interface for benchmark output
|
|
271
|
+
*
|
|
272
|
+
* Required methods: onStart, onEnd, onError, onTaskResult Optional methods: All
|
|
273
|
+
* others (implement only what you need)
|
|
269
274
|
*/
|
|
270
275
|
export interface Reporter {
|
|
276
|
+
/**
|
|
277
|
+
* Called when budget evaluation completes
|
|
278
|
+
*/
|
|
279
|
+
onBudgetResult?(summary: BudgetSummary): Promise<void> | void;
|
|
280
|
+
|
|
271
281
|
/**
|
|
272
282
|
* Called when benchmark run completes
|
|
273
283
|
*/
|
|
@@ -281,17 +291,17 @@ export interface Reporter {
|
|
|
281
291
|
/**
|
|
282
292
|
* Called when a file completes
|
|
283
293
|
*/
|
|
284
|
-
onFileEnd(result: FileResult): Promise<void> | void;
|
|
294
|
+
onFileEnd?(result: FileResult): Promise<void> | void;
|
|
285
295
|
|
|
286
296
|
/**
|
|
287
297
|
* Called when a file starts execution
|
|
288
298
|
*/
|
|
289
|
-
onFileStart(file: string): Promise<void> | void;
|
|
299
|
+
onFileStart?(file: string): Promise<void> | void;
|
|
290
300
|
|
|
291
301
|
/**
|
|
292
302
|
* Called for progress updates
|
|
293
303
|
*/
|
|
294
|
-
onProgress(state: ProgressState): Promise<void> | void;
|
|
304
|
+
onProgress?(state: ProgressState): Promise<void> | void;
|
|
295
305
|
|
|
296
306
|
/**
|
|
297
307
|
* Called when benchmark run starts
|
|
@@ -301,12 +311,20 @@ export interface Reporter {
|
|
|
301
311
|
/**
|
|
302
312
|
* Called when a suite completes
|
|
303
313
|
*/
|
|
304
|
-
onSuiteEnd(result: SuiteResult): Promise<void> | void;
|
|
314
|
+
onSuiteEnd?(result: SuiteResult): Promise<void> | void;
|
|
315
|
+
|
|
316
|
+
/**
|
|
317
|
+
* Called before a suite starts, providing task names for pre-calculation
|
|
318
|
+
*/
|
|
319
|
+
onSuiteInit?(
|
|
320
|
+
suite: string,
|
|
321
|
+
taskNames: readonly string[],
|
|
322
|
+
): Promise<void> | void;
|
|
305
323
|
|
|
306
324
|
/**
|
|
307
325
|
* Called when a suite starts execution
|
|
308
326
|
*/
|
|
309
|
-
onSuiteStart(suite: string): Promise<void> | void;
|
|
327
|
+
onSuiteStart?(suite: string): Promise<void> | void;
|
|
310
328
|
|
|
311
329
|
/**
|
|
312
330
|
* Called when a task completes
|
|
@@ -316,7 +334,7 @@ export interface Reporter {
|
|
|
316
334
|
/**
|
|
317
335
|
* Called when a task starts execution
|
|
318
336
|
*/
|
|
319
|
-
onTaskStart(task: string): Promise<void> | void;
|
|
337
|
+
onTaskStart?(task: string): Promise<void> | void;
|
|
320
338
|
}
|
|
321
339
|
|
|
322
340
|
/**
|