@overkill-dev/run 0.0.63 → 0.0.65
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/assertion-protocol/source-location-forwarding.js +14 -2
- package/assertion-protocol/source-location-forwarding.js.map +1 -1
- package/assertion-protocol/source-location.js +1 -0
- package/assertion-protocol/source-location.js.map +1 -1
- package/attachments/attachment-context.js +31 -0
- package/attachments/attachment-context.js.map +1 -0
- package/engine/async-leak-diagnostics.js +9 -9
- package/engine/async-leak-diagnostics.js.map +1 -1
- package/engine/case-attempt-execution.js +191 -0
- package/engine/case-attempt-execution.js.map +1 -0
- package/engine/case-execution.d.ts +5 -3
- package/engine/case-execution.d.ts.map +1 -1
- package/engine/case-execution.js +25 -24
- package/engine/case-execution.js.map +1 -1
- package/engine/coverage-artifact.d.ts +1 -0
- package/engine/coverage-artifact.d.ts.map +1 -1
- package/engine/execution-async-leak-policy.js +3 -10
- package/engine/execution-async-leak-policy.js.map +1 -1
- package/engine/execution-global-error-observer.d.ts +2 -1
- package/engine/execution-global-error-observer.d.ts.map +1 -1
- package/engine/execution-global-error-observer.js +19 -15
- package/engine/execution-global-error-observer.js.map +1 -1
- package/engine/execution-options.d.ts +4 -1
- package/engine/execution-options.d.ts.map +1 -1
- package/engine/execution-options.js +7 -2
- package/engine/execution-options.js.map +1 -1
- package/engine/execution-resource-budget-tracking.js.map +1 -1
- package/engine/execution-resource-tracked-cases.js.map +1 -1
- package/engine/execution-result.js.map +1 -1
- package/engine/execution-supervision-state.js.map +1 -1
- package/engine/execution-supervision.d.ts.map +1 -1
- package/engine/execution-supervision.js +50 -33
- package/engine/execution-supervision.js.map +1 -1
- package/engine/execution-test-plan-cases.js +6 -126
- package/engine/execution-test-plan-cases.js.map +1 -1
- package/engine/execution-test-plan-resource-usage.js.map +1 -1
- package/engine/execution.js +3 -3
- package/engine/execution.js.map +1 -1
- package/engine/identity.d.ts +3 -0
- package/engine/identity.d.ts.map +1 -1
- package/engine/reporter-dispatcher.js +1 -0
- package/engine/reporter-dispatcher.js.map +1 -1
- package/engine/reporter-event-queue.js.map +1 -1
- package/engine/reporter.d.ts +2 -1
- package/engine/reporter.d.ts.map +1 -1
- package/engine/reporter.js.map +1 -1
- package/engine/resource-usage.d.ts +22 -0
- package/engine/resource-usage.d.ts.map +1 -0
- package/engine/retry-policy.d.ts +4 -0
- package/engine/retry-policy.d.ts.map +1 -0
- package/engine/retry-policy.js +22 -0
- package/engine/retry-policy.js.map +1 -0
- package/engine/run-artifact.d.ts +45 -0
- package/engine/run-artifact.d.ts.map +1 -0
- package/engine/run-result.d.ts +22 -53
- package/engine/run-result.d.ts.map +1 -1
- package/engine/run-result.js +14 -0
- package/engine/run-result.js.map +1 -1
- package/engine/runner-error-reporting.js.map +1 -1
- package/engine/runtime-attachment.d.ts +62 -0
- package/engine/runtime-attachment.d.ts.map +1 -0
- package/engine/runtime-attachment.js +7 -0
- package/engine/runtime-attachment.js.map +1 -0
- package/engine/test-attempt-history.js +24 -0
- package/engine/test-attempt-history.js.map +1 -0
- package/package.json +25 -6
- package/packages/resources/attachment-context.entry-point.js +2 -0
- package/packages/resources/attachment-context.entry-point.js.map +1 -0
- package/packages/run/config.entry-point.d.ts +3 -1
- package/packages/run/config.entry-point.d.ts.map +1 -1
- package/packages/run/run.entry-point.d.ts +3 -1
- package/packages/run/run.entry-point.d.ts.map +1 -1
- package/packages/run/transcript-store.entry-point.d.ts +3 -0
- package/packages/run/transcript-store.entry-point.d.ts.map +1 -0
- package/packages/run/transcript-store.entry-point.js +2 -0
- package/packages/run/transcript-store.entry-point.js.map +1 -0
- package/packages/simulation/transcript.entry-point.js +2 -0
- package/packages/simulation/transcript.entry-point.js.map +1 -0
- package/readme.md +69 -2
- package/reporters/human-reporter-rendering.js +25 -2
- package/reporters/human-reporter-rendering.js.map +1 -1
- package/reporters/line-reporter.js +6 -1
- package/reporters/line-reporter.js.map +1 -1
- package/resources/resource-definition-brand.js +1 -1
- package/resources/resource-definition-brand.js.map +1 -1
- package/resources/resource-definition-types.d.ts.map +1 -1
- package/resources/resource-scenario-binding.js +2 -0
- package/resources/resource-scenario-binding.js.map +1 -1
- package/resources/resource-session.d.ts.map +1 -1
- package/resources/resources.d.ts.map +1 -1
- package/resources/resources.js +3 -6
- package/resources/resources.js.map +1 -1
- package/resources/runtime-definition.d.ts.map +1 -1
- package/resources/runtime-definition.js +1 -1
- package/resources/runtime-definition.js.map +1 -1
- package/resources/runtime-matrix-definition.d.ts.map +1 -1
- package/resources/runtime-matrix-definition.js +2 -2
- package/resources/runtime-matrix-definition.js.map +1 -1
- package/run/attachment-connection.js +108 -0
- package/run/attachment-connection.js.map +1 -0
- package/run/attachment-coordinator-context.js +9 -0
- package/run/attachment-coordinator-context.js.map +1 -0
- package/run/attachment-coordinator.js +77 -0
- package/run/attachment-coordinator.js.map +1 -0
- package/run/attachment-eligibility.js +21 -0
- package/run/attachment-eligibility.js.map +1 -0
- package/run/attachment-execution.js +255 -0
- package/run/attachment-execution.js.map +1 -0
- package/run/attachment-failure.js +63 -0
- package/run/attachment-failure.js.map +1 -0
- package/run/attachment-frames.js +22 -0
- package/run/attachment-frames.js.map +1 -0
- package/run/attachment-json.js +118 -0
- package/run/attachment-json.js.map +1 -0
- package/run/attachment-protocol.js +5 -0
- package/run/attachment-protocol.js.map +1 -0
- package/run/attachment-record.js +60 -0
- package/run/attachment-record.js.map +1 -0
- package/run/attachment-reporter.js +39 -0
- package/run/attachment-reporter.js.map +1 -0
- package/run/attachment-results.js +115 -0
- package/run/attachment-results.js.map +1 -0
- package/run/attachment-retention.js +153 -0
- package/run/attachment-retention.js.map +1 -0
- package/run/attachment-run.js +36 -0
- package/run/attachment-run.js.map +1 -0
- package/run/attachment-server.js +136 -0
- package/run/attachment-server.js.map +1 -0
- package/run/attachment-storage-session.js +21 -0
- package/run/attachment-storage-session.js.map +1 -0
- package/run/attachment-store.js +330 -0
- package/run/attachment-store.js.map +1 -0
- package/run/attachment-wire-schema.js +123 -0
- package/run/attachment-wire-schema.js.map +1 -0
- package/run/attachment-worker-context.js +49 -0
- package/run/attachment-worker-context.js.map +1 -0
- package/run/attachment-writer.js +117 -0
- package/run/attachment-writer.js.map +1 -0
- package/run/capability-policy.js +10 -5
- package/run/capability-policy.js.map +1 -1
- package/run/collected-run-plan.js.map +1 -1
- package/run/coverage-config-schema.d.ts +4 -4
- package/run/coverage-loaded-sources.js +112 -0
- package/run/coverage-loaded-sources.js.map +1 -0
- package/run/coverage-native-data.js +18 -0
- package/run/coverage-native-data.js.map +1 -0
- package/run/coverage-paths.js +45 -4
- package/run/coverage-paths.js.map +1 -1
- package/run/coverage-reporting.js +104 -8
- package/run/coverage-reporting.js.map +1 -1
- package/run/coverage-run-record.js +50 -0
- package/run/coverage-run-record.js.map +1 -0
- package/run/coverage-runtime-source.js +37 -0
- package/run/coverage-runtime-source.js.map +1 -0
- package/run/coverage-session.js +344 -6
- package/run/coverage-session.js.map +1 -1
- package/run/coverage-source-map.js +125 -0
- package/run/coverage-source-map.js.map +1 -0
- package/run/coverage-source-selection.js +120 -0
- package/run/coverage-source-selection.js.map +1 -0
- package/run/duration-history.d.ts.map +1 -1
- package/run/duration-history.js +1 -0
- package/run/duration-history.js.map +1 -1
- package/run/node-run-execution.js +25 -0
- package/run/node-run-execution.js.map +1 -0
- package/run/node-runtime-state-store.js +38 -0
- package/run/node-runtime-state-store.js.map +1 -0
- package/run/node-worker-pool-factory.js +0 -31
- package/run/node-worker-pool-factory.js.map +1 -1
- package/run/path-containment.js +6 -1
- package/run/path-containment.js.map +1 -1
- package/run/permission-denial-runtime-policy.js +21 -13
- package/run/permission-denial-runtime-policy.js.map +1 -1
- package/run/recorded-coverage-run.js +45 -0
- package/run/recorded-coverage-run.js.map +1 -0
- package/run/recorded-coverage-session.js +50 -0
- package/run/recorded-coverage-session.js.map +1 -0
- package/run/resource-lifecycle-projection.js +6 -2
- package/run/resource-lifecycle-projection.js.map +1 -1
- package/run/resource-lifecycle-session-acquirer.js +13 -6
- package/run/resource-lifecycle-session-acquirer.js.map +1 -1
- package/run/resource-lifecycle-startup-budget.js +1 -0
- package/run/resource-lifecycle-startup-budget.js.map +1 -1
- package/run/resource-lifecycle-state.d.ts +4 -2
- package/run/resource-lifecycle-state.d.ts.map +1 -1
- package/run/resource-lifecycle-state.js +19 -3
- package/run/resource-lifecycle-state.js.map +1 -1
- package/run/resource-lifecycle.js +57 -13
- package/run/resource-lifecycle.js.map +1 -1
- package/run/resource-usage.js.map +1 -1
- package/run/retry-artifact-retention.js +37 -0
- package/run/retry-artifact-retention.js.map +1 -0
- package/run/run-config-schema.d.ts +48 -4
- package/run/run-config-schema.d.ts.map +1 -1
- package/run/run-config-schema.js +18 -0
- package/run/run-config-schema.js.map +1 -1
- package/run/run-config.d.ts +9 -6
- package/run/run-config.d.ts.map +1 -1
- package/run/run-config.js +6 -1
- package/run/run-config.js.map +1 -1
- package/run/run-coverage.js +5 -2
- package/run/run-coverage.js.map +1 -1
- package/run/run-engine-primitives.d.ts +13 -1
- package/run/run-engine-primitives.d.ts.map +1 -1
- package/run/run-errors.d.ts.map +1 -1
- package/run/run-errors.js +1 -0
- package/run/run-errors.js.map +1 -1
- package/run/run-execution-config.d.ts +5 -0
- package/run/run-execution-config.d.ts.map +1 -1
- package/run/run-facts.js +3 -0
- package/run/run-facts.js.map +1 -1
- package/run/run-isolated-command.js +3 -0
- package/run/run-isolated-command.js.map +1 -1
- package/run/run-local-command.js +12 -83
- package/run/run-local-command.js.map +1 -1
- package/run/run-local-coverage.js +72 -0
- package/run/run-local-coverage.js.map +1 -0
- package/run/run-local-execution.js +3 -1
- package/run/run-local-execution.js.map +1 -1
- package/run/run-local-resolution.js +6 -3
- package/run/run-local-resolution.js.map +1 -1
- package/run/run-orchestrator-dependencies.d.ts +1 -1
- package/run/run-orchestrator-dependencies.d.ts.map +1 -1
- package/run/run-orchestrator.d.ts.map +1 -1
- package/run/run-orchestrator.js +6 -18
- package/run/run-orchestrator.js.map +1 -1
- package/run/run-record-error.js +26 -0
- package/run/run-record-error.js.map +1 -0
- package/run/run-record-input.js +34 -0
- package/run/run-record-input.js.map +1 -0
- package/run/run-record-outcomes.d.ts +49 -0
- package/run/run-record-outcomes.d.ts.map +1 -0
- package/run/run-record-result.js +58 -0
- package/run/run-record-result.js.map +1 -0
- package/run/run-record-storage.js +51 -0
- package/run/run-record-storage.js.map +1 -0
- package/run/run-record-types.d.ts +73 -0
- package/run/run-record-types.d.ts.map +1 -0
- package/run/run-record-versions.js +51 -0
- package/run/run-record-versions.js.map +1 -0
- package/run/run-record.js +48 -0
- package/run/run-record.js.map +1 -0
- package/run/run-result-reporting.js +16 -0
- package/run/run-result-reporting.js.map +1 -0
- package/run/run-supervised-finalization.js +8 -0
- package/run/run-supervised-finalization.js.map +1 -0
- package/run/run-supervised-process.js +34 -33
- package/run/run-supervised-process.js.map +1 -1
- package/run/run-support.js +23 -9
- package/run/run-support.js.map +1 -1
- package/run/run-types.d.ts +7 -5
- package/run/run-types.d.ts.map +1 -1
- package/run/run-types.js.map +1 -1
- package/run/run-validation.js +9 -0
- package/run/run-validation.js.map +1 -1
- package/run/runtime-attachment-boundary.js +11 -0
- package/run/runtime-attachment-boundary.js.map +1 -0
- package/run/supervised-child-test-plan.js +2 -0
- package/run/supervised-child-test-plan.js.map +1 -1
- package/run/supervised-child.js +12 -9
- package/run/supervised-child.js.map +1 -1
- package/run/supervised-output-capture.js +66 -0
- package/run/supervised-output-capture.js.map +1 -0
- package/run/supervised-protocol.js.map +1 -1
- package/run/supervised-run-collection.js +3 -1
- package/run/supervised-run-collection.js.map +1 -1
- package/run/supervised-run-resource-policy.js +12 -1
- package/run/supervised-run-resource-policy.js.map +1 -1
- package/run/supervised-run-runtime.js +25 -30
- package/run/supervised-run-runtime.js.map +1 -1
- package/run/supervised-run-state.js +64 -81
- package/run/supervised-run-state.js.map +1 -1
- package/run/supervised-run.js +14 -4
- package/run/supervised-run.js.map +1 -1
- package/run/worker-pool-collection.js +1 -0
- package/run/worker-pool-collection.js.map +1 -1
- package/run/worker-pool-command.js +2 -0
- package/run/worker-pool-command.js.map +1 -1
- package/run/worker-pool-execution.js +12 -3
- package/run/worker-pool-execution.js.map +1 -1
- package/run/worker-pool-hedged-arbitration.js +11 -2
- package/run/worker-pool-hedged-arbitration.js.map +1 -1
- package/run/worker-pool-host-process.js.map +1 -1
- package/run/worker-pool-host-protocol.js.map +1 -1
- package/run/worker-pool-protocol.js.map +1 -1
- package/run/worker-pool-resource-lifecycle-execution.js +1 -0
- package/run/worker-pool-resource-lifecycle-execution.js.map +1 -1
- package/run/worker-pool-resource-tracking.js +2 -2
- package/run/worker-pool-resource-tracking.js.map +1 -1
- package/run/worker-pool-results.js +7 -9
- package/run/worker-pool-results.js.map +1 -1
- package/run/worker-pool-run.js +10 -3
- package/run/worker-pool-run.js.map +1 -1
- package/run/worker-pool-runtime.js +3 -7
- package/run/worker-pool-runtime.js.map +1 -1
- package/run/worker-pool-task-events.js +12 -4
- package/run/worker-pool-task-events.js.map +1 -1
- package/run/worker-pool-worker-plan.js +1 -0
- package/run/worker-pool-worker-plan.js.map +1 -1
- package/run/worker-pool-worker-resources.js +1 -0
- package/run/worker-pool-worker-resources.js.map +1 -1
- package/run/worker-pool-worker.js +15 -4
- package/run/worker-pool-worker.js.map +1 -1
- package/sbom.cdx.json +65 -14
- package/transcript/http-transcript.js +3 -0
- package/transcript/http-transcript.js.map +1 -0
- package/transcript/transcript-store.d.ts +25 -0
- package/transcript/transcript-store.d.ts.map +1 -0
- package/transcript/transcript-store.js +73 -0
- package/transcript/transcript-store.js.map +1 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { RunCollectionError } from "./run-errors.js";
|
|
2
|
+
export class RunRecordError extends RunCollectionError {
|
|
3
|
+
recordPath;
|
|
4
|
+
recordPhase;
|
|
5
|
+
constructor(filePath, options, phase) {
|
|
6
|
+
super(`Failed to persist run record during ${phase}: ${filePath}.`, options, 'runtime-state');
|
|
7
|
+
this.name = 'RunRecordError';
|
|
8
|
+
this.recordPath = filePath;
|
|
9
|
+
this.recordPhase = phase;
|
|
10
|
+
}
|
|
11
|
+
runnerError() {
|
|
12
|
+
return {
|
|
13
|
+
...super.runnerError(),
|
|
14
|
+
diagnostics: [
|
|
15
|
+
{ label: 'Run record phase', value: this.recordPhase },
|
|
16
|
+
{ label: 'Run record path', value: this.recordPath }
|
|
17
|
+
]
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
export function runRecordPersistenceError(filePath, phase, error) {
|
|
22
|
+
return new RunRecordError(filePath, {
|
|
23
|
+
cause: { error, kind: 'run-record-persistence', path: filePath, phase }
|
|
24
|
+
}, phase);
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=run-record-error.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-record-error.js","sourceRoot":"","sources":["../../../../source/run/run-record-error.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAIrD,MAAM,OAAO,cAAe,SAAQ,kBAAkB;IACjC,UAAU,CAAS;IACnB,WAAW,CAAiB;IAE7C,YAAmB,QAAgB,EAAE,OAA+B,EAAE,KAAqB;QACvF,KAAK,CAAC,uCAAuC,KAAK,KAAK,QAAQ,GAAG,EAAE,OAAO,EAAE,eAAe,CAAC,CAAC;QAC9F,IAAI,CAAC,IAAI,GAAG,gBAAgB,CAAC;QAC7B,IAAI,CAAC,UAAU,GAAG,QAAQ,CAAC;QAC3B,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC;IAC7B,CAAC;IAEe,WAAW;QACvB,OAAO;YACH,GAAG,KAAK,CAAC,WAAW,EAAE;YACtB,WAAW,EAAE;gBACT,EAAE,KAAK,EAAE,kBAAkB,EAAE,KAAK,EAAE,IAAI,CAAC,WAAW,EAAE;gBACtD,EAAE,KAAK,EAAE,iBAAiB,EAAE,KAAK,EAAE,IAAI,CAAC,UAAU,EAAE;aACvD;SACJ,CAAC;IACN,CAAC;CACJ;AAED,MAAM,UAAU,yBAAyB,CAAC,QAAgB,EAAE,KAAqB,EAAE,KAAc;IAC7F,OAAO,IAAI,cAAc,CAAC,QAAQ,EAAE;QAChC,KAAK,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,wBAAwB,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE;KAC1E,EAAE,KAAK,CAAC,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { runEngineFacts } from "./run-support.js";
|
|
2
|
+
export function initialRecord(cwd, input, dependencies) {
|
|
3
|
+
if (input.request.seed.value === null) {
|
|
4
|
+
throw new Error('Run recording requires a resolved seed.');
|
|
5
|
+
}
|
|
6
|
+
const seed = input.request.seed.value.toString();
|
|
7
|
+
const startedAt = new Date(dependencies.wallClock.currentUnixEpochMilliseconds);
|
|
8
|
+
return {
|
|
9
|
+
coverage: null,
|
|
10
|
+
cwd,
|
|
11
|
+
engine: runEngineFacts(input.engine),
|
|
12
|
+
environment: {
|
|
13
|
+
node: dependencies.node,
|
|
14
|
+
projectRoot: input.projectRoot,
|
|
15
|
+
runtimeStateDir: input.config.runtimeStateDir
|
|
16
|
+
},
|
|
17
|
+
execution: input.profile.execution,
|
|
18
|
+
facts: null,
|
|
19
|
+
id: dependencies.createId(),
|
|
20
|
+
identities: [],
|
|
21
|
+
kind: 'single',
|
|
22
|
+
loader: input.config.loader,
|
|
23
|
+
placementTrace: null,
|
|
24
|
+
request: { ...input.request, seed: { value: seed } },
|
|
25
|
+
result: null,
|
|
26
|
+
runtime: null,
|
|
27
|
+
seed,
|
|
28
|
+
startedAt: startedAt.toISOString(),
|
|
29
|
+
status: 'started',
|
|
30
|
+
version: 1,
|
|
31
|
+
versions: dependencies.versions
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=run-record-input.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-record-input.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AAE,YAAY,CAAC,QAAQ;KAClC,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { Except } from 'type-fest';
|
|
2
|
+
import type { SerializedValue } from '../compare/serialized-value.ts';
|
|
3
|
+
import type { HedgedConflictArtifact, TestAttemptResult, TestFailure, TestOutcome } from '../engine/run-result.ts';
|
|
4
|
+
import type { CapturedOutputArtifact } from '../engine/run-artifact.ts';
|
|
5
|
+
import type { CoverageArtifact } from '../engine/coverage-artifact.ts';
|
|
6
|
+
import type { RuntimeAttachmentArtifact } from '../engine/runtime-attachment.ts';
|
|
7
|
+
type RecordedThrownError = {
|
|
8
|
+
readonly kind: 'body-error' | 'cleanup-error';
|
|
9
|
+
readonly error: {
|
|
10
|
+
readonly message: string;
|
|
11
|
+
readonly name: string;
|
|
12
|
+
readonly stack: string | null;
|
|
13
|
+
readonly thrown: SerializedValue;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
type RecordedContractFailure = Except<Extract<TestFailure, {
|
|
17
|
+
readonly kind: 'test-contract';
|
|
18
|
+
}>, 'actual'> & {
|
|
19
|
+
readonly actual: SerializedValue;
|
|
20
|
+
};
|
|
21
|
+
type PreservedTestFailure = Exclude<TestFailure, {
|
|
22
|
+
readonly kind: 'body-error' | 'cleanup-error' | 'test-contract';
|
|
23
|
+
}>;
|
|
24
|
+
export type RunRecordTestFailure = PreservedTestFailure | RecordedContractFailure | RecordedThrownError;
|
|
25
|
+
export type RunRecordTestOutcome = Exclude<TestOutcome, {
|
|
26
|
+
readonly kind: 'fail';
|
|
27
|
+
}> | {
|
|
28
|
+
readonly failures: readonly [RunRecordTestFailure, ...readonly RunRecordTestFailure[]];
|
|
29
|
+
readonly kind: 'fail';
|
|
30
|
+
};
|
|
31
|
+
type RecordedConflictEvidence = {
|
|
32
|
+
readonly attachments: readonly RuntimeAttachmentArtifact[];
|
|
33
|
+
readonly attempts: readonly [RunRecordTestAttempt, ...readonly RunRecordTestAttempt[]];
|
|
34
|
+
readonly outcome: RunRecordTestOutcome | null;
|
|
35
|
+
readonly verdict: TestOutcome['kind'] | 'crashed' | 'resource-exhausted' | 'runtime-policy';
|
|
36
|
+
};
|
|
37
|
+
export type RunRecordTestAttempt = Except<TestAttemptResult, 'outcome'> & {
|
|
38
|
+
readonly outcome: RunRecordTestOutcome | null;
|
|
39
|
+
};
|
|
40
|
+
type RecordedConflictArtifact = Except<HedgedConflictArtifact, 'payload'> & {
|
|
41
|
+
readonly payload: Except<HedgedConflictArtifact['payload'], 'authoritative' | 'conflicting'> & {
|
|
42
|
+
readonly authoritative: RecordedConflictEvidence;
|
|
43
|
+
readonly conflicting: RecordedConflictEvidence;
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
type DiagnosticArtifact = CapturedOutputArtifact | RuntimeAttachmentArtifact;
|
|
47
|
+
export type RunRecordArtifact = CoverageArtifact | DiagnosticArtifact | RecordedConflictArtifact;
|
|
48
|
+
export {};
|
|
49
|
+
//# sourceMappingURL=run-record-outcomes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-record-outcomes.d.ts","sourceRoot":"","sources":["../../../../source/run/run-record-outcomes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACtE,OAAO,KAAK,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACnH,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AACxE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AACvE,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAC;AAEjF,KAAK,mBAAmB,GAAG;IACvB,QAAQ,CAAC,IAAI,EAAE,YAAY,GAAG,eAAe,CAAC;IA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AG,oBAAoB,GAAG,gBAAgB,CAAC;CAC/F,CAAC;AACF,MAAM,MAAM,oBAAoB,GAAG,MAAM,CAAC,iBAAiB,EAAE,SAAS,CAAC,GAAG;IACtE,QAAQ,CAAC,OAAO,EAAE,oBAAoB,GAAG,IAAI,CAAC;CACjD,CAAC;AACF,KAAK,wBAAwB,GAAG,MAAM,CAAC,sBAAsB,EAAE,SAAS,CAAC,GAAG;IACxE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC,sBAAsB,CAAC,SAAS,CAAC,EAAE,eAAe,GAAG,aAAa,CAAC,GAAG;QAC3F,QAAQ,CAAC,aAAa,EAAE,wBAAwB,CAAC;QACjD,QAAQ,CAAC,WAAW,EAAE,wBAAwB,CAAC;KAClD,CAAC;CACL,CAAC;AAEF,KAAK,kBAAkB,GAAG,sBAAsB,GAAG,yBAAyB,CAAC;AAC7E,MAAM,MAAM,iBAAiB,GAAG,gBAAgB,GAAG,kBAAkB,GAAG,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { serializeValue } from "../compare/serialized-value.js";
|
|
2
|
+
function recordedFailure(failure) {
|
|
3
|
+
if (failure.kind === 'body-error' || failure.kind === 'cleanup-error') {
|
|
4
|
+
return { ...failure, error: { ...failure.error, thrown: serializeValue(failure.error.thrown) } };
|
|
5
|
+
}
|
|
6
|
+
return failure.kind === 'test-contract' ? { ...failure, actual: serializeValue(failure.actual) } : failure;
|
|
7
|
+
}
|
|
8
|
+
function recordedOutcome(outcome) {
|
|
9
|
+
if (outcome?.kind !== 'fail') {
|
|
10
|
+
return outcome;
|
|
11
|
+
}
|
|
12
|
+
const [first, ...remaining] = outcome.failures;
|
|
13
|
+
return { ...outcome, failures: [recordedFailure(first), ...remaining.map(recordedFailure)] };
|
|
14
|
+
}
|
|
15
|
+
function isHedgedConflict(artifact) {
|
|
16
|
+
return artifact.payload.kind === 'hedged-conflict';
|
|
17
|
+
}
|
|
18
|
+
function recordedAttempts(attempts) {
|
|
19
|
+
function recordAttempt(attempt) {
|
|
20
|
+
return { ...attempt, outcome: recordedOutcome(attempt.outcome) };
|
|
21
|
+
}
|
|
22
|
+
const [first, ...remaining] = attempts;
|
|
23
|
+
return [recordAttempt(first), ...remaining.map(recordAttempt)];
|
|
24
|
+
}
|
|
25
|
+
function recordedArtifact(artifact) {
|
|
26
|
+
if (!isHedgedConflict(artifact)) {
|
|
27
|
+
return artifact;
|
|
28
|
+
}
|
|
29
|
+
return {
|
|
30
|
+
...artifact,
|
|
31
|
+
payload: {
|
|
32
|
+
...artifact.payload,
|
|
33
|
+
authoritative: {
|
|
34
|
+
...artifact.payload.authoritative,
|
|
35
|
+
attempts: recordedAttempts(artifact.payload.authoritative.attempts),
|
|
36
|
+
outcome: recordedOutcome(artifact.payload.authoritative.outcome)
|
|
37
|
+
},
|
|
38
|
+
conflicting: {
|
|
39
|
+
...artifact.payload.conflicting,
|
|
40
|
+
attempts: recordedAttempts(artifact.payload.conflicting.attempts),
|
|
41
|
+
outcome: recordedOutcome(artifact.payload.conflicting.outcome)
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
export function recordedRunResult(result) {
|
|
47
|
+
return {
|
|
48
|
+
...result,
|
|
49
|
+
artifacts: result.artifacts.map(recordedArtifact),
|
|
50
|
+
perTest: result.perTest.map(function recordTestOutcome(test) {
|
|
51
|
+
return { ...test, attempts: recordedAttempts(test.attempts), outcome: recordedOutcome(test.outcome) };
|
|
52
|
+
}),
|
|
53
|
+
runnerErrors: result.runnerErrors.map(function recordErrorCause(error) {
|
|
54
|
+
return { ...error, cause: serializeValue(error.cause) };
|
|
55
|
+
})
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=run-record-result.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-record-result.js","sourceRoot":"","sources":["../../../../source/run/run-record-result.ts"],"names":[],"mappings":"AAAA,OAAO,E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Y,CAAC,GAAG,CAAC,SAAS,gBAAgB,CAAC,KAAK;YACjE,OAAO,EAAE,GAAG,KAAK,EAAE,KAAK,EAAE,cAAc,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC;QAC5D,CAAC,CAAC;KACL,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { recordUndeliveredRunnerError } from "../engine/reporter-error-delivery-tracking.js";
|
|
2
|
+
import { runRecordPersistenceError } from "./run-record-error.js";
|
|
3
|
+
import { recordedRunResult } from "./run-record-result.js";
|
|
4
|
+
const jsonIndentation = 2;
|
|
5
|
+
async function preserveFailure(storage, result, status) {
|
|
6
|
+
const phase = status === 'completed' ? 'complete' : 'checkpoint';
|
|
7
|
+
try {
|
|
8
|
+
await storage.persist({ ...storage.current(), result: recordedRunResult(result), status }, phase);
|
|
9
|
+
}
|
|
10
|
+
catch {
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
function resultWithPersistenceError(result, error, phase) {
|
|
14
|
+
const runnerError = error.runnerError();
|
|
15
|
+
if (phase === 'complete') {
|
|
16
|
+
recordUndeliveredRunnerError(runnerError);
|
|
17
|
+
}
|
|
18
|
+
return { ...result, runnerErrors: [...result.runnerErrors, runnerError], status: 'failed' };
|
|
19
|
+
}
|
|
20
|
+
export function createRunRecordStorage(filePath, initial, store) {
|
|
21
|
+
let current = initial;
|
|
22
|
+
const storage = {
|
|
23
|
+
current() {
|
|
24
|
+
return current;
|
|
25
|
+
},
|
|
26
|
+
async persist(value, phase) {
|
|
27
|
+
current = value;
|
|
28
|
+
try {
|
|
29
|
+
await store.write(filePath, `${JSON.stringify(value, null, jsonIndentation)}\n`);
|
|
30
|
+
}
|
|
31
|
+
catch (error) {
|
|
32
|
+
throw runRecordPersistenceError(filePath, phase, error);
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
async result(result, status) {
|
|
36
|
+
const phase = status === 'completed' ? 'complete' : 'checkpoint';
|
|
37
|
+
try {
|
|
38
|
+
await storage.persist({ ...current, result: recordedRunResult(result), status }, phase);
|
|
39
|
+
return result;
|
|
40
|
+
}
|
|
41
|
+
catch (error) {
|
|
42
|
+
const persistenceError = runRecordPersistenceError(filePath, phase, error);
|
|
43
|
+
const failure = resultWithPersistenceError(result, persistenceError, phase);
|
|
44
|
+
await preserveFailure(storage, failure, status);
|
|
45
|
+
return failure;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
return storage;
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=run-record-storage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-record-storage.js","sourceRoot":"","sources":["../../../../source/run/run-record-storage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,+CAA+C,CAAC;AAG7F,OAAO,EAAE,yBAAyB,EAA4C,MAAM,uBAAuB,CAAC;AAC5G,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAS3D,MAAM,eAAe,GAAG,CAAC,CAAC;AAE1B,KAAK,UAAU,eAAe,CAC1B,OAAyB,EACzB,MAAiB,EACjB,MAA+B;IAE/B,MAAM,KAAK,GAAG,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,YAAY,CAAC;IACjE,IAAI,CAAC;QACD,MAAM,OAAO,CAAC,OAAO,CACjB,EAAE,GAAG,OAAO,CAAC,OAAO,EAAE,EAAE,MAAM,EAAE,iBAAiB,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,EACnE,KAAK,CACR,CAAC;IACN,CAAC;IAAC,MAAM,CAAC;IACT,CAAC;AACL,CAAC;AAED,SAAS,0BAA0B,CAAC,MAAiB,EAAE,KAAqB,EAAE,KAAqB;IAC/F,MAAM,WAAW,GAAG,KAAK,CAAC,WAAW,EAAE,CAAC;IACxC,IAAI,KAAK,KAAK,UAAU,EAAE,CAAC;QACvB,4BAA4B,CA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AAgB,EAAE,KAAK,CAAC,CAAC;gBAC5E,MAAM,eAAe,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;gBAChD,OAAO,OAAO,CAAC;YACnB,CAAC;QACL,CAAC;KACJ,CAAC;IAEF,OAAO,OAAO,CAAC;AACnB,CAAC"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import type { Except } from 'type-fest';
|
|
2
|
+
import type { RuntimeId, WorkId } from '../engine/identity.ts';
|
|
3
|
+
import type { RunnerError, RunResult } from '../engine/run-result.ts';
|
|
4
|
+
import type { SerializedValue } from '../compare/serialized-value.ts';
|
|
5
|
+
import type { RunRecordArtifact, RunRecordTestAttempt, RunRecordTestOutcome } from './run-record-outcomes.ts';
|
|
6
|
+
import type { PlacementTrace } from './placement-trace.ts';
|
|
7
|
+
import type { RunCoveragePolicy, RunEngineFacts, RunEnvironmentFacts, RunFacts, RunLoaderConfig, RunProfileConfig, RunRequest } from './run-types.ts';
|
|
8
|
+
export type RunRecordCoverage = {
|
|
9
|
+
readonly directory: string;
|
|
10
|
+
readonly policy: RunCoveragePolicy;
|
|
11
|
+
readonly rawDataDirectory: string;
|
|
12
|
+
};
|
|
13
|
+
export type RunRecordVersions = {
|
|
14
|
+
readonly engine: string | null;
|
|
15
|
+
readonly node: string;
|
|
16
|
+
readonly packages: Readonly<Record<string, string>>;
|
|
17
|
+
};
|
|
18
|
+
export type ResolvedRuntime = {
|
|
19
|
+
readonly adapters: readonly {
|
|
20
|
+
readonly name: string;
|
|
21
|
+
readonly version: string;
|
|
22
|
+
}[];
|
|
23
|
+
readonly id: RuntimeId;
|
|
24
|
+
readonly machineClass: string | null;
|
|
25
|
+
readonly nodeVersion: string | null;
|
|
26
|
+
readonly os: string | null;
|
|
27
|
+
};
|
|
28
|
+
type RecordedTestResult = Except<RunResult['perTest'][number], 'attempts' | 'outcome'> & {
|
|
29
|
+
readonly attempts: readonly [RunRecordTestAttempt, ...readonly RunRecordTestAttempt[]];
|
|
30
|
+
readonly outcome: RunRecordTestOutcome | null;
|
|
31
|
+
};
|
|
32
|
+
export type RunRecordResult = Except<RunResult, 'artifacts' | 'perTest' | 'runnerErrors'> & {
|
|
33
|
+
readonly artifacts: readonly RunRecordArtifact[];
|
|
34
|
+
readonly perTest: readonly RecordedTestResult[];
|
|
35
|
+
readonly runnerErrors: readonly (Except<RunnerError, 'cause'> & {
|
|
36
|
+
readonly cause: SerializedValue;
|
|
37
|
+
})[];
|
|
38
|
+
};
|
|
39
|
+
export type RunRecordRequest = Except<RunRequest, 'seed'> & {
|
|
40
|
+
readonly seed: {
|
|
41
|
+
readonly value: string;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
type RunRecordInputs = {
|
|
45
|
+
readonly coverage: RunRecordCoverage | null;
|
|
46
|
+
readonly cwd: string;
|
|
47
|
+
readonly engine: RunEngineFacts;
|
|
48
|
+
readonly environment: RunEnvironmentFacts;
|
|
49
|
+
readonly execution: RunProfileConfig['execution'];
|
|
50
|
+
readonly facts: RunFacts | null;
|
|
51
|
+
readonly id: string;
|
|
52
|
+
readonly identities: readonly WorkId[];
|
|
53
|
+
readonly kind: 'single';
|
|
54
|
+
readonly loader: RunLoaderConfig;
|
|
55
|
+
readonly placementTrace: PlacementTrace | null;
|
|
56
|
+
readonly request: RunRecordRequest;
|
|
57
|
+
readonly runtime: ResolvedRuntime | null;
|
|
58
|
+
readonly seed: string;
|
|
59
|
+
readonly startedAt: string;
|
|
60
|
+
readonly version: 1;
|
|
61
|
+
readonly versions: RunRecordVersions;
|
|
62
|
+
};
|
|
63
|
+
type CompletedRunRecord = RunRecordInputs & {
|
|
64
|
+
readonly result: RunRecordResult;
|
|
65
|
+
readonly status: 'completed';
|
|
66
|
+
};
|
|
67
|
+
type StartedRunRecord = RunRecordInputs & {
|
|
68
|
+
readonly result: RunRecordResult | null;
|
|
69
|
+
readonly status: 'interrupted' | 'started';
|
|
70
|
+
};
|
|
71
|
+
export type RunRecord = CompletedRunRecord | StartedRunRecord;
|
|
72
|
+
export {};
|
|
73
|
+
//# sourceMappingURL=run-record-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-record-types.d.ts","sourceRoot":"","sources":["../../../../source/run/run-record-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACtE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACtE,OAAO,KAAK,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAC9G,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,KAAK,EACR,iBAAiB,EACjB,cAAc,EACd,mBAAmB,EACnB,QAAQ,EACR,eAAe,EACf,gBAAgB,EAChB,UAAU,EACb,MAAM,gBAAgB,CAAC;AAExB,MAAM,MAAM,iBAAiB,GAAG;IAC5B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,MAAM,EAAE,iBAAiB,CAAC;IACnC,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;CACrC,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC5B,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;CACvD,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC1B,QAAQ,CAAC,QAAQ,EAAE,SAAS;QAAE,QAAQ,CAAC,IAAI,EAAE,MAA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ToPath } from 'node:url';
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
const packageVersionSchema = z.object({ name: z.string(), version: z.string() });
|
|
6
|
+
async function parsePackageVersion(manifestPath) {
|
|
7
|
+
const contents = await readFile(manifestPath, 'utf8');
|
|
8
|
+
const parsed = packageVersionSchema.safeParse(JSON.parse(contents));
|
|
9
|
+
return parsed.success ? parsed.data : null;
|
|
10
|
+
}
|
|
11
|
+
async function readPackageVersion(directory) {
|
|
12
|
+
const manifestPath = path.join(directory, 'package.json');
|
|
13
|
+
try {
|
|
14
|
+
return await parsePackageVersion(manifestPath);
|
|
15
|
+
}
|
|
16
|
+
catch (error) {
|
|
17
|
+
if (error instanceof Error && Reflect.get(error, 'code') === 'ENOENT' && path.dirname(directory) !== directory) {
|
|
18
|
+
return await readPackageVersion(path.dirname(directory));
|
|
19
|
+
}
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
async function packageVersion(moduleUrl) {
|
|
24
|
+
try {
|
|
25
|
+
return await readPackageVersion(path.dirname(fileURLToPath(moduleUrl)));
|
|
26
|
+
}
|
|
27
|
+
catch {
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
async function coverageBackendVersion() {
|
|
32
|
+
try {
|
|
33
|
+
return await packageVersion(import.meta.resolve('monocart-coverage-reports'));
|
|
34
|
+
}
|
|
35
|
+
catch {
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
function packageEntries(metadata) {
|
|
40
|
+
return metadata === null || metadata.name === 'overkill' ? [] : [[metadata.name, metadata.version]];
|
|
41
|
+
}
|
|
42
|
+
export async function runRecordVersions(engine, node) {
|
|
43
|
+
const [runner, backend, selectedEngine] = await Promise.all([
|
|
44
|
+
packageVersion(import.meta.url),
|
|
45
|
+
coverageBackendVersion(),
|
|
46
|
+
engine.kind === 'module' ? packageVersion(engine.moduleUrl) : Promise.resolve(null)
|
|
47
|
+
]);
|
|
48
|
+
const packages = Object.fromEntries([runner, backend, selectedEngine].flatMap(packageEntries));
|
|
49
|
+
return { engine: selectedEngine?.version ?? null, node, packages };
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=run-record-versions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-record-versions.js","sourceRoot":"","sources":["../../../../source/run/run-record-versions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;AAGjF,KAAK,UAAU,mBAAmB,CAAC,YAAoB;IACnD,MAAM,QAAQ,GAAG,MAAM,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC;IACtD,MAAM,MAAM,GAAG,oBAAoB,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC;IACpE,OAAO,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;AAC/C,CAAC;AAED,KAAK,UAAU,kBAAkB,CAAC,SAAiB;IAC/C,MAAM,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,cAAc,CAAC,CAAC;IAC1D,IAAI,CAAC;QACD,OAAO,MAAM,mBAAmB,CAAC,YAAY,CAAC,CAAC;IACnD,CAAC;IAAC,OAAO,KAAc,EAAE,CAAC;QACtB,IACI,KAAK,YAAY,KAAK,IAAI,OAAO,CAAC,GAAG,CAAC,KAAK,EAAE,MAAM,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C,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC;KACtF,CAAC,CAAC;IACH,MAAM,QAAQ,GAAG,MAAM,CAAC,WAAW,CAAC,CAAE,MAAM,EAAE,OAAO,EAAE,cAAc,CAAE,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC;IAEjG,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,OAAO,IAAI,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;AACvE,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
import { createResultFromResolutionError } from "./run-collection-error-result.js";
|
|
3
|
+
import { RunCollectionError } from "./run-errors.js";
|
|
4
|
+
import { createRunRecordStorage } from "./run-record-storage.js";
|
|
5
|
+
import { recordedRunResult } from "./run-record-result.js";
|
|
6
|
+
import { initialRecord } from "./run-record-input.js";
|
|
7
|
+
export function createRunRecordSession(cwd, input, dependencies) {
|
|
8
|
+
const value = initialRecord(cwd, input, dependencies);
|
|
9
|
+
const filePath = path.resolve(input.projectRoot, input.config.runtimeStateDir, 'runs', `${value.id}.json`);
|
|
10
|
+
const storage = createRunRecordStorage(filePath, value, dependencies.store);
|
|
11
|
+
return {
|
|
12
|
+
async checkpointResult(result) {
|
|
13
|
+
return await storage.result(result, 'started');
|
|
14
|
+
},
|
|
15
|
+
async complete(result) {
|
|
16
|
+
return await storage.result(result, 'completed');
|
|
17
|
+
},
|
|
18
|
+
id: value.id,
|
|
19
|
+
async interrupt(error) {
|
|
20
|
+
const result = recordedRunResult(createResultFromResolutionError(new RunCollectionError('Run interrupted before completion.', { cause: error }, 'crash'), null));
|
|
21
|
+
const previousResult = storage.current().result;
|
|
22
|
+
const interruptedResult = previousResult === null ? result : {
|
|
23
|
+
...previousResult,
|
|
24
|
+
runnerErrors: [...previousResult.runnerErrors, ...result.runnerErrors],
|
|
25
|
+
status: 'failed'
|
|
26
|
+
};
|
|
27
|
+
await storage.persist({
|
|
28
|
+
...storage.current(),
|
|
29
|
+
result: interruptedResult,
|
|
30
|
+
status: 'interrupted'
|
|
31
|
+
}, 'interrupt');
|
|
32
|
+
},
|
|
33
|
+
path: filePath,
|
|
34
|
+
async recordFacts(facts) {
|
|
35
|
+
await storage.persist({
|
|
36
|
+
...storage.current(),
|
|
37
|
+
facts,
|
|
38
|
+
identities: facts.cases.map(function workIdentity(test) {
|
|
39
|
+
return test.workId;
|
|
40
|
+
})
|
|
41
|
+
}, 'facts');
|
|
42
|
+
},
|
|
43
|
+
async start(coverage) {
|
|
44
|
+
await storage.persist({ ...storage.current(), coverage }, 'start');
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=run-record.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-record.js","sourceRoot":"","sources":["../../../../source/run/run-record.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,+BAA+B,EAAE,MAAM,kCAAkC,CAAC;AACnF,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAG3D,OAAO,EAAE,aAAa,EAA8B,MAAM,uBAAuB,CAAC;AAalF,MAAM,UAAU,sBAAsB,CAClC,GAAW,EACX,KAA0F,EAC1F,YAAmC;IAEnC,MAAM,KAAK,GAAG,aAAa,CAAC,GAAG,EAAE,KAAK,EAAE,YAAY,CAAC,CAAC;IACtD,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,WAAW,EAAE,KAAK,CAAC,MAAM,CAAC,eAAe,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC,EAAE,OAAO,CAAC,CAAC;IAC3G,MAAM,OAAO,GAAG,sBAAsB,CAAC,QAAQ,EAAE,KAAK,EAA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AAC,MAAM,CAAC;gBACvB,CAAC,CAAC;aACL,EAAE,OAAO,CAAC,CAAC;QAChB,CAAC;QACD,KAAK,CAAC,KAAK,CAAC,QAAQ;YAChB,MAAM,OAAO,CAAC,OAAO,CAAC,EAAE,GAAG,OAAO,CAAC,OAAO,EAAE,EAAE,QAAQ,EAAE,EAAE,OAAO,CAAC,CAAC;QACvE,CAAC;KACJ,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { appendRunnerErrors } from "../engine/execution-result.js";
|
|
2
|
+
import { retainedRetryArtifacts } from "./retry-artifact-retention.js";
|
|
3
|
+
export function resultWithRetainedArtifacts(result, artifacts, policy) {
|
|
4
|
+
return {
|
|
5
|
+
...result,
|
|
6
|
+
artifacts: retainedRetryArtifacts([...result.artifacts, ...artifacts], result.perTest, policy)
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
export async function reportResultWithDelivery(result, reporterDelivery) {
|
|
10
|
+
const runEndErrors = await reporterDelivery.reportEvent({ kind: 'run-end', result });
|
|
11
|
+
const resultForFinalReporting = appendRunnerErrors(result, runEndErrors);
|
|
12
|
+
const finalReporterErrors = await reporterDelivery.reportResult(resultForFinalReporting);
|
|
13
|
+
const disposeErrors = await reporterDelivery.disposeReporters();
|
|
14
|
+
return appendRunnerErrors(resultForFinalReporting, [...finalReporterErrors, ...disposeErrors]);
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=run-result-reporting.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-result-reporting.js","sourceRoot":"","sources":["../../../../source/run/run-result-reporting.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAEnE,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAGvE,MAAM,UAAU,2BAA2B,CACvC,MAAiB,EACjB,SAAiC,EACjC,MAA2B;IAE3B,OAAO;QACH,GAAG,MAAM;QACT,SAAS,EAAE,sBAAsB,CAAC,CAAE,GAAG,MAAM,CAAC,SAAS,EAAE,GAAG,SAAS,CAAE,EAAE,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC;KACnG,CAAC;AACN,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,wBAAwB,CAC1C,MAAiB,EACjB,gBAAkC;IAElC,MAAM,YAAY,GAAG,MAAM,gBAAgB,CAAC,WAAW,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC,CAAC;IACrF,MAAM,uBAAuB,GAAG,kBAAkB,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;IACzE,MAAM,mBAAmB,GAAG,MAAM,gBAAgB,CAAC,YAAY,CAAC,uBAAuB,CAAC,CAAC;IACzF,MAAM,aAAa,GAAG,MAAM,gBAAgB,CAAC,gBAAgB,EAAE,CAAC;IAChE,OAAO,kBAAkB,CAAC,uBAAuB,EAAE,CAAE,GAAG,mBAAmB,EAAE,GAAG,aAAa,CAAE,CAAC,CAAC;AACrG,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { finalizeResultWithDurationHistory } from "./run-support.js";
|
|
2
|
+
export async function finalizeSupervisedResult(run, result, execution) {
|
|
3
|
+
const { coverageSession, dependencies, record, timing } = execution;
|
|
4
|
+
const coveredResult = coverageSession === null ? result : await coverageSession.finalize(result);
|
|
5
|
+
const finalResult = await finalizeResultWithDurationHistory(dependencies, run, coveredResult, timing);
|
|
6
|
+
return record === null ? finalResult : await record.checkpointResult(finalResult);
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=run-supervised-finalization.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-supervised-finalization.js","sourceRoot":"","sources":["../../../../source/run/run-supervised-finalization.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,iCAAiC,EAAE,MAAM,kBAAkB,CAAC;AAarE,MAAM,CAAC,KAAK,UAAU,wBAAwB,CAC1C,GAAgB,EAChB,MAAiB,EACjB,SAAiC;IAEjC,MAAM,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC;IACpE,MAAM,aAAa,GAAG,eAAe,KAAK,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,eAAe,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IACjG,MAAM,WAAW,GAAG,MAAM,iCAAiC,CAAC,YAAY,EAAE,GAAG,EAAE,aAAa,EAAE,MAAM,CAAC,CAAC;IACtG,OAAO,MAAM,KAAK,IAAI,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,MAAM,MAAM,CAAC,gBAAgB,CAAC,WAAW,CAAC,CAAC;AACtF,CAAC"}
|
|
@@ -2,7 +2,7 @@ import { createResultFromResolutionError, reportCollectionErrorResult } from "./
|
|
|
2
2
|
import { createResolvedRunFromCollection } from "./run-collected-resolution.js";
|
|
3
3
|
import { readResolvedRunInput } from "./run-input-resolution.js";
|
|
4
4
|
import { assertExpectedDirectEntrypointCollection, createExpectedDirectEntrypointPlan, createSupervisedCollectCommand, createSupervisedRunCommand } from "./run-isolated-command.js";
|
|
5
|
-
import {
|
|
5
|
+
import { finalizeSupervisedResult } from "./run-supervised-finalization.js";
|
|
6
6
|
import { collectSupervisedRun } from "./supervised-run-collection.js";
|
|
7
7
|
import { runSupervisedCommand } from "./supervised-run.js";
|
|
8
8
|
const emptyCollectionTimingMetadata = Object.freeze({
|
|
@@ -44,31 +44,11 @@ export async function createSupervisedResolvedRun(request) {
|
|
|
44
44
|
input
|
|
45
45
|
});
|
|
46
46
|
}
|
|
47
|
-
async function startSupervisedCoverageSession(command, input, timing) {
|
|
48
|
-
if (!command.request.coverage) {
|
|
49
|
-
return null;
|
|
50
|
-
}
|
|
51
|
-
const coverage = await import("./run-coverage.js");
|
|
52
|
-
return await coverage.startCoverageSession({
|
|
53
|
-
coverage: coverage.microtestCoveragePolicy(input.profile),
|
|
54
|
-
processModel: 'supervised-process',
|
|
55
|
-
projectRoot: input.projectRoot,
|
|
56
|
-
runtimeStateDir: input.config.runtimeStateDir,
|
|
57
|
-
testFiles: input.files.map(function testFilePath(file) {
|
|
58
|
-
return file.file;
|
|
59
|
-
}),
|
|
60
|
-
timing
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
async function coveredResult(session, result) {
|
|
64
|
-
const coverage = await import("./run-coverage.js");
|
|
65
|
-
return await session.finalize(result, coverage.coverageExecutionCompleted(result));
|
|
66
|
-
}
|
|
67
47
|
async function runSupervisedExecution(execution) {
|
|
68
|
-
const { command, coverageSession, dependencies, input, source, timing } = execution;
|
|
48
|
+
const { command, coverageSession, dependencies, input, record, source, timing } = execution;
|
|
69
49
|
const expectedDirectPlan = await createExpectedDirectEntrypointPlan(command, dependencies, input, source);
|
|
70
50
|
return await runSupervisedCommand(createSupervisedRunCommand(command, input.profile, input.files, source), dependencies, async function createResolvedRunAfterCollection(collection) {
|
|
71
|
-
|
|
51
|
+
const run = await resolvedSupervisedExecution({
|
|
72
52
|
allowEmptySelection: true,
|
|
73
53
|
collection,
|
|
74
54
|
command,
|
|
@@ -76,26 +56,47 @@ async function runSupervisedExecution(execution) {
|
|
|
76
56
|
expectedDirectPlan,
|
|
77
57
|
input
|
|
78
58
|
});
|
|
59
|
+
await record?.recordFacts(run.facts);
|
|
60
|
+
return run;
|
|
79
61
|
}, {
|
|
80
62
|
coverage: coverageSession?.childProcess ?? null,
|
|
81
63
|
async finalizeResult(resolvedRun, result) {
|
|
82
|
-
|
|
83
|
-
? result
|
|
84
|
-
: await coveredResult(coverageSession, result);
|
|
85
|
-
return await finalizeResultWithDurationHistory(dependencies, resolvedRun, coverageResult, timing);
|
|
64
|
+
return await finalizeSupervisedResult(resolvedRun, result, execution);
|
|
86
65
|
},
|
|
87
66
|
timing
|
|
88
67
|
});
|
|
89
68
|
}
|
|
90
69
|
async function runStartedSupervisedExecution(execution) {
|
|
91
70
|
const { command, dependencies, input, source, timing } = execution;
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
71
|
+
if (!command.request.coverage) {
|
|
72
|
+
return await runSupervisedExecution({
|
|
73
|
+
command,
|
|
74
|
+
coverageSession: null,
|
|
75
|
+
dependencies,
|
|
76
|
+
input,
|
|
77
|
+
record: null,
|
|
78
|
+
source,
|
|
79
|
+
timing
|
|
80
|
+
});
|
|
98
81
|
}
|
|
82
|
+
const { runRecordedCoverage } = await import("./recorded-coverage-run.js");
|
|
83
|
+
return await runRecordedCoverage({
|
|
84
|
+
command,
|
|
85
|
+
dependencies,
|
|
86
|
+
async execute({ record, session }) {
|
|
87
|
+
return await runSupervisedExecution({
|
|
88
|
+
command,
|
|
89
|
+
coverageSession: session,
|
|
90
|
+
dependencies,
|
|
91
|
+
input,
|
|
92
|
+
record,
|
|
93
|
+
source,
|
|
94
|
+
timing
|
|
95
|
+
});
|
|
96
|
+
},
|
|
97
|
+
input,
|
|
98
|
+
timing
|
|
99
|
+
});
|
|
99
100
|
}
|
|
100
101
|
export async function createSupervisedRunResult(command, dependencies, timing, source) {
|
|
101
102
|
const input = await readResolvedRunInput(command, dependencies);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run-supervised-process.js","sourceRoot":"","sources":["../../../../source/run/run-supervised-process.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,+BAA+B,EAC/B,2BAA2B,EAC9B,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,+BAA+B,EAAE,MAAM,+BAA+B,CAAC;AAChF,OAAO,EACH,oBAAoB,EAEvB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACH,wCAAwC,EACxC,kCAAkC,EAClC,8BAA8B,EAC9B,0BAA0B,EAE7B,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"run-supervised-process.js","sourceRoot":"","sources":["../../../../source/run/run-supervised-process.ts"],"names":[],"m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