@overkill-dev/run 0.0.60 → 0.0.62
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/engine/coverage-artifact.d.ts +49 -0
- package/engine/coverage-artifact.d.ts.map +1 -0
- package/engine/execution-options.d.ts +4 -1
- package/engine/execution-options.d.ts.map +1 -1
- package/engine/execution-options.js.map +1 -1
- package/engine/execution-supervision-state.d.ts +30 -0
- package/engine/execution-supervision-state.d.ts.map +1 -0
- package/engine/execution-supervision-state.js +25 -0
- package/engine/execution-supervision-state.js.map +1 -0
- package/engine/execution-supervision.d.ts +5 -25
- package/engine/execution-supervision.d.ts.map +1 -1
- package/engine/execution-supervision.js +9 -19
- package/engine/execution-supervision.js.map +1 -1
- package/engine/execution-test-plan-cases.js +108 -71
- package/engine/execution-test-plan-cases.js.map +1 -1
- package/engine/identity.d.ts +2 -0
- package/engine/identity.d.ts.map +1 -1
- package/engine/identity.js +2 -1
- package/engine/identity.js.map +1 -1
- package/engine/reporter-event-queue.js +1 -1
- package/engine/reporter-event-queue.js.map +1 -1
- package/engine/run-result.d.ts +17 -5
- package/engine/run-result.d.ts.map +1 -1
- package/engine/run-result.js.map +1 -1
- package/engine/run-timings.d.ts +1 -1
- package/engine/run-timings.d.ts.map +1 -1
- package/engine/run-timings.js +3 -0
- package/engine/run-timings.js.map +1 -1
- package/engine/test-plan.d.ts +1 -1
- package/engine/test-plan.d.ts.map +1 -1
- package/package.json +11 -3
- package/packages/engine/engine.entry-point.d.ts +3 -2
- package/packages/engine/engine.entry-point.d.ts.map +1 -1
- package/packages/engine/engine.entry-point.js.map +1 -1
- package/packages/run/config.entry-point.d.ts +3 -2
- package/packages/run/config.entry-point.d.ts.map +1 -1
- package/packages/run/config.entry-point.js +2 -1
- package/packages/run/config.entry-point.js.map +1 -1
- package/packages/run/filters.entry-point.d.ts +2 -2
- package/packages/run/filters.entry-point.d.ts.map +1 -1
- package/packages/run/filters.entry-point.js +1 -1
- package/packages/run/filters.entry-point.js.map +1 -1
- package/packages/run/run.entry-point.d.ts +5 -3
- package/packages/run/run.entry-point.d.ts.map +1 -1
- package/packages/run/run.entry-point.js +2 -8
- package/packages/run/run.entry-point.js.map +1 -1
- package/readme.md +28 -5
- package/reporters/human-reporter-rendering.js +16 -1
- package/reporters/human-reporter-rendering.js.map +1 -1
- package/reporters/line-reporter.js +4 -1
- package/reporters/line-reporter.js.map +1 -1
- package/reporters/run-summary-rendering.js +23 -0
- package/reporters/run-summary-rendering.js.map +1 -1
- package/resources/resources.d.ts +1 -0
- package/resources/resources.d.ts.map +1 -1
- package/resources/resources.js.map +1 -1
- package/resources/runtime-definition.d.ts +2 -0
- package/resources/runtime-definition.d.ts.map +1 -1
- package/resources/runtime-definition.js +1 -0
- package/resources/runtime-definition.js.map +1 -1
- package/run/collected-run-plan.js +13 -0
- package/run/collected-run-plan.js.map +1 -1
- package/run/command-line-command.d.ts +1 -1
- package/run/command-line-command.d.ts.map +1 -1
- package/run/command-line-command.js +1 -2
- package/run/command-line-command.js.map +1 -1
- package/run/command-line-runner.d.ts.map +1 -1
- package/run/command-line-runner.js +2 -0
- package/run/command-line-runner.js.map +1 -1
- package/run/coverage-config-schema.d.ts +50 -0
- package/run/coverage-config-schema.d.ts.map +1 -0
- package/run/coverage-config-schema.js +36 -0
- package/run/coverage-config-schema.js.map +1 -0
- package/run/coverage-paths.js +5 -0
- package/run/coverage-paths.js.map +1 -0
- package/run/coverage-reporting.js +191 -0
- package/run/coverage-reporting.js.map +1 -0
- package/run/coverage-session.js +7 -0
- package/run/coverage-session.js.map +1 -0
- package/run/current-process-run-orchestrator.d.ts +2 -1
- package/run/current-process-run-orchestrator.d.ts.map +1 -1
- package/run/current-process-run-orchestrator.js +30 -1
- package/run/current-process-run-orchestrator.js.map +1 -1
- package/run/direct-entrypoint-collection.js +27 -0
- package/run/direct-entrypoint-collection.js.map +1 -0
- package/run/duration-history-schema.d.ts +251 -0
- package/run/duration-history-schema.d.ts.map +1 -0
- package/run/duration-history-schema.js +121 -0
- package/run/duration-history-schema.js.map +1 -0
- package/run/duration-history.d.ts +2 -2
- package/run/duration-history.d.ts.map +1 -1
- package/run/duration-history.js +3 -82
- package/run/duration-history.js.map +1 -1
- package/run/path-containment.js +2 -0
- package/run/path-containment.js.map +1 -0
- package/run/profile-config-normalization.js +136 -0
- package/run/profile-config-normalization.js.map +1 -0
- package/run/profile-file-glob.js +18 -0
- package/run/profile-file-glob.js.map +1 -1
- package/run/resource-lifecycle-boundaries.js +20 -5
- package/run/resource-lifecycle-boundaries.js.map +1 -1
- package/run/resource-lifecycle-cache-identity.js +4 -0
- package/run/resource-lifecycle-cache-identity.js.map +1 -1
- package/run/resource-lifecycle-composition.d.ts +1 -1
- package/run/resource-lifecycle-composition.d.ts.map +1 -1
- package/run/resource-lifecycle-composition.js +4 -4
- package/run/resource-lifecycle-composition.js.map +1 -1
- package/run/run-collected-planning.js +1 -1
- package/run/run-collected-planning.js.map +1 -1
- package/run/run-collection-source-types.d.ts +12 -0
- package/run/run-collection-source-types.d.ts.map +1 -0
- package/run/run-collection-source.d.ts +9 -0
- package/run/run-collection-source.d.ts.map +1 -0
- package/run/run-collection-source.js +9 -0
- package/run/run-collection-source.js.map +1 -0
- package/run/run-config-defaults.js +26 -4
- package/run/run-config-defaults.js.map +1 -1
- package/run/run-config-schema.d.ts +63 -0
- package/run/run-config-schema.d.ts.map +1 -1
- package/run/run-config-schema.js +7 -0
- package/run/run-config-schema.js.map +1 -1
- package/run/run-config.d.ts +7 -5
- package/run/run-config.d.ts.map +1 -1
- package/run/run-config.js +14 -95
- package/run/run-config.js.map +1 -1
- package/run/run-coverage.js +47 -0
- package/run/run-coverage.js.map +1 -0
- package/run/run-discovery.js +1 -2
- package/run/run-discovery.js.map +1 -1
- package/run/run-empty-shard.js +3 -4
- package/run/run-empty-shard.js.map +1 -1
- package/run/run-engine-selection.d.ts +1 -1
- package/run/run-engine-selection.d.ts.map +1 -1
- package/run/run-errors.d.ts +3 -0
- package/run/run-errors.d.ts.map +1 -1
- package/run/run-errors.js +6 -0
- package/run/run-errors.js.map +1 -1
- package/run/run-execution-config.d.ts +28 -0
- package/run/run-execution-config.d.ts.map +1 -0
- package/run/run-facts.js +2 -0
- package/run/run-facts.js.map +1 -1
- package/run/run-filter-grammar.d.ts +1 -1
- package/run/run-filter-grammar.d.ts.map +1 -1
- package/run/run-if-main-options.d.ts +0 -5
- package/run/run-if-main-options.d.ts.map +1 -1
- package/run/run-if-main-options.js +0 -16
- package/run/run-if-main-options.js.map +1 -1
- package/run/run-if-main-profile.d.ts +1 -1
- package/run/run-if-main-profile.d.ts.map +1 -1
- package/run/run-if-main-profile.js +1 -11
- package/run/run-if-main-profile.js.map +1 -1
- package/run/run-if-main.d.ts +2 -10
- package/run/run-if-main.d.ts.map +1 -1
- package/run/run-if-main.js +56 -62
- package/run/run-if-main.js.map +1 -1
- package/run/run-in-process-execution.js +3 -3
- package/run/run-in-process-execution.js.map +1 -1
- package/run/run-input-resolution.js +11 -2
- package/run/run-input-resolution.js.map +1 -1
- package/run/run-isolated-command.js +46 -20
- package/run/run-isolated-command.js.map +1 -1
- package/run/run-isolated-process.js +68 -101
- package/run/run-isolated-process.js.map +1 -1
- package/run/run-local-command.js +132 -0
- package/run/run-local-command.js.map +1 -0
- package/run/run-local-execution.js +7 -10
- package/run/run-local-execution.js.map +1 -1
- package/run/run-local-resolution.js +10 -5
- package/run/run-local-resolution.js.map +1 -1
- package/run/run-local-test-plan.js +6 -1
- package/run/run-local-test-plan.js.map +1 -1
- package/run/run-orchestrator.d.ts +6 -0
- package/run/run-orchestrator.d.ts.map +1 -1
- package/run/run-orchestrator.entry-point.d.ts +1 -2
- package/run/run-orchestrator.entry-point.d.ts.map +1 -1
- package/run/run-orchestrator.entry-point.js +4 -4
- package/run/run-orchestrator.entry-point.js.map +1 -1
- package/run/run-orchestrator.js +11 -4
- package/run/run-orchestrator.js.map +1 -1
- package/run/run-ordering.js +36 -0
- package/run/run-ordering.js.map +1 -0
- package/run/run-request-types.d.ts +89 -0
- package/run/run-request-types.d.ts.map +1 -0
- package/run/run-selection-filters.d.ts +7 -2
- package/run/run-selection-filters.d.ts.map +1 -1
- package/run/run-selection-filters.js +114 -15
- package/run/run-selection-filters.js.map +1 -1
- package/run/run-selection.js +10 -50
- package/run/run-selection.js.map +1 -1
- package/run/run-supervised-process.js +109 -0
- package/run/run-supervised-process.js.map +1 -0
- package/run/run-support.js +28 -0
- package/run/run-support.js.map +1 -1
- package/run/run-test-plan.js +13 -5
- package/run/run-test-plan.js.map +1 -1
- package/run/run-types.d.ts +33 -96
- package/run/run-types.d.ts.map +1 -1
- package/run/run-types.js +0 -18
- package/run/run-types.js.map +1 -1
- package/run/run-validation.js +1 -1
- package/run/run-validation.js.map +1 -1
- package/run/run.d.ts +10 -0
- package/run/run.d.ts.map +1 -0
- package/run/run.js +27 -54
- package/run/run.js.map +1 -1
- package/run/runtime-matrix-expansion.js +7 -0
- package/run/runtime-matrix-expansion.js.map +1 -1
- package/run/supervised-child-process.d.ts +24 -2
- package/run/supervised-child-process.d.ts.map +1 -1
- package/run/supervised-child-process.js +40 -1
- package/run/supervised-child-process.js.map +1 -1
- package/run/supervised-child-test-plan.js +1 -0
- package/run/supervised-child-test-plan.js.map +1 -1
- package/run/supervised-child.js +2 -5
- package/run/supervised-child.js.map +1 -1
- package/run/supervised-protocol.js +2 -7
- package/run/supervised-protocol.js.map +1 -1
- package/run/supervised-run-collection.js +2 -0
- package/run/supervised-run-collection.js.map +1 -1
- package/run/supervised-run-runtime.js +4 -105
- package/run/supervised-run-runtime.js.map +1 -1
- package/run/supervised-run-state.d.ts +4 -0
- package/run/supervised-run-state.d.ts.map +1 -1
- package/run/supervised-run-state.js +22 -0
- package/run/supervised-run-state.js.map +1 -1
- package/run/supervised-run.js +11 -79
- package/run/supervised-run.js.map +1 -1
- package/run/work-distribution-config.js +1 -1
- package/run/work-distribution-config.js.map +1 -1
- package/run/work-unit-planning.js +1 -1
- package/run/work-unit-planning.js.map +1 -1
- package/run/worker-pool-command.js +3 -0
- package/run/worker-pool-command.js.map +1 -1
- package/run/worker-pool-hedged-arbitration.js +3 -1
- package/run/worker-pool-hedged-arbitration.js.map +1 -1
- package/run/worker-pool-protocol.js.map +1 -1
- package/run/worker-pool-task-events.js +7 -5
- 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.js +2 -5
- package/run/worker-pool-worker.js.map +1 -1
- package/sbom.cdx.json +72 -4
- package/run/default-run-engine.d.ts +0 -3
- package/run/default-run-engine.d.ts.map +0 -1
- package/run/direct-runtime-policy.js +0 -24
- package/run/direct-runtime-policy.js.map +0 -1
- package/run/resource-usage.d.ts +0 -17
- package/run/resource-usage.d.ts.map +0 -1
- package/run/run-if-main-facts.js +0 -95
- package/run/run-if-main-facts.js.map +0 -1
package/run/run-if-main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run-if-main.js","sourceRoot":"","sources":["../../../../source/run/run-if-main.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"run-if-main.js","sourceRoot":"","sources":["../../../../source/run/run-if-main.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,4BAA4B,EAAE,MAAM,2BAA2B,CAAC;AAEzE,OAAO,EACH,eAAe,EACf,YAAY,EACZ,SAAS,EACT,sBAAsB,EACtB,iBAAiB,EAEpB,MAAM,0BAA0B,CAAC;AA4BlC,MAAM,gBAAgB,GAAG,IAAI,GAAG,CAAqC,CAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,GAAG,CAAE,CAAC,CAAC;AAElG,SAAS,wBAAwB,CAAC,QAA2B;IACzD,OAAO,gBAAgB,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1C,CAAC;AAED,SAAS,gBAAgB,CAAC,OAAyB;IAC/C,OAAO;QACH,kBAAkB,EAAE,MAAM;QAC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F,YAAY,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;IAChC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,YAAmC;IAC/D,OAAO,KAAK,UAAU,SAAS,CAAC,IAAI,EAAE,QAAQ,EAAE,OAAO;QACnD,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;YACb,OAAO;QACX,CAAC;QAED,MAAM,OAAO,GAAG,MAAM,YAAY,CAAC,oBAAoB,CAAC,IAAI,EAAE,YAAY,CAAC,uBAAuB,EAAE,CAAC,CAAC;QAEtG,MAAM,gBAAgB,CAAC,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,YAAY,CAAC,CAAC;IAC5E,CAAC,CAAC;AACN,CAAC"}
|
|
@@ -3,13 +3,13 @@ import { executeLocalResolvedRun } from "./run-local-execution.js";
|
|
|
3
3
|
function isLocalResolvedRun(resolvedRun) {
|
|
4
4
|
return resolvedRun.plan.kind === 'local';
|
|
5
5
|
}
|
|
6
|
-
export async function executeInProcessResolvedRun(resolvedRun, dependencies,
|
|
6
|
+
export async function executeInProcessResolvedRun(resolvedRun, dependencies, options) {
|
|
7
7
|
if (resolvedRun.plan.kind === 'empty-shard') {
|
|
8
|
-
return await executeEmptyShardRun(resolvedRun, dependencies,
|
|
8
|
+
return await executeEmptyShardRun(resolvedRun, dependencies, options.finalizeResult, options.runtimePolicy);
|
|
9
9
|
}
|
|
10
10
|
if (!isLocalResolvedRun(resolvedRun)) {
|
|
11
11
|
throw new Error('In-process execution requires a local test plan.');
|
|
12
12
|
}
|
|
13
|
-
return await executeLocalResolvedRun(resolvedRun, dependencies,
|
|
13
|
+
return await executeLocalResolvedRun(resolvedRun, dependencies, options);
|
|
14
14
|
}
|
|
15
15
|
//# sourceMappingURL=run-in-process-execution.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run-in-process-execution.js","sourceRoot":"","sources":["../../../../source/run/run-in-process-execution.ts"],"names":[],"mappings":"AACA,OAAO,EACH,oBAAoB,EACvB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACH,uBAAuB,
|
|
1
|
+
{"version":3,"file":"run-in-process-execution.js","sourceRoot":"","sources":["../../../../source/run/run-in-process-execution.ts"],"names":[],"mappings":"AACA,OAAO,EACH,oBAAoB,EACvB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACH,uBAAuB,EAE1B,MAAM,0BAA0B,CAAC;AAelC,SAAS,kBAAkB,CAAC,WAAwB;IAChD,OAAO,WAAW,CAAC,IAAI,CAAC,IAAI,KAAK,OAAO,CAAC;AAC7C,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,2BAA2B,CAC7C,WAAwB,EACxB,YAAyC,EACzC,OAA8B;IAE9B,IAAI,WAAW,CAAC,IAAI,CAAC,IAAI,KAAK,aAAa,EAAE,CAAC;QAC1C,OAAO,MAAM,oBAAoB,CAC7B,WAAW,EACX,YAAY,EACZ,OAAO,CAAC,cAAc,EACtB,OAAO,CAAC,aAAa,CACxB,CAAC;IACN,CAAC;IAED,IAAI,CAAC,kBAAkB,CAAC,WAAW,CAAC,EAAE,CAAC;QACnC,MAAM,IAAI,KAAK,CAAC,kDAAkD,CAAC,CAAC;IACxE,CAAC;IAED,OAAO,MAAM,uBAAuB,CAAC,WAAW,EAAE,YAAY,EAAE,OAAO,CAAC,CAAC;AAC7E,CAAC"}
|
|
@@ -12,13 +12,22 @@ function assertWorkerCountSupported(request, profile) {
|
|
|
12
12
|
invalidRequest('Worker count can only be requested for worker-pool profiles.');
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
|
+
function assertCoverageSupported(request, profile) {
|
|
16
|
+
if (request.coverage && profile.testFamily !== 'microtest') {
|
|
17
|
+
invalidRequest('Coverage can only be requested for microtest profiles.');
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
function assertProfileRequestSupported(request, profile) {
|
|
21
|
+
assertCoverageSupported(request, profile);
|
|
22
|
+
assertMicrotestCaptureSupported(request, profile);
|
|
23
|
+
assertWorkerCountSupported(request, profile);
|
|
24
|
+
}
|
|
15
25
|
export async function readResolvedRunInput(command, dependencies) {
|
|
16
26
|
validateRunInput(command);
|
|
17
27
|
const request = freezeValue(copyRunRequest(command.request));
|
|
18
28
|
const config = freezeValue(copyRunConfig(command.config));
|
|
19
29
|
const profile = selectedProfile(request, config);
|
|
20
|
-
|
|
21
|
-
assertWorkerCountSupported(request, profile);
|
|
30
|
+
assertProfileRequestSupported(request, profile);
|
|
22
31
|
assertSupportedProcessEngine(command, profile);
|
|
23
32
|
const discovery = freezeValue(await dependencies.discoverRunFilesWithProjectRoot({
|
|
24
33
|
cwd: command.cwd,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run-input-resolution.js","sourceRoot":"","sources":["../../../../source/run/run-input-resolution.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EACH,sBAAsB,EACtB,aAAa,EACb,cAAc,EACd,WAAW,EACd,MAAM,kBAAkB,CAAC;AAQ1B,OAAO,EACH,4BAA4B,EAC5B,gBAAgB,EACnB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAWjD,SAAS,+BAA+B,CACpC,OAAmB,EACnB,OAAyB;IAEzB,IAAI,OAAO,CAAC,UAAU,KAAK,WAAW,IAAI,OAAO,CAAC,OAAO,KAAK,MAAM,EAAE,CAAC;QACnE,cAAc,CAAC,iDAAiD,CAAC,CAAC;IACtE,CAAC;AACL,CAAC;AAED,SAAS,0BAA0B,CAAC,OAAmB,EAAE,OAAyB;IAC9E,IAAI,OAAO,CAAC,OAAO,KAAK,IAAI,IAAI,OAAO,CAAC,SAAS,CAAC,YAAY,KAAK,aAAa,EAAE,CAAC;QAC/E,cAAc,CAAC,8DAA8D,CAAC,CAAC;IACnF,CAAC;AACL,CAAC;AAED,MAAM,CAAC,KAAK,UAA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
+
import { createLocalTestPlan } from "./run-local-test-plan.js";
|
|
1
3
|
import { resolveResourceUsagePolicy } from "./run-facts.js";
|
|
4
|
+
import { runCollectionRoot } from "./run-collection-source.js";
|
|
2
5
|
function isolatedEngine(command) {
|
|
3
6
|
if (command.engine.kind === 'instance') {
|
|
4
7
|
throw new Error('Instance engines cannot run in supervised children.');
|
|
5
8
|
}
|
|
6
9
|
return command.engine;
|
|
7
10
|
}
|
|
11
|
+
export async function createExpectedDirectEntrypointPlan(command, dependencies, input, source) {
|
|
12
|
+
return source.kind === 'direct-entrypoint'
|
|
13
|
+
? await createLocalTestPlan({
|
|
14
|
+
command,
|
|
15
|
+
definitionLocationCapture: 'enabled',
|
|
16
|
+
dependencies,
|
|
17
|
+
files: input.files,
|
|
18
|
+
profile: input.profile,
|
|
19
|
+
source
|
|
20
|
+
})
|
|
21
|
+
: null;
|
|
22
|
+
}
|
|
23
|
+
export function assertExpectedDirectEntrypointCollection(expected, actual) {
|
|
24
|
+
if (expected !== null) {
|
|
25
|
+
assertDirectEntrypointCollectionMatches(expected, actual);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
8
28
|
function supervisedCapabilityRestrictions(profile, command) {
|
|
9
29
|
if (profile.testFamily === 'integration') {
|
|
10
30
|
return { mode: 'disabled' };
|
|
@@ -26,57 +46,63 @@ function createSupervisedCommandBase(input) {
|
|
|
26
46
|
definitionLocationCapture: input.definitionLocationCapture,
|
|
27
47
|
engine: isolatedEngine(input.command),
|
|
28
48
|
hardTimeoutMilliseconds: input.profile.timeouts.hardMilliseconds,
|
|
49
|
+
maxConcurrency: input.profile.execution.maxConcurrency,
|
|
29
50
|
paths: resolvedPaths(input.files),
|
|
30
51
|
resourceBudgets: resourceUsagePolicy.budgets,
|
|
31
52
|
resourceUsageSamplingIntervalMilliseconds: resourceUsagePolicy.samplingIntervalMilliseconds,
|
|
53
|
+
root: runCollectionRoot(input.source, input.command.cwd),
|
|
32
54
|
scheduling: input.profile.execution.scheduling,
|
|
33
55
|
testFamily: input.profile.testFamily,
|
|
34
56
|
timeoutMilliseconds: input.profile.timeouts.softMilliseconds
|
|
35
57
|
};
|
|
36
58
|
}
|
|
37
|
-
export function createSupervisedCollectCommand(command, profile, files) {
|
|
59
|
+
export function createSupervisedCollectCommand(command, profile, files, source) {
|
|
38
60
|
return {
|
|
39
61
|
...createSupervisedCommandBase({
|
|
40
62
|
capture: 'buffered',
|
|
41
63
|
command,
|
|
42
64
|
definitionLocationCapture: 'enabled',
|
|
43
65
|
files,
|
|
44
|
-
profile
|
|
66
|
+
profile,
|
|
67
|
+
source
|
|
45
68
|
}),
|
|
46
69
|
kind: 'collect'
|
|
47
70
|
};
|
|
48
71
|
}
|
|
49
|
-
export function createSupervisedRunCommand(command, profile, files) {
|
|
72
|
+
export function createSupervisedRunCommand(command, profile, files, source) {
|
|
50
73
|
return {
|
|
51
74
|
...createSupervisedCommandBase({
|
|
52
75
|
capture: command.request.capture,
|
|
53
76
|
command,
|
|
54
|
-
definitionLocationCapture: 'disabled',
|
|
77
|
+
definitionLocationCapture: source.kind === 'direct-entrypoint' ? 'enabled' : 'disabled',
|
|
55
78
|
files,
|
|
56
|
-
profile
|
|
79
|
+
profile,
|
|
80
|
+
source
|
|
57
81
|
}),
|
|
58
82
|
kind: 'run'
|
|
59
83
|
};
|
|
60
84
|
}
|
|
61
|
-
export function createWorkerPoolCommand(
|
|
62
|
-
const resourceUsagePolicy = resolveResourceUsagePolicy(command.request, profile);
|
|
85
|
+
export function createWorkerPoolCommand(input) {
|
|
86
|
+
const resourceUsagePolicy = resolveResourceUsagePolicy(input.command.request, input.profile);
|
|
63
87
|
return {
|
|
64
|
-
collectionTimeoutMilliseconds: profile.timeouts.collectionMilliseconds,
|
|
65
|
-
cwd: command.cwd,
|
|
66
|
-
definitionLocationCapture,
|
|
67
|
-
engine: isolatedEngine(command),
|
|
68
|
-
hardTimeoutMilliseconds: profile.timeouts.hardMilliseconds,
|
|
69
|
-
hostProcess: profile.execution.processModel === 'worker-pool'
|
|
70
|
-
? profile.execution.hostProcess
|
|
88
|
+
collectionTimeoutMilliseconds: input.profile.timeouts.collectionMilliseconds,
|
|
89
|
+
cwd: input.command.cwd,
|
|
90
|
+
definitionLocationCapture: input.definitionLocationCapture,
|
|
91
|
+
engine: isolatedEngine(input.command),
|
|
92
|
+
hardTimeoutMilliseconds: input.profile.timeouts.hardMilliseconds,
|
|
93
|
+
hostProcess: input.profile.execution.processModel === 'worker-pool'
|
|
94
|
+
? input.profile.execution.hostProcess
|
|
71
95
|
: { kind: 'direct' },
|
|
72
|
-
|
|
96
|
+
maxConcurrency: input.profile.execution.maxConcurrency,
|
|
97
|
+
paths: resolvedPaths(input.files),
|
|
73
98
|
resourceBudgets: resourceUsagePolicy.budgets,
|
|
74
99
|
resourceUsageSamplingIntervalMilliseconds: resourceUsagePolicy.samplingIntervalMilliseconds,
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
100
|
+
root: runCollectionRoot(input.source, input.command.cwd),
|
|
101
|
+
scheduling: input.profile.execution.scheduling,
|
|
102
|
+
testFamily: input.profile.testFamily,
|
|
103
|
+
timeoutMilliseconds: input.profile.timeouts.softMilliseconds,
|
|
104
|
+
workerLifecycle: input.profile.execution.processModel === 'worker-pool'
|
|
105
|
+
? input.profile.execution.workerLifecycle
|
|
80
106
|
: 'reuse'
|
|
81
107
|
};
|
|
82
108
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run-isolated-command.js","sourceRoot":"","sources":["../../../../source/run/run-isolated-command.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,0BAA0B,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"run-isolated-command.js","sourceRoot":"","sources":["../../../../source/run/run-isolated-command.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,uCAAuC,EAAE,MAAM,mCAAmC,CAAC;AAC5F,OAAO,EAAE,mBAAmB,EAAsB,MAAM,0BAA0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5C,yCAAyC,EAAE,mBAAmB,CAAC,4BAA4B;QAC3F,IAAI,EAAE,iBAAiB,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC;QACxD,UAAU,EAAE,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,UAAU;QAC9C,UAAU,EAAE,KAAK,CAAC,OAAO,CAAC,UAAU;QACpC,mBAAmB,EAAE,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,gBAAgB;QAC5D,eAAe,EAAE,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,YAAY,KAAK,aAAa;YACnE,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,eAAe;YACzC,CAAC,CAAC,OAAO;KAChB,CAAC;AACN,CAAC"}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { createResultFromResolutionError, reportCollectionErrorResult } from "./run-collection-error-result.js";
|
|
2
2
|
import { createResolvedRunFromCollection } from "./run-collected-resolution.js";
|
|
3
3
|
import { readResolvedRunInput } from "./run-input-resolution.js";
|
|
4
|
-
import {
|
|
4
|
+
import { assertExpectedDirectEntrypointCollection, createExpectedDirectEntrypointPlan, createWorkerPoolCommand } from "./run-isolated-command.js";
|
|
5
5
|
import { finalizeResultWithDurationHistory, readRunDurationHistory } from "./run-support.js";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { collectWorkerPoolRun, executeWorkerPoolRun, runWorkerPoolCommand } from "./worker-pool-run.js";
|
|
6
|
+
import { collectWorkerPoolRun, runWorkerPoolCommand } from "./worker-pool-run.js";
|
|
7
|
+
import { createSupervisedResolvedRun, createSupervisedRunResult } from "./run-supervised-process.js";
|
|
9
8
|
const emptyCollectionTimingMetadata = Object.freeze({
|
|
10
9
|
label: null,
|
|
11
10
|
processId: null,
|
|
@@ -13,6 +12,9 @@ const emptyCollectionTimingMetadata = Object.freeze({
|
|
|
13
12
|
workerId: null
|
|
14
13
|
});
|
|
15
14
|
async function createResolvedExecutionRun(resolution) {
|
|
15
|
+
if (resolution.expectedDirectPlan !== null) {
|
|
16
|
+
assertExpectedDirectEntrypointCollection(resolution.expectedDirectPlan, resolution.collection.collectedPlan);
|
|
17
|
+
}
|
|
16
18
|
return await createResolvedRunFromCollection({
|
|
17
19
|
allowEmptySelection: resolution.allowEmptySelection,
|
|
18
20
|
collection: resolution.collection,
|
|
@@ -36,10 +38,25 @@ async function readWorkerPoolDurationHistory(input, dependencies) {
|
|
|
36
38
|
}
|
|
37
39
|
return await readRunDurationHistory(dependencies, input.projectRoot, input.config.runtimeStateDir);
|
|
38
40
|
}
|
|
39
|
-
async function createWorkerPoolResolvedRun(command, dependencies, input,
|
|
40
|
-
const
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
async function createWorkerPoolResolvedRun(command, dependencies, input, options) {
|
|
42
|
+
const expected = options.source.kind === 'direct-entrypoint'
|
|
43
|
+
? await createExpectedDirectEntrypointPlan(command, dependencies, input, options.source)
|
|
44
|
+
: null;
|
|
45
|
+
const collection = await (options.timing?.measureAsync('collection.import', emptyCollectionTimingMetadata, async function collectTimedWorkerPoolRun() {
|
|
46
|
+
return await collectWorkerPoolRun(createWorkerPoolCommand({
|
|
47
|
+
command,
|
|
48
|
+
definitionLocationCapture: 'enabled',
|
|
49
|
+
files: input.files,
|
|
50
|
+
profile: input.profile,
|
|
51
|
+
source: options.source
|
|
52
|
+
}), dependencies, options.timing);
|
|
53
|
+
}) ?? collectWorkerPoolRun(createWorkerPoolCommand({
|
|
54
|
+
command,
|
|
55
|
+
definitionLocationCapture: 'enabled',
|
|
56
|
+
files: input.files,
|
|
57
|
+
profile: input.profile,
|
|
58
|
+
source: options.source
|
|
59
|
+
}), dependencies, null));
|
|
43
60
|
const durationHistoryIndex = await readWorkerPoolDurationHistory(input, dependencies);
|
|
44
61
|
return await createResolvedExecutionRun({
|
|
45
62
|
allowEmptySelection: false,
|
|
@@ -47,125 +64,75 @@ async function createWorkerPoolResolvedRun(command, dependencies, input, timing)
|
|
|
47
64
|
command,
|
|
48
65
|
dependencies,
|
|
49
66
|
durationHistoryIndex,
|
|
67
|
+
expectedDirectPlan: expected,
|
|
50
68
|
input,
|
|
51
69
|
planKind: 'worker-pool'
|
|
52
70
|
});
|
|
53
71
|
}
|
|
54
|
-
|
|
55
|
-
const collection = await (timing?.measureAsync('collection.import', emptyCollectionTimingMetadata, async function collectTimedSupervisedRun() {
|
|
56
|
-
return await collectSupervisedRun(createSupervisedCollectCommand(command, input.profile, input.files), dependencies, timing);
|
|
57
|
-
}) ?? collectSupervisedRun(createSupervisedCollectCommand(command, input.profile, input.files), dependencies, null));
|
|
58
|
-
return await createResolvedExecutionRun({
|
|
59
|
-
allowEmptySelection: false,
|
|
60
|
-
collection,
|
|
61
|
-
command,
|
|
62
|
-
dependencies,
|
|
63
|
-
durationHistoryIndex: null,
|
|
64
|
-
input,
|
|
65
|
-
planKind: 'supervised'
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
export function createIsolatedResolvedRun(command, dependencies, input, timing = null) {
|
|
72
|
+
export function createIsolatedResolvedRun(command, dependencies, input, options) {
|
|
69
73
|
if (input.profile.execution.processModel === 'supervised-process') {
|
|
70
|
-
return createSupervisedResolvedRun(
|
|
74
|
+
return createSupervisedResolvedRun({
|
|
75
|
+
command,
|
|
76
|
+
dependencies,
|
|
77
|
+
input,
|
|
78
|
+
source: options.source,
|
|
79
|
+
timing: options.timing
|
|
80
|
+
});
|
|
71
81
|
}
|
|
72
82
|
if (input.profile.execution.processModel === 'worker-pool') {
|
|
73
|
-
return createWorkerPoolResolvedRun(command, dependencies, input,
|
|
83
|
+
return createWorkerPoolResolvedRun(command, dependencies, input, options);
|
|
74
84
|
}
|
|
75
85
|
return null;
|
|
76
86
|
}
|
|
77
|
-
function
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
durationHistoryIndex: null,
|
|
100
|
-
input,
|
|
101
|
-
planKind: 'supervised'
|
|
102
|
-
});
|
|
103
|
-
}, {
|
|
104
|
-
async finalizeResult(resolvedRun, result) {
|
|
105
|
-
return await finalizeResultWithDurationHistory(dependencies, resolvedRun, result, timing);
|
|
106
|
-
},
|
|
107
|
-
timing
|
|
87
|
+
async function executeWorkerPoolRunResult(options) {
|
|
88
|
+
const { command, dependencies, input, source, timing } = options;
|
|
89
|
+
const expected = source.kind === 'direct-entrypoint'
|
|
90
|
+
? await createExpectedDirectEntrypointPlan(command, dependencies, input, source)
|
|
91
|
+
: null;
|
|
92
|
+
const durationHistoryIndex = await readWorkerPoolDurationHistory(input, dependencies);
|
|
93
|
+
return await runWorkerPoolCommand(createWorkerPoolCommand({
|
|
94
|
+
command,
|
|
95
|
+
definitionLocationCapture: source.kind === 'direct-entrypoint' ? 'enabled' : 'disabled',
|
|
96
|
+
files: input.files,
|
|
97
|
+
profile: input.profile,
|
|
98
|
+
source
|
|
99
|
+
}), dependencies, async function createResolvedRunAfterCollection(collection) {
|
|
100
|
+
return await createResolvedExecutionRun({
|
|
101
|
+
allowEmptySelection: true,
|
|
102
|
+
collection,
|
|
103
|
+
command,
|
|
104
|
+
dependencies,
|
|
105
|
+
durationHistoryIndex,
|
|
106
|
+
expectedDirectPlan: expected,
|
|
107
|
+
input,
|
|
108
|
+
planKind: 'worker-pool'
|
|
108
109
|
});
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
110
|
+
}, {
|
|
111
|
+
async finalizeResult(resolvedRun, completion) {
|
|
112
|
+
return await finalizeResultWithDurationHistory(dependencies, resolvedRun, completion.result, timing);
|
|
113
|
+
},
|
|
114
|
+
timing
|
|
115
|
+
});
|
|
113
116
|
}
|
|
114
|
-
async function createWorkerPoolRunResult(command, dependencies, timing) {
|
|
117
|
+
async function createWorkerPoolRunResult(command, dependencies, timing, source) {
|
|
115
118
|
const input = await readResolvedRunInput(command, dependencies);
|
|
116
119
|
if (input.profile.execution.processModel !== 'worker-pool') {
|
|
117
120
|
throw new Error('Expected worker-pool profile.');
|
|
118
121
|
}
|
|
119
122
|
try {
|
|
120
|
-
|
|
121
|
-
return await runWorkerPoolCommand(createWorkerPoolCommand(command, 'disabled', input.profile, input.files), dependencies, async function createResolvedRunAfterCollection(collection) {
|
|
122
|
-
return await createResolvedExecutionRun({
|
|
123
|
-
allowEmptySelection: true,
|
|
124
|
-
collection,
|
|
125
|
-
command,
|
|
126
|
-
dependencies,
|
|
127
|
-
durationHistoryIndex,
|
|
128
|
-
input,
|
|
129
|
-
planKind: 'worker-pool'
|
|
130
|
-
});
|
|
131
|
-
}, {
|
|
132
|
-
async finalizeResult(resolvedRun, completion) {
|
|
133
|
-
return await finalizeResultWithDurationHistory(dependencies, resolvedRun, completion.result, timing);
|
|
134
|
-
},
|
|
135
|
-
timing
|
|
136
|
-
});
|
|
123
|
+
return await executeWorkerPoolRunResult({ command, dependencies, input, source, timing });
|
|
137
124
|
}
|
|
138
125
|
catch (error) {
|
|
139
126
|
return await reportCollectionErrorResult(command, dependencies, createResultFromResolutionError(error, null), timing);
|
|
140
127
|
}
|
|
141
128
|
}
|
|
142
|
-
export function runIsolatedProcessCommand(command, dependencies,
|
|
129
|
+
export function runIsolatedProcessCommand(command, dependencies, options) {
|
|
143
130
|
const processModel = command.config.profiles[command.request.profile]?.execution.processModel;
|
|
144
131
|
if (processModel === 'supervised-process') {
|
|
145
|
-
return createSupervisedRunResult(command, dependencies, timing);
|
|
132
|
+
return createSupervisedRunResult(command, dependencies, options.timing, options.source);
|
|
146
133
|
}
|
|
147
134
|
if (processModel === 'worker-pool') {
|
|
148
|
-
return createWorkerPoolRunResult(command, dependencies, timing);
|
|
149
|
-
}
|
|
150
|
-
return null;
|
|
151
|
-
}
|
|
152
|
-
export async function executeNonLocalResolvedRun(resolvedRun, dependencies, runtimePolicy, timing = null) {
|
|
153
|
-
if (resolvedRun.facts.execution.processModel === 'supervised-process') {
|
|
154
|
-
const result = await executeSupervisedRun(resolvedRun, dependencies, {
|
|
155
|
-
async finalizeResult(supervisedRun, finalResult) {
|
|
156
|
-
return await finalizeResultWithDurationHistory(dependencies, supervisedRun, finalResult, timing);
|
|
157
|
-
},
|
|
158
|
-
timing
|
|
159
|
-
});
|
|
160
|
-
return addRunnerErrors(result, runtimePolicy?.takeRunErrors() ?? []);
|
|
161
|
-
}
|
|
162
|
-
if (resolvedRun.facts.execution.processModel === 'worker-pool') {
|
|
163
|
-
return await executeWorkerPoolRun(resolvedRun, dependencies, {
|
|
164
|
-
async finalizeResult(workerPoolRun, completion) {
|
|
165
|
-
return await finalizeResultWithDurationHistory(dependencies, workerPoolRun, completion.result, timing);
|
|
166
|
-
},
|
|
167
|
-
timing
|
|
168
|
-
});
|
|
135
|
+
return createWorkerPoolRunResult(command, dependencies, options.timing, options.source);
|
|
169
136
|
}
|
|
170
137
|
return null;
|
|
171
138
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run-isolated-process.js","sourceRoot":"","sources":["../../../../source/run/run-isolated-process.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,+BAA+B,EAC/B,2BAA2B,EAC9B,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EACH,+BAA+B,EAElC,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACH,oBAAoB,EAEvB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACH,
|
|
1
|
+
{"version":3,"file":"run-isolated-process.js","sourceRoot":"","sources":["../../../../source/run/run-isolated-process.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,+BAA+B,EAC/B,2BAA2B,EAC9B,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EACH,+BAA+B,EAElC,MAAM,+B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C9F,CAAC;IAAC,OAAO,KAAc,EAAE,CAAC;QACtB,OAAO,MAAM,2BAA2B,CACpC,OAAO,EACP,YAAY,EACZ,+BAA+B,CAAC,KAAK,EAAE,IAAI,CAAC,EAC5C,MAAM,CACT,CAAC;IACN,CAAC;AACL,CAAC;AAED,MAAM,UAAU,yBAAyB,CACrC,OAAmB,EACnB,YAAyC,EACzC,OAA2B;IAE3B,MAAM,YAAY,GAAG,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,SAAS,CAAC,YAAY,CAAC;IAE9F,IAAI,YAAY,KAAK,oBAAoB,EAAE,CAAC;QACxC,OAAO,yBAAyB,CAAC,OAAO,EAAE,YAAY,EAAE,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;IAC5F,CAAC;IAED,IAAI,YAAY,KAAK,aAAa,EAAE,CAAC;QACjC,OAAO,yBAAyB,CAAC,OAAO,EAAE,YAAY,EAAE,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;IAC5F,CAAC;IAED,OAAO,IAAI,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { createResultFromResolutionError, reportCollectionErrorResult } from "./run-collection-error-result.js";
|
|
2
|
+
import { coverageExecutionCompleted, microtestCoveragePolicy, startCoverageSession } from "./run-coverage.js";
|
|
3
|
+
import { executeInProcessResolvedRun } from "./run-in-process-execution.js";
|
|
4
|
+
import { readResolvedRunInput } from "./run-input-resolution.js";
|
|
5
|
+
import { createLocalRunOrEmptySelectionResult, createLocalRunOrEmptySelectionResultFromInput } from "./run-local-resolution.js";
|
|
6
|
+
import { assertRunnableResourceUsagePolicy, createRunRuntimePolicy, finalizeResultWithDurationHistory } from "./run-support.js";
|
|
7
|
+
import { emptyTimingSpanMetadata } from "./run-timing-collection.js";
|
|
8
|
+
function isRunResult(value) {
|
|
9
|
+
return Object.hasOwn(value, 'summary');
|
|
10
|
+
}
|
|
11
|
+
async function resolveRunWithRuntimePolicy(resolveRun, runtimePolicy) {
|
|
12
|
+
return runtimePolicy === null ? await resolveRun() : await runtimePolicy.runLoad(resolveRun);
|
|
13
|
+
}
|
|
14
|
+
async function createLocalRunResult(command, dependencies, runtimePolicy, options) {
|
|
15
|
+
const resolveRun = async function resolveLocalRunInsidePolicy() {
|
|
16
|
+
return await options.timing.measureAsync('collection.resolve', emptyTimingSpanMetadata(), async function createTimedLocalRunOrEmptySelectionResult() {
|
|
17
|
+
return await createLocalRunOrEmptySelectionResult(command, dependencies, options.source);
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
try {
|
|
21
|
+
return await resolveRunWithRuntimePolicy(resolveRun, runtimePolicy);
|
|
22
|
+
}
|
|
23
|
+
catch (error) {
|
|
24
|
+
try {
|
|
25
|
+
return createResultFromResolutionError(error, runtimePolicy);
|
|
26
|
+
}
|
|
27
|
+
catch {
|
|
28
|
+
runtimePolicy?.takeRunErrors();
|
|
29
|
+
throw error;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
async function executeResolvedRun(resolvedRun, dependencies, runtimePolicy, timing) {
|
|
34
|
+
assertRunnableResourceUsagePolicy(resolvedRun.facts.execution.resourceUsagePolicy);
|
|
35
|
+
return await executeInProcessResolvedRun(resolvedRun, dependencies, {
|
|
36
|
+
async finalizeResult(run, result) {
|
|
37
|
+
return await finalizeResultWithDurationHistory(dependencies, run, result, timing);
|
|
38
|
+
},
|
|
39
|
+
runtimePolicy,
|
|
40
|
+
timing
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
async function resolveCoverageLocalRun(resolution) {
|
|
44
|
+
const { command, dependencies, input, runtimePolicy, source, timing } = resolution;
|
|
45
|
+
try {
|
|
46
|
+
return await resolveRunWithRuntimePolicy(async function resolveCoveredLocalRun() {
|
|
47
|
+
return await timing.measureAsync('collection.resolve', emptyTimingSpanMetadata(), async function createCoveredLocalRun() {
|
|
48
|
+
return await createLocalRunOrEmptySelectionResultFromInput(command, dependencies, input, source);
|
|
49
|
+
});
|
|
50
|
+
}, runtimePolicy);
|
|
51
|
+
}
|
|
52
|
+
catch (error) {
|
|
53
|
+
return createResultFromResolutionError(error, runtimePolicy);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
async function executeCoverageLocalRun(execution) {
|
|
57
|
+
const { command, dependencies, input, session, source, timing } = execution;
|
|
58
|
+
const runtimePolicy = createRunRuntimePolicy(command.request, dependencies);
|
|
59
|
+
const resolvedRun = await resolveCoverageLocalRun({
|
|
60
|
+
command,
|
|
61
|
+
dependencies,
|
|
62
|
+
input,
|
|
63
|
+
runtimePolicy,
|
|
64
|
+
source,
|
|
65
|
+
timing
|
|
66
|
+
});
|
|
67
|
+
if (isRunResult(resolvedRun)) {
|
|
68
|
+
const finalResult = await session.finalize(resolvedRun, coverageExecutionCompleted(resolvedRun));
|
|
69
|
+
return await reportCollectionErrorResult(command, dependencies, finalResult, timing);
|
|
70
|
+
}
|
|
71
|
+
return await executeInProcessResolvedRun(resolvedRun, dependencies, {
|
|
72
|
+
async finalizeResult(run, result) {
|
|
73
|
+
const coverageResult = await session.finalize(result, coverageExecutionCompleted(result));
|
|
74
|
+
return await finalizeResultWithDurationHistory(dependencies, run, coverageResult, timing);
|
|
75
|
+
},
|
|
76
|
+
runtimePolicy,
|
|
77
|
+
timing
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
async function startLocalCoverageSession(command, dependencies, input, timing) {
|
|
81
|
+
try {
|
|
82
|
+
const session = await startCoverageSession({
|
|
83
|
+
coverage: microtestCoveragePolicy(input.profile),
|
|
84
|
+
processModel: 'in-process',
|
|
85
|
+
projectRoot: input.projectRoot,
|
|
86
|
+
runtimeStateDir: input.config.runtimeStateDir,
|
|
87
|
+
testFiles: input.files.map(function testFilePath(file) {
|
|
88
|
+
return file.file;
|
|
89
|
+
}),
|
|
90
|
+
timing
|
|
91
|
+
});
|
|
92
|
+
return { kind: 'started', session };
|
|
93
|
+
}
|
|
94
|
+
catch (error) {
|
|
95
|
+
const result = await reportCollectionErrorResult(command, dependencies, createResultFromResolutionError(error, null), timing);
|
|
96
|
+
return { kind: 'error', result };
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
async function createCoverageLocalRunResult(command, dependencies, timing, source) {
|
|
100
|
+
const input = await readResolvedRunInput(command, dependencies);
|
|
101
|
+
const sessionStart = await startLocalCoverageSession(command, dependencies, input, timing);
|
|
102
|
+
if (sessionStart.kind === 'error') {
|
|
103
|
+
return sessionStart.result;
|
|
104
|
+
}
|
|
105
|
+
try {
|
|
106
|
+
return await executeCoverageLocalRun({
|
|
107
|
+
command,
|
|
108
|
+
dependencies,
|
|
109
|
+
input,
|
|
110
|
+
session: sessionStart.session,
|
|
111
|
+
source,
|
|
112
|
+
timing
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
finally {
|
|
116
|
+
await sessionStart.session.dispose();
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
async function runOrdinaryLocalCommand(command, dependencies, timing, source) {
|
|
120
|
+
const runtimePolicy = createRunRuntimePolicy(command.request, dependencies);
|
|
121
|
+
const resolvedRun = await createLocalRunResult(command, dependencies, runtimePolicy, { source, timing });
|
|
122
|
+
if (isRunResult(resolvedRun)) {
|
|
123
|
+
return await reportCollectionErrorResult(command, dependencies, resolvedRun, timing);
|
|
124
|
+
}
|
|
125
|
+
return await executeResolvedRun(resolvedRun, dependencies, runtimePolicy, timing);
|
|
126
|
+
}
|
|
127
|
+
export async function runLocalCommand(command, dependencies, timing, source) {
|
|
128
|
+
return command.request.coverage
|
|
129
|
+
? await createCoverageLocalRunResult(command, dependencies, timing, source)
|
|
130
|
+
: await runOrdinaryLocalCommand(command, dependencies, timing, source);
|
|
131
|
+
}
|
|
132
|
+
//# sourceMappingURL=run-local-command.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-local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