@overkill-dev/run 0.0.60 → 0.0.61
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 +36 -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 +12 -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 +10 -3
- package/packages/engine/engine.entry-point.d.ts +2 -1
- package/packages/engine/engine.entry-point.d.ts.map +1 -1
- package/packages/engine/engine.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 +4 -2
- 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 +24 -5
- package/reporters/human-reporter-rendering.js +16 -1
- package/reporters/human-reporter-rendering.js.map +1 -1
- package/reporters/line-reporter.js +9 -0
- package/reporters/line-reporter.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-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-reporting.js +142 -0
- package/run/coverage-reporting.js.map +1 -0
- package/run/coverage-session.js +8 -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-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 +13 -4
- package/run/run-config-defaults.js.map +1 -1
- package/run/run-config-schema.d.ts +12 -0
- package/run/run-config-schema.d.ts.map +1 -1
- package/run/run-config-schema.js +5 -0
- package/run/run-config-schema.js.map +1 -1
- package/run/run-config.d.ts +1 -1
- package/run/run-config.d.ts.map +1 -1
- package/run/run-config.js +4 -9
- package/run/run-config.js.map +1 -1
- package/run/run-coverage.js +36 -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-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.map +1 -1
- package/run/run-if-main-profile.js +0 -10
- 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 +131 -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 +108 -0
- package/run/run-supervised-process.js.map +1 -0
- package/run/run-support.js +9 -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 +12 -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
CHANGED
|
@@ -1,88 +1,82 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { executionMode, rootAnnotations, rootControls, rootTitle, selectedOutputRenderer, selectedReporters, warnOnSupervisedDowngrade } from "./run-if-main-options.js";
|
|
1
|
+
import { formatRunnerErrorDiagnostics } from "./command-line-command.js";
|
|
2
|
+
import { rootAnnotations, rootControls, rootTitle, selectedOutputRenderer, selectedReporters } from "./run-if-main-options.js";
|
|
4
3
|
const failureExitCodes = new Set([undefined, null, 0, '0']);
|
|
5
4
|
function shouldSetFailureExitCode(exitCode) {
|
|
6
5
|
return failureExitCodes.has(exitCode);
|
|
7
6
|
}
|
|
8
|
-
|
|
9
|
-
const context = await dependencies.resolveDirectProfile(meta, dependencies.currentWorkingDirectory());
|
|
7
|
+
function directRunRequest(context) {
|
|
10
8
|
return {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
baselineUpdateMode: 'none',
|
|
10
|
+
capabilityRestrictions: { mode: 'enabled' },
|
|
11
|
+
capture: 'buffered',
|
|
12
|
+
coverage: false,
|
|
13
|
+
debug: { mode: 'off', selectors: [] },
|
|
14
|
+
execution: { mode: 'profile-default' },
|
|
15
|
+
measureResourceUsage: null,
|
|
16
|
+
order: 'seeded',
|
|
17
|
+
paths: [context.file],
|
|
18
|
+
profile: context.name,
|
|
19
|
+
resourceBudgetOverrides: null,
|
|
20
|
+
resourceUsageSamplingIntervalMilliseconds: null,
|
|
21
|
+
seed: { value: null },
|
|
22
|
+
selection: { kind: 'all' },
|
|
23
|
+
shard: { index: 1, total: 1 },
|
|
24
|
+
timingCollection: 'profile-default',
|
|
25
|
+
verbose: false,
|
|
26
|
+
workers: null
|
|
14
27
|
};
|
|
15
28
|
}
|
|
16
|
-
function
|
|
17
|
-
return dependencies.runEngine.createTestPlan(dependencies.runEngine.createRoot({
|
|
18
|
-
annotations: rootAnnotations(context.options),
|
|
19
|
-
children: [context.testNode],
|
|
20
|
-
controls: rootControls(context.options),
|
|
21
|
-
title: rootTitle(context.options, context.projectRoot)
|
|
22
|
-
}));
|
|
23
|
-
}
|
|
24
|
-
async function executeDirectTestPlan(context, testPlan, dependencies) {
|
|
25
|
-
const wallClock = dependencies.createClock();
|
|
29
|
+
async function directRunConfig(context) {
|
|
26
30
|
const reporters = await selectedReporters(context.profile, context.config, context.options);
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
const runFacts = directRunFacts({
|
|
30
|
-
config,
|
|
31
|
-
fileSet: context.fileSet,
|
|
32
|
-
profileName: context.name,
|
|
33
|
-
projectRoot: context.projectRoot,
|
|
34
|
-
seed: ordered.seed,
|
|
35
|
-
testPlan: ordered.testPlan
|
|
36
|
-
});
|
|
37
|
-
const runtimePolicy = dependencies.createRuntimePolicy();
|
|
38
|
-
const { resourceUsagePolicy } = runFacts.execution;
|
|
39
|
-
const startedAt = new Date(wallClock.currentUnixEpochMilliseconds);
|
|
40
|
-
warnOnSupervisedDowngrade(context.profile, dependencies.stderr);
|
|
41
|
-
return await dependencies.runEngine.execute(ordered.testPlan, {
|
|
42
|
-
execution: { mode: executionMode(context.profile) },
|
|
43
|
-
async finalizeResult(result) {
|
|
44
|
-
return finalizeDirectRunResult(runFacts, result);
|
|
45
|
-
},
|
|
31
|
+
return {
|
|
32
|
+
loader: context.config.loader,
|
|
46
33
|
outputRenderer: selectedOutputRenderer(context.config, context.options),
|
|
34
|
+
profiles: {
|
|
35
|
+
...context.config.profiles,
|
|
36
|
+
[context.name]: { ...context.profile, reporters }
|
|
37
|
+
},
|
|
47
38
|
reporters,
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
hardTimeoutMilliseconds: runFacts.execution.timeoutPolicy.hardMilliseconds,
|
|
59
|
-
timeoutMilliseconds: runFacts.execution.timeoutPolicy.softMilliseconds
|
|
60
|
-
}
|
|
61
|
-
});
|
|
39
|
+
runtimeStateDir: context.config.runtimeStateDir
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
async function directRunCommand(context) {
|
|
43
|
+
return {
|
|
44
|
+
config: await directRunConfig(context),
|
|
45
|
+
cwd: context.projectRoot,
|
|
46
|
+
engine: { kind: 'default' },
|
|
47
|
+
request: directRunRequest(context)
|
|
48
|
+
};
|
|
62
49
|
}
|
|
63
50
|
function hasFailure(result) {
|
|
64
51
|
return result.summary.failed > 0 || result.runnerErrors.length > 0;
|
|
65
52
|
}
|
|
66
|
-
function
|
|
67
|
-
|
|
68
|
-
dependencies.
|
|
53
|
+
function writeUndeliveredErrors(errors, dependencies) {
|
|
54
|
+
for (const diagnostic of formatRunnerErrorDiagnostics(errors)) {
|
|
55
|
+
dependencies.stderr.write(`${diagnostic}\n`);
|
|
69
56
|
}
|
|
70
57
|
}
|
|
71
58
|
async function executeDirectRun(context, dependencies) {
|
|
72
|
-
const
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
59
|
+
const delivery = await dependencies.runDirectEntrypoint(await directRunCommand(context), {
|
|
60
|
+
kind: 'direct-entrypoint',
|
|
61
|
+
root: {
|
|
62
|
+
annotations: rootAnnotations(context.options),
|
|
63
|
+
controls: rootControls(context.options),
|
|
64
|
+
title: rootTitle(context.options, context.projectRoot)
|
|
65
|
+
},
|
|
66
|
+
testNode: context.testNode
|
|
67
|
+
});
|
|
68
|
+
writeUndeliveredErrors(delivery.undeliveredRunnerErrors, dependencies);
|
|
69
|
+
if (hasFailure(delivery.result) && shouldSetFailureExitCode(dependencies.readExitCode())) {
|
|
70
|
+
dependencies.setExitCode(1);
|
|
71
|
+
}
|
|
79
72
|
}
|
|
80
73
|
export function createRunIfMain(dependencies) {
|
|
81
74
|
return async function runIfMain(meta, testNode, options) {
|
|
82
75
|
if (!meta.main) {
|
|
83
76
|
return;
|
|
84
77
|
}
|
|
85
|
-
await
|
|
78
|
+
const profile = await dependencies.resolveDirectProfile(meta, dependencies.currentWorkingDirectory());
|
|
79
|
+
await executeDirectRun({ ...profile, options, testNode }, dependencies);
|
|
86
80
|
};
|
|
87
81
|
}
|
|
88
82
|
//# sourceMappingURL=run-if-main.js.map
|
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;QAC1B,sBAAsB,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;QAC3C,OAAO,EAAE,UAAU;QACnB,QAAQ,EAAE,KAAK;QACf,KAAK,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,EAAE;QACrC,SAAS,EAAE,EAAE,IAAI,EAAE,iBAAiB,EAAE;QACtC,oBAAoB,EAAE,IAAI;QAC1B,KAAK,EAAE,QAAQ;QACf,KAAK,EAAE,CAAE,OAAO,CAAC,IAAI,CAAE;QACvB,OAAO,EAAE,OAAO,CAAC,IAAI;QACrB,uBAAuB,EAAE,IAAI;QAC7B,yCAAyC,EAAE,IAAI;QAC/C,IAAI,EAA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AE,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,UAAU,oBAAoB,CACtC,OAAmB,EACnB,YAAyC;IAEzC,gBAAgB,CAAC,OAAO,CAAC,CAAC;IAC1B,MAAM,OAAO,GAAG,WAAW,CAAC,cAAc,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC;IAC7D,MAAM,MAAM,GAAG,WAAW,CAAC,aAAa,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC;IAC1D,MAAM,OAAO,GAAG,eAAe,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IACjD
|
|
1
|
+
{"version":3,"file":"run-input-resolution.js","sourceRoot":"","sources":["../../../../source/run/run-input-resolution.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE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C,CAAC;IAC7D,MAAM,MAAM,GAAG,WAAW,CAAC,aAAa,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC;IAC1D,MAAM,OAAO,GAAG,eAAe,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IACjD,6BAA6B,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAChD,4BAA4B,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC/C,MAAM,SAAS,GAAG,WAAW,CACzB,MAAM,YAAY,CAAC,+BAA+B,CAAC;QAC/C,GAAG,EAAE,OAAO,CAAC,GAAG;QAChB,KAAK,EAAE,OAAO,CAAC,KAAK;QACpB,YAAY,EAAE,OAAO,CAAC,KAAK;KAC9B,CAAC,CACL,CAAC;IACF,MAAM,MAAM,GAAG,WAAW,CAAC,sBAAsB,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC;IAEnE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,CAAC,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,SAAS,CAAC,WAAW,EAAE,OAAO,EAAE,CAAC;AAC5G,CAAC"}
|
|
@@ -1,10 +1,30 @@
|
|
|
1
|
+
import { assertDirectEntrypointCollectionMatches } from "./direct-entrypoint-collection.js";
|
|
2
|
+
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,0BAA0B,CAAC;AACnF,OAAO,EAAE,0BAA0B,EAAE,MAAM,gBAAgB,CAAC;AAa5D,OAAO,EAAE,iBAAiB,EAAyB,MAAM,4BAA4B,CAAC;AA0CtF,SAAS,cAAc,CAAC,OAAmB;IACvC,IAAI,OAAO,CAAC,MAAM,CAAC,IAAI,KAAK,UAAU,EAAE,CAAC;QACrC,MAAM,IAAI,KAAK,CAAC,qDAAqD,CAAC,CAAC;IAC3E,CAAC;IAED,OAAO,OAAO,CAAC,MAAM,CAAC;AAC1B,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,kCAAkC,CACpD,OAAmB,EACnB,YAAyC,EACzC,KAAuB,EACvB,MAAmC;IAEnC,O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AAS,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
|
}
|