@overkill-dev/run 0.0.4 → 0.0.5

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.
Files changed (97) hide show
  1. package/assertion-protocol/assertion-evaluation.js +6 -0
  2. package/assertion-protocol/assertion-evaluation.js.map +1 -0
  3. package/assertion-protocol/assertion-node.js +33 -0
  4. package/assertion-protocol/assertion-node.js.map +1 -0
  5. package/assertion-protocol/assertion-reference.js +49 -0
  6. package/assertion-protocol/assertion-reference.js.map +1 -0
  7. package/assertion-protocol/assertions/boolean.js +12 -0
  8. package/assertion-protocol/assertions/boolean.js.map +1 -0
  9. package/assertion-protocol/assertions/collection.js +21 -0
  10. package/assertion-protocol/assertions/collection.js.map +1 -0
  11. package/assertion-protocol/assertions/dispatch.js +47 -0
  12. package/assertion-protocol/assertions/dispatch.js.map +1 -0
  13. package/assertion-protocol/assertions/equality.js +24 -0
  14. package/assertion-protocol/assertions/equality.js.map +1 -0
  15. package/assertion-protocol/assertions/fail.js +8 -0
  16. package/assertion-protocol/assertions/fail.js.map +1 -0
  17. package/assertion-protocol/assertions/numeric.js +43 -0
  18. package/assertion-protocol/assertions/numeric.js.map +1 -0
  19. package/assertion-protocol/assertions/partial.js +17 -0
  20. package/assertion-protocol/assertions/partial.js.map +1 -0
  21. package/assertion-protocol/assertions/presence.js +20 -0
  22. package/assertion-protocol/assertions/presence.js.map +1 -0
  23. package/assertion-protocol/assertions/string.js +33 -0
  24. package/assertion-protocol/assertions/string.js.map +1 -0
  25. package/assertion-protocol/assertions/type-shape.js +43 -0
  26. package/assertion-protocol/assertions/type-shape.js.map +1 -0
  27. package/assertion-protocol/collection-count.js +42 -0
  28. package/assertion-protocol/collection-count.js.map +1 -0
  29. package/assertion-protocol/evaluation.js +170 -0
  30. package/assertion-protocol/evaluation.js.map +1 -0
  31. package/assertion-protocol/partial-matching.js +13 -0
  32. package/assertion-protocol/partial-matching.js.map +1 -0
  33. package/assertion-protocol/source-location.js +76 -0
  34. package/assertion-protocol/source-location.js.map +1 -0
  35. package/assertion-protocol/thrown-error-record.js +17 -0
  36. package/assertion-protocol/thrown-error-record.js.map +1 -0
  37. package/assertion-protocol/thrown-matcher.js +201 -0
  38. package/assertion-protocol/thrown-matcher.js.map +1 -0
  39. package/compare/comparison-result.js +47 -0
  40. package/compare/comparison-result.js.map +1 -0
  41. package/compare/comparison-state.js +20 -0
  42. package/compare/comparison-state.js.map +1 -0
  43. package/compare/comparison.js +78 -0
  44. package/compare/comparison.js.map +1 -0
  45. package/compare/diff-path.js +37 -0
  46. package/compare/diff-path.js.map +1 -0
  47. package/compare/raw-comparison.js +285 -0
  48. package/compare/raw-comparison.js.map +1 -0
  49. package/compare/serialized-value-classification.js +99 -0
  50. package/compare/serialized-value-classification.js.map +1 -0
  51. package/compare/serialized-value-shape.js +12 -0
  52. package/compare/serialized-value-shape.js.map +1 -0
  53. package/compare/serialized-value-state.js +55 -0
  54. package/compare/serialized-value-state.js.map +1 -0
  55. package/compare/serialized-value.js +387 -0
  56. package/compare/serialized-value.js.map +1 -0
  57. package/compare/structured-diff.js +382 -0
  58. package/compare/structured-diff.js.map +1 -0
  59. package/compare/value-classification.js +112 -0
  60. package/compare/value-classification.js.map +1 -0
  61. package/diff/binary-diff.js +49 -0
  62. package/diff/binary-diff.js.map +1 -0
  63. package/diff/string-diff.js +22 -0
  64. package/diff/string-diff.js.map +1 -0
  65. package/engine/assertion-facade.js +361 -0
  66. package/engine/assertion-facade.js.map +1 -0
  67. package/engine/case-execution.js +408 -0
  68. package/engine/case-execution.js.map +1 -0
  69. package/engine/custom-assertion-recording.js +175 -0
  70. package/engine/custom-assertion-recording.js.map +1 -0
  71. package/engine/execution.d.ts +20 -0
  72. package/engine/execution.d.ts.map +1 -0
  73. package/engine/execution.js +323 -0
  74. package/engine/execution.js.map +1 -0
  75. package/engine/identity.js +5 -0
  76. package/engine/identity.js.map +1 -0
  77. package/engine/reporter-event-queue.js +23 -0
  78. package/engine/reporter-event-queue.js.map +1 -0
  79. package/engine/reporter.js +177 -0
  80. package/engine/reporter.js.map +1 -0
  81. package/engine/require-assertion-facade.js +127 -0
  82. package/engine/require-assertion-facade.js.map +1 -0
  83. package/engine/run-result.js +13 -0
  84. package/engine/run-result.js.map +1 -0
  85. package/package.json +8 -3
  86. package/packages/engine/assertion-protocol.entry-point.js +4 -0
  87. package/packages/engine/assertion-protocol.entry-point.js.map +1 -0
  88. package/packages/run/run.entry-point.d.ts +2 -1
  89. package/packages/run/run.entry-point.d.ts.map +1 -1
  90. package/packages/run/run.entry-point.js +1 -0
  91. package/packages/run/run.entry-point.js.map +1 -1
  92. package/readme.md +7 -2
  93. package/run/run.d.ts +87 -36
  94. package/run/run.d.ts.map +1 -1
  95. package/run/run.js +182 -8
  96. package/run/run.js.map +1 -1
  97. package/sbom.cdx.json +22 -5
@@ -0,0 +1,127 @@
1
+ import { captureSourceLocation } from "../assertion-protocol/source-location.js";
2
+ import { recordRequireReference } from "./custom-assertion-recording.js";
3
+ function messageFromOptions(options, annotation) {
4
+ return options?.message ?? annotation;
5
+ }
6
+ export function createRecordingRequireFacadeWithLocation(sink, annotation, captureLocation) {
7
+ const methods = {
8
+ annotated(message) {
9
+ return createRecordingRequireFacadeWithLocation(sink, message, captureLocation);
10
+ },
11
+ array(actual, options) {
12
+ sink.recordRequire({
13
+ actual,
14
+ check: 'array',
15
+ location: captureLocation(),
16
+ message: messageFromOptions(options, annotation),
17
+ source: 'require'
18
+ });
19
+ },
20
+ boolean(actual, options) {
21
+ sink.recordRequire({
22
+ actual,
23
+ check: 'boolean',
24
+ location: captureLocation(),
25
+ message: messageFromOptions(options, annotation),
26
+ source: 'require'
27
+ });
28
+ },
29
+ defined(actual, options) {
30
+ sink.recordRequire({
31
+ actual,
32
+ check: 'defined',
33
+ location: captureLocation(),
34
+ message: messageFromOptions(options, annotation),
35
+ source: 'require'
36
+ });
37
+ },
38
+ function(actual, options) {
39
+ sink.recordRequire({
40
+ actual,
41
+ check: 'function',
42
+ location: captureLocation(),
43
+ message: messageFromOptions(options, annotation),
44
+ source: 'require'
45
+ });
46
+ },
47
+ hasProperty(actual, key, options) {
48
+ sink.recordRequire({
49
+ actual,
50
+ check: 'has-property',
51
+ key,
52
+ location: captureLocation(),
53
+ message: messageFromOptions(options, annotation),
54
+ source: 'require'
55
+ });
56
+ },
57
+ instanceOf(actual, expected, options) {
58
+ sink.recordRequire({
59
+ actual,
60
+ check: 'instance-of',
61
+ expected,
62
+ location: captureLocation(),
63
+ message: messageFromOptions(options, annotation),
64
+ source: 'require'
65
+ });
66
+ },
67
+ notNull(actual, options) {
68
+ sink.recordRequire({
69
+ actual,
70
+ check: 'not-null',
71
+ location: captureLocation(),
72
+ message: messageFromOptions(options, annotation),
73
+ source: 'require'
74
+ });
75
+ },
76
+ null(actual, options) {
77
+ sink.recordRequire({
78
+ actual,
79
+ check: 'null',
80
+ location: captureLocation(),
81
+ message: messageFromOptions(options, annotation),
82
+ source: 'require'
83
+ });
84
+ },
85
+ number(actual, options) {
86
+ sink.recordRequire({
87
+ actual,
88
+ check: 'number',
89
+ location: captureLocation(),
90
+ message: messageFromOptions(options, annotation),
91
+ source: 'require'
92
+ });
93
+ },
94
+ object(actual, options) {
95
+ sink.recordRequire({
96
+ actual,
97
+ check: 'object',
98
+ location: captureLocation(),
99
+ message: messageFromOptions(options, annotation),
100
+ source: 'require'
101
+ });
102
+ },
103
+ string(actual, options) {
104
+ sink.recordRequire({
105
+ actual,
106
+ check: 'string',
107
+ location: captureLocation(),
108
+ message: messageFromOptions(options, annotation),
109
+ source: 'require'
110
+ });
111
+ }
112
+ };
113
+ function callRequireReference(reference, ...parameters) {
114
+ recordRequireReference({
115
+ annotation,
116
+ location: captureLocation(),
117
+ parameters,
118
+ reference,
119
+ sink
120
+ });
121
+ }
122
+ return Object.assign(callRequireReference, methods);
123
+ }
124
+ export function createRecordingRequireFacade(sink, annotation) {
125
+ return createRecordingRequireFacadeWithLocation(sink, annotation, captureSourceLocation);
126
+ }
127
+ //# sourceMappingURL=require-assertion-facade.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"require-assertion-facade.js","sourceRoot":"","sources":["../../../../source/engine/require-assertion-facade.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,qBAAqB,EAAE,MAAM,0CAA0C,CAAC;AACjF,OAAO,EACH,sBAAsB,EAEzB,MAAM,iCAAiC,CAAC;AAsCzC,SAAS,kBAAkB,CAAC,OAAqC,EAAE,UAAyB;IACxF,OAAO,OAAO,EAAE,OAAO,IAAI,UAAU,CAAC;AAC1C,CAAC;AAED,MAAM,UAAU,wCAAwC,CACpD,IAA0B,EAC1B,UAAyB,EACzB,eAA+C;IAE/C,MAAM,OAAO,GAA4B;QACrC,SAAS,CAAC,OAAO;YACb,OAAO,wCAAwC,CAAC,IAAI,EAAE,OAAO,EAAE,eAAe,CAAC,CAAC;QACpF,CAAC;QAED,KAAK,CAAC,MAAM,EAAE,OAAO;YACjB,IAAI,CAAC,aAAa,CAAC;gBACf,MAAM;gBACN,KAAK,EAAE,OAAO;gBACd,QAAQ,EAAE,eAAe,EAAE;gBAC3B,OAAO,EAAE,kBAAkB,CAAC,OAAO,EAAE,UAAU,CAAC;gBAChD,MAAM,EAAE,SAAS;aACpB,CAAC,CAAC;QACP,CAAC;QAED,OAAO,CAAC,MAAM,EAAE,OAAO;YACnB,IAAI,CAAC,aAAa,CAAC;gBACf,MAAM;gBACN,KAAK,EAAE,SAAS;gBAChB,QAAQ,EAAE,eAAe,EAAE;gBAC3B,OAAO,EAAE,kBAAkB,CAAC,OAAO,EAAE,UAAU,CAAC;gBAChD,MAAM,EAAE,SAAS;aACpB,CAAC,CAAC;QACP,CAAC;QAED,OAAO,CAAC,MAAM,EAAE,OAAO;YACnB,IAAI,CAAC,aAAa,CAAC;gBACf,MAAM;gBACN,KAAK,EAAE,SAAS;gBAChB,QAAQ,EAAE,eAAe,EAAE;gBAC3B,OAAO,EAAE,kBAAkB,CAAC,OAAO,EAAE,UAAU,CAAC;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AAC,CAAC;AAC7F,CAAC"}
@@ -0,0 +1,13 @@
1
+ export function invalidDeepAssertionOperandFailure(actual) {
2
+ return {
3
+ actual,
4
+ code: 'invalid-deep-assertion-operand',
5
+ expected: 'non-primitive deep assertion operand',
6
+ kind: 'test-contract',
7
+ summary: 'Deep assertions require non-primitive operands.'
8
+ };
9
+ }
10
+ export function verdictFromOutcome(outcome) {
11
+ return outcome.kind;
12
+ }
13
+ //# sourceMappingURL=run-result.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run-result.js","sourceRoot":"","sources":["../../../../source/engine/run-result.ts"],"names":[],"mappings":"AA6DA,MAAM,UAAU,kCAAkC,CAAC,MAAmC;IAClF,OAAO;QACH,MAAM;QACN,IAAI,EAAE,gCAAgC;QACtC,QAAQ,EAAE,sCAAsC;QAChD,IAAI,EAAE,eAAe;QACrB,OAAO,EAAE,iDAAiD;KAC7D,CAAC;AACN,CAAC;AAmED,MAAM,UAAU,kBAAkB,CAAC,OAAoB;IACnD,OAAO,OAAO,CAAC,IAAI,CAAC;AACxB,CAAC"}
package/package.json CHANGED
@@ -4,7 +4,8 @@
4
4
  "url": "https://github.com/enormora/overkill/issues"
5
5
  },
6
6
  "dependencies": {
7
- "@enormora/wall-clock": "0.0.3"
7
+ "@enormora/wall-clock": "0.0.3",
8
+ "diff": "9.0.0"
8
9
  },
9
10
  "description": "Overkill run resolution and orchestration.",
10
11
  "engines": {
@@ -28,7 +29,11 @@
28
29
  "type": "git",
29
30
  "url": "git+https://github.com/enormora/overkill.git"
30
31
  },
31
- "sideEffects": false,
32
+ "sideEffects": [
33
+ "./assertion-protocol/assertion-reference.js",
34
+ "./engine/execution.js",
35
+ "./run/run.js"
36
+ ],
32
37
  "type": "module",
33
- "version": "0.0.4"
38
+ "version": "0.0.5"
34
39
  }
@@ -0,0 +1,4 @@
1
+ export { createCompositeAssertionGroup, createCompositeAssertionReferenceRecord, createNarrowingCompositeAssertionReferenceRecord, getAssertionReferenceRecord, getCompositeAssertionReferenceRecord, getNarrowingAssertionReferenceRecord, isAssertionReference, isCompositeAssertionGroup, isNarrowingAssertionReference } from "../../assertion-protocol/assertion-reference.js";
2
+ export { thrownMatcherChildren } from "../../assertion-protocol/thrown-matcher.js";
3
+ export { createThrownErrorRecord } from "../../assertion-protocol/thrown-error-record.js";
4
+ //# sourceMappingURL=assertion-protocol.entry-point.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assertion-protocol.entry-point.js","sourceRoot":"","sources":["../../../../../source/packages/engine/assertion-protocol.entry-point.ts"],"names":[],"mappings":"AAiBA,OAAO,EACH,6BAA6B,EAC7B,uCAAuC,EACvC,gDAAgD,EAChD,2BAA2B,EAC3B,oCAAoC,EACpC,oCAAoC,EACpC,oBAAoB,EACpB,yBAAyB,EACzB,6BAA6B,EAChC,MAAM,iDAAiD,CAAC;AA+BzD,OAAO,EAAE,qBAAqB,EAAE,MAAM,4CAA4C,CAAC;AAEnF,OAAO,EAAE,uBAAuB,EAAE,MAAM,iDAAiD,CAAC"}
@@ -1,3 +1,4 @@
1
1
  export { resolveRun, run } from '../../run/run.ts';
2
- export type { ResolvedRun, RunDebugRequest, RunExecutionRequest, RunFacts, RunFactsDebug, RunRequest, RunSeed, RunSelection, RunShard } from '../../run/run.ts';
2
+ export type { ResolvedRun, RunCaseFacts, RunCommand, RunConfig, RunDebugRequest, RunEnvironmentFacts, RunExecutionRequest, RunFacts, RunExecutionFacts, RunLoaderConfig, RunReproducibilityFacts, RunRequest, RunResolutionErrorCode, RunSeed, RunSelection, RunShard, SerializedValue } from '../../run/run.ts';
3
+ export { RunResolutionError } from '../../run/run.ts';
3
4
  //# sourceMappingURL=run.entry-point.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"run.entry-point.d.ts","sourceRoot":"","sources":["../../../../../source/packages/run/run.entry-point.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AACnD,YAAY,EACR,WAAW,EACX,eAAe,EACf,mBAAmB,EACnB,QAAQ,EACR,aAAa,EACb,UAAU,EACV,OAAO,EACP,YAAY,EACZ,QAAQ,EACX,MAAM,kBAAkB,CAAC"}
1
+ {"version":3,"file":"run.entry-point.d.ts","sourceRoot":"","sources":["../../../../../source/packages/run/run.entry-point.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AACnD,YAAY,EACR,WAAW,EACX,YAAY,EACZ,UAAU,EACV,SAAS,EACT,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,QAAQ,EACR,iBAAiB,EACjB,eAAe,EACf,uBAAuB,EACvB,UAAU,EACV,sBAAsB,EACtB,OAAO,EACP,YAAY,EACZ,QAAQ,EACR,eAAe,EAClB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC"}
@@ -1,2 +1,3 @@
1
1
  export { resolveRun, run } from "../../run/run.js";
2
+ export { RunResolutionError } from "../../run/run.js";
2
3
  //# sourceMappingURL=run.entry-point.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"run.entry-point.js","sourceRoot":"","sources":["../../../../../source/packages/run/run.entry-point.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC"}
1
+ {"version":3,"file":"run.entry-point.js","sourceRoot":"","sources":["../../../../../source/packages/run/run.entry-point.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AAoBnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC"}
package/readme.md CHANGED
@@ -4,8 +4,13 @@ Run orchestration package for turning caller intent into resolved Overkill runs.
4
4
 
5
5
  Top-level API:
6
6
 
7
+ - `RunCommand`
7
8
  - `RunRequest`
8
9
  - `RunFacts`
9
10
  - `ResolvedRun`
10
- - `resolveRun(request)`
11
- - `run(request)`
11
+ - `resolveRun(command)`
12
+ - `run(command)`
13
+
14
+ The current runner accepts an explicit `TestPlan` through `RunCommand`. File
15
+ discovery, config loading, filtering, sharding, seeded ordering, resources,
16
+ records, replay, and CLI parsing are separate runner milestones.
package/run/run.d.ts CHANGED
@@ -1,65 +1,116 @@
1
+ import { type SerializedValue as SerializedValueShape } from '../compare/serialized-value.ts';
2
+ import { type Execute } from '../engine/execution.ts';
1
3
  import type { CaseId } from '../engine/identity.ts';
2
- import type { Reporter } from '../engine/reporter.ts';
4
+ import { type Reporter } from '../engine/reporter.ts';
5
+ import type { RunResult } from '../engine/run-result.ts';
3
6
  import type { TestPlan } from '../engine/test-plan.ts';
7
+ export type SerializedValue = SerializedValueShape;
4
8
  export type RunSelection = {
5
- readonly kind: 'all' | 'case-id' | 'file' | 'filter' | 'last-failed' | 'name';
6
- readonly value: string | null;
9
+ readonly kind: 'all';
7
10
  };
8
11
  export type RunShard = {
9
12
  readonly index: number;
10
13
  readonly total: number;
11
14
  };
12
15
  export type RunExecutionRequest = {
13
- readonly mode: string;
14
- readonly workers: number;
16
+ readonly mode: 'concurrent-in-process';
15
17
  };
16
18
  export type RunSeed = {
17
19
  readonly value: bigint | null;
18
20
  };
19
21
  export type RunDebugRequest = {
20
- readonly mode: 'all' | 'off' | 'selected';
21
- readonly selectors: readonly string[];
22
+ readonly mode: 'off';
23
+ readonly selectors: readonly [];
24
+ };
25
+ export type RunLoaderConfig = {
26
+ readonly sourceMaps: boolean;
27
+ readonly stripMode: 'strip-only' | 'transform';
28
+ };
29
+ export type RunConfig = {
30
+ readonly loader: RunLoaderConfig;
31
+ readonly reporters: readonly Reporter[];
32
+ readonly runtimeStateDir: string;
22
33
  };
23
34
  export type RunRequest = {
35
+ readonly baselineUpdateMode: 'none';
36
+ readonly capture: 'buffered' | 'live';
37
+ readonly coverage: false;
38
+ readonly debug: RunDebugRequest;
39
+ readonly execution: RunExecutionRequest;
40
+ readonly order: 'plan';
24
41
  readonly paths: readonly string[];
42
+ readonly profile: 'microtest';
43
+ readonly seed: RunSeed;
25
44
  readonly selection: RunSelection;
26
45
  readonly shard: RunShard;
27
- readonly profile: string;
28
- readonly execution: RunExecutionRequest;
29
- readonly coverage: boolean;
30
- readonly capture: 'buffered' | 'live';
31
- readonly seed: RunSeed;
32
- readonly order: 'lexical' | 'seeded';
33
- readonly debug: RunDebugRequest;
34
- readonly configPath: string | null;
46
+ readonly verbose: false;
47
+ };
48
+ export type RunCommand = {
49
+ readonly config: RunConfig;
50
+ readonly request: RunRequest;
51
+ readonly testPlan: TestPlan;
35
52
  };
36
53
  export type RunFacts = {
37
- readonly seed: bigint;
38
- readonly identities: readonly CaseId[];
39
- readonly executionStrategy: string;
40
- readonly capabilityProfile: string;
41
- readonly baselineUpdateMode: 'apply' | 'bootstrap' | 'diff' | 'none' | 'update';
42
- readonly loaderConfig: {
43
- readonly stripMode: 'strip-only' | 'transform';
44
- readonly sourceMaps: boolean;
45
- };
46
- readonly versions: {
47
- readonly engine: string;
48
- readonly node: string;
49
- readonly packages: Readonly<Record<string, string>>;
54
+ readonly cases: readonly RunCaseFacts[];
55
+ readonly environment: RunEnvironmentFacts;
56
+ readonly execution: RunExecutionFacts;
57
+ readonly loader: RunLoaderConfig;
58
+ readonly reproducibility: RunReproducibilityFacts;
59
+ };
60
+ export type RunCaseFacts = {
61
+ readonly id: CaseId;
62
+ readonly metadata: SerializedValue;
63
+ };
64
+ export type RunEnvironmentFacts = {
65
+ readonly node: {
66
+ readonly arch: string;
67
+ readonly platform: string;
68
+ readonly version: string;
50
69
  };
51
- readonly debug: RunFactsDebug;
70
+ readonly runtimeStateDir: string;
52
71
  };
53
- export type RunFactsDebug = {
54
- readonly mode: 'all' | 'off' | 'selected';
55
- readonly caseIds: readonly CaseId[];
72
+ export type RunExecutionFacts = {
73
+ readonly baselineUpdateMode: 'none';
74
+ readonly capture: 'buffered' | 'live';
75
+ readonly coverage: false;
76
+ readonly debug: RunDebugRequest;
77
+ readonly mode: 'concurrent-in-process';
78
+ readonly order: 'plan';
79
+ readonly profile: 'microtest';
80
+ readonly verbose: false;
81
+ };
82
+ export type RunReproducibilityFacts = {
83
+ readonly seed: string;
84
+ readonly shard: RunShard;
56
85
  };
57
86
  export type ResolvedRun = {
58
- readonly request: RunRequest;
87
+ readonly config: RunConfig;
59
88
  readonly facts: RunFacts;
60
- readonly testPlan: TestPlan;
61
89
  readonly reporters: readonly Reporter[];
90
+ readonly request: RunRequest;
91
+ readonly testPlan: TestPlan;
92
+ };
93
+ export type RunResolutionErrorCode = 'invalid-request' | 'unsupported-request';
94
+ export declare class RunResolutionError extends Error {
95
+ private readonly errorCode;
96
+ constructor(message: string, options: Readonly<ErrorOptions> | undefined, code: RunResolutionErrorCode);
97
+ code(): RunResolutionErrorCode;
98
+ }
99
+ export type RunApiDependencies = {
100
+ readonly createSeed: () => bigint;
101
+ readonly execute: Execute;
102
+ readonly node: {
103
+ readonly arch: string;
104
+ readonly platform: string;
105
+ readonly version: string;
106
+ };
107
+ readonly readStartedAt: () => string;
108
+ };
109
+ export type RunApi = {
110
+ readonly resolveRun: (command: RunCommand) => Promise<ResolvedRun>;
111
+ readonly run: (command: RunCommand) => Promise<RunResult>;
62
112
  };
63
- export declare function resolveRun(request: RunRequest): Promise<ResolvedRun>;
64
- export declare function run(request: RunRequest): Promise<never>;
113
+ export declare function createRunApi(dependencies: RunApiDependencies): RunApi;
114
+ export declare function resolveRun(command: RunCommand): Promise<ResolvedRun>;
115
+ export declare function run(command: RunCommand): Promise<RunResult>;
65
116
  //# sourceMappingURL=run.d.ts.map
package/run/run.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../../../source/run/run.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,KAAK,EAAE,QAAQ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,12 +1,186 @@
1
- function acceptRunRequestForFutureResolution(request) {
2
- return request;
1
+ import { randomBytes } from 'node:crypto';
2
+ import { createWallClock } from '@enormora/wall-clock';
3
+ import { serializeValue } from "../compare/serialized-value.js";
4
+ import { createExecute } from "../engine/execution.js";
5
+ import { createReporterDispatcher } from "../engine/reporter.js";
6
+ const minimumSeedValue = 0n;
7
+ const seedByteLength = 8;
8
+ export class RunResolutionError extends Error {
9
+ errorCode;
10
+ constructor(message, options, code) {
11
+ super(message, options);
12
+ this.name = 'RunResolutionError';
13
+ this.errorCode = code;
14
+ }
15
+ code() {
16
+ return this.errorCode;
17
+ }
3
18
  }
4
- export async function resolveRun(request) {
5
- acceptRunRequestForFutureResolution(request);
6
- throw new Error('resolveRun() is not implemented yet.');
19
+ function unsupportedRequest(message) {
20
+ throw new RunResolutionError(message, undefined, 'unsupported-request');
7
21
  }
8
- export async function run(request) {
9
- acceptRunRequestForFutureResolution(request);
10
- throw new Error('run() is not implemented yet.');
22
+ function invalidRequest(message) {
23
+ throw new RunResolutionError(message, undefined, 'invalid-request');
24
+ }
25
+ function validateRunPaths(request) {
26
+ if (request.paths.length > 0) {
27
+ unsupportedRequest('Path discovery is not implemented yet.');
28
+ }
29
+ }
30
+ function validateRunShard(request) {
31
+ if (request.shard.index !== 0 || request.shard.total !== 1) {
32
+ unsupportedRequest('Sharding is not implemented yet.');
33
+ }
34
+ }
35
+ function validateRunSeed(request) {
36
+ if (request.seed.value !== null && request.seed.value < minimumSeedValue) {
37
+ invalidRequest('Run seed must be a nonnegative bigint.');
38
+ }
39
+ }
40
+ function validateRunRequest(request) {
41
+ validateRunPaths(request);
42
+ validateRunShard(request);
43
+ validateRunSeed(request);
44
+ }
45
+ function resolvedSeed(request, dependencies) {
46
+ return request.seed.value ?? dependencies.createSeed();
47
+ }
48
+ function copyLoaderConfig(loader) {
49
+ return {
50
+ sourceMaps: loader.sourceMaps,
51
+ stripMode: loader.stripMode
52
+ };
53
+ }
54
+ function copyRunShard(shard) {
55
+ return {
56
+ index: shard.index,
57
+ total: shard.total
58
+ };
59
+ }
60
+ function copyRunRequest(request) {
61
+ return {
62
+ baselineUpdateMode: request.baselineUpdateMode,
63
+ capture: request.capture,
64
+ coverage: request.coverage,
65
+ debug: {
66
+ mode: request.debug.mode,
67
+ selectors: []
68
+ },
69
+ execution: { mode: request.execution.mode },
70
+ order: request.order,
71
+ paths: Array.from(request.paths),
72
+ profile: request.profile,
73
+ seed: { value: request.seed.value },
74
+ selection: { kind: request.selection.kind },
75
+ shard: copyRunShard(request.shard),
76
+ verbose: request.verbose
77
+ };
78
+ }
79
+ function copyRunConfig(config) {
80
+ return {
81
+ loader: copyLoaderConfig(config.loader),
82
+ reporters: Array.from(config.reporters),
83
+ runtimeStateDir: config.runtimeStateDir
84
+ };
85
+ }
86
+ function runCaseFacts(metadata, id) {
87
+ return {
88
+ id,
89
+ metadata: serializeValue(metadata)
90
+ };
91
+ }
92
+ function createRunFacts(command, request, config, dependencies) {
93
+ return {
94
+ cases: command.testPlan.cases.map(function toRunCaseFacts(testCase) {
95
+ return runCaseFacts(testCase.metadata, testCase.id);
96
+ }),
97
+ environment: {
98
+ node: {
99
+ arch: dependencies.node.arch,
100
+ platform: dependencies.node.platform,
101
+ version: dependencies.node.version
102
+ },
103
+ runtimeStateDir: config.runtimeStateDir
104
+ },
105
+ execution: {
106
+ baselineUpdateMode: request.baselineUpdateMode,
107
+ capture: request.capture,
108
+ coverage: request.coverage,
109
+ debug: request.debug,
110
+ mode: request.execution.mode,
111
+ order: request.order,
112
+ profile: request.profile,
113
+ verbose: request.verbose
114
+ },
115
+ loader: config.loader,
116
+ reproducibility: {
117
+ seed: resolvedSeed(request, dependencies).toString(),
118
+ shard: request.shard
119
+ }
120
+ };
121
+ }
122
+ function freezeValue(value) {
123
+ if (value !== null && typeof value === 'object') {
124
+ for (const propertyValue of Object.values(value)) {
125
+ freezeValue(propertyValue);
126
+ }
127
+ Object.freeze(value);
128
+ }
129
+ return value;
130
+ }
131
+ function createResolvedRun(command, dependencies) {
132
+ validateRunRequest(command.request);
133
+ const request = freezeValue(copyRunRequest(command.request));
134
+ const config = freezeValue(copyRunConfig(command.config));
135
+ const facts = freezeValue(createRunFacts(command, request, config, dependencies));
136
+ return freezeValue({
137
+ config,
138
+ facts,
139
+ reporters: config.reporters,
140
+ request,
141
+ testPlan: command.testPlan
142
+ });
143
+ }
144
+ export function createRunApi(dependencies) {
145
+ return {
146
+ async resolveRun(command) {
147
+ return createResolvedRun(command, dependencies);
148
+ },
149
+ async run(command) {
150
+ const resolvedRun = createResolvedRun(command, dependencies);
151
+ return await dependencies.execute(resolvedRun.testPlan, {
152
+ execution: { mode: 'concurrent-in-process' },
153
+ reporters: resolvedRun.reporters,
154
+ runFacts: resolvedRun.facts,
155
+ startedAt: dependencies.readStartedAt()
156
+ });
157
+ }
158
+ };
159
+ }
160
+ function createDefaultSeed() {
161
+ return randomBytes(seedByteLength).readBigUInt64BE();
162
+ }
163
+ const defaultWallClock = createWallClock();
164
+ const defaultRunApi = createRunApi({
165
+ createSeed: createDefaultSeed,
166
+ execute: createExecute({
167
+ reporterDispatcher: createReporterDispatcher({ wallClock: defaultWallClock }),
168
+ wallClock: defaultWallClock
169
+ }),
170
+ node: {
171
+ arch: process.arch,
172
+ platform: process.platform,
173
+ version: process.versions.node
174
+ },
175
+ readStartedAt() {
176
+ const startedAt = new Date(defaultWallClock.currentTimestampInMilliseconds);
177
+ return startedAt.toISOString();
178
+ }
179
+ });
180
+ export async function resolveRun(command) {
181
+ return await defaultRunApi.resolveRun(command);
182
+ }
183
+ export async function run(command) {
184
+ return await defaultRunApi.run(command);
11
185
  }
12
186
  //# sourceMappingURL=run.js.map
package/run/run.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"run.js","sourceRoot":"","sources":["../../../../source/run/run.ts"],"names":[],"mappings":"AAwEA,SAAS,mCAAmC,CAAC,OAAmB;IAC5D,OAAO,OAAO,CAAC;AACnB,CAAC;AAED,MAAM,CAAC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