@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.
Files changed (228) hide show
  1. package/engine/coverage-artifact.d.ts +36 -0
  2. package/engine/coverage-artifact.d.ts.map +1 -0
  3. package/engine/execution-options.d.ts +4 -1
  4. package/engine/execution-options.d.ts.map +1 -1
  5. package/engine/execution-options.js.map +1 -1
  6. package/engine/execution-supervision-state.d.ts +30 -0
  7. package/engine/execution-supervision-state.d.ts.map +1 -0
  8. package/engine/execution-supervision-state.js +25 -0
  9. package/engine/execution-supervision-state.js.map +1 -0
  10. package/engine/execution-supervision.d.ts +5 -25
  11. package/engine/execution-supervision.d.ts.map +1 -1
  12. package/engine/execution-supervision.js +9 -19
  13. package/engine/execution-supervision.js.map +1 -1
  14. package/engine/execution-test-plan-cases.js +108 -71
  15. package/engine/execution-test-plan-cases.js.map +1 -1
  16. package/engine/identity.d.ts +2 -0
  17. package/engine/identity.d.ts.map +1 -1
  18. package/engine/identity.js +2 -1
  19. package/engine/identity.js.map +1 -1
  20. package/engine/reporter-event-queue.js +1 -1
  21. package/engine/reporter-event-queue.js.map +1 -1
  22. package/engine/run-result.d.ts +12 -5
  23. package/engine/run-result.d.ts.map +1 -1
  24. package/engine/run-result.js.map +1 -1
  25. package/engine/run-timings.d.ts +1 -1
  26. package/engine/run-timings.d.ts.map +1 -1
  27. package/engine/run-timings.js +3 -0
  28. package/engine/run-timings.js.map +1 -1
  29. package/engine/test-plan.d.ts +1 -1
  30. package/engine/test-plan.d.ts.map +1 -1
  31. package/package.json +10 -3
  32. package/packages/engine/engine.entry-point.d.ts +2 -1
  33. package/packages/engine/engine.entry-point.d.ts.map +1 -1
  34. package/packages/engine/engine.entry-point.js.map +1 -1
  35. package/packages/run/filters.entry-point.d.ts +2 -2
  36. package/packages/run/filters.entry-point.d.ts.map +1 -1
  37. package/packages/run/filters.entry-point.js +1 -1
  38. package/packages/run/filters.entry-point.js.map +1 -1
  39. package/packages/run/run.entry-point.d.ts +4 -2
  40. package/packages/run/run.entry-point.d.ts.map +1 -1
  41. package/packages/run/run.entry-point.js +2 -8
  42. package/packages/run/run.entry-point.js.map +1 -1
  43. package/readme.md +24 -5
  44. package/reporters/human-reporter-rendering.js +16 -1
  45. package/reporters/human-reporter-rendering.js.map +1 -1
  46. package/reporters/line-reporter.js +9 -0
  47. package/reporters/line-reporter.js.map +1 -1
  48. package/resources/resources.d.ts +1 -0
  49. package/resources/resources.d.ts.map +1 -1
  50. package/resources/resources.js.map +1 -1
  51. package/resources/runtime-definition.d.ts +2 -0
  52. package/resources/runtime-definition.d.ts.map +1 -1
  53. package/resources/runtime-definition.js +1 -0
  54. package/resources/runtime-definition.js.map +1 -1
  55. package/run/collected-run-plan.js +13 -0
  56. package/run/collected-run-plan.js.map +1 -1
  57. package/run/command-line-runner.d.ts.map +1 -1
  58. package/run/command-line-runner.js +2 -0
  59. package/run/command-line-runner.js.map +1 -1
  60. package/run/coverage-reporting.js +142 -0
  61. package/run/coverage-reporting.js.map +1 -0
  62. package/run/coverage-session.js +8 -0
  63. package/run/coverage-session.js.map +1 -0
  64. package/run/current-process-run-orchestrator.d.ts +2 -1
  65. package/run/current-process-run-orchestrator.d.ts.map +1 -1
  66. package/run/current-process-run-orchestrator.js +30 -1
  67. package/run/current-process-run-orchestrator.js.map +1 -1
  68. package/run/direct-entrypoint-collection.js +27 -0
  69. package/run/direct-entrypoint-collection.js.map +1 -0
  70. package/run/duration-history-schema.d.ts +251 -0
  71. package/run/duration-history-schema.d.ts.map +1 -0
  72. package/run/duration-history-schema.js +121 -0
  73. package/run/duration-history-schema.js.map +1 -0
  74. package/run/duration-history.d.ts +2 -2
  75. package/run/duration-history.d.ts.map +1 -1
  76. package/run/duration-history.js +3 -82
  77. package/run/duration-history.js.map +1 -1
  78. package/run/path-containment.js +2 -0
  79. package/run/path-containment.js.map +1 -0
  80. package/run/profile-file-glob.js +18 -0
  81. package/run/profile-file-glob.js.map +1 -1
  82. package/run/resource-lifecycle-boundaries.js +20 -5
  83. package/run/resource-lifecycle-boundaries.js.map +1 -1
  84. package/run/resource-lifecycle-cache-identity.js +4 -0
  85. package/run/resource-lifecycle-cache-identity.js.map +1 -1
  86. package/run/resource-lifecycle-composition.d.ts +1 -1
  87. package/run/resource-lifecycle-composition.d.ts.map +1 -1
  88. package/run/resource-lifecycle-composition.js +4 -4
  89. package/run/resource-lifecycle-composition.js.map +1 -1
  90. package/run/run-collected-planning.js +1 -1
  91. package/run/run-collected-planning.js.map +1 -1
  92. package/run/run-collection-source-types.d.ts +12 -0
  93. package/run/run-collection-source-types.d.ts.map +1 -0
  94. package/run/run-collection-source.d.ts +9 -0
  95. package/run/run-collection-source.d.ts.map +1 -0
  96. package/run/run-collection-source.js +9 -0
  97. package/run/run-collection-source.js.map +1 -0
  98. package/run/run-config-defaults.js +13 -4
  99. package/run/run-config-defaults.js.map +1 -1
  100. package/run/run-config-schema.d.ts +12 -0
  101. package/run/run-config-schema.d.ts.map +1 -1
  102. package/run/run-config-schema.js +5 -0
  103. package/run/run-config-schema.js.map +1 -1
  104. package/run/run-config.d.ts +1 -1
  105. package/run/run-config.d.ts.map +1 -1
  106. package/run/run-config.js +4 -9
  107. package/run/run-config.js.map +1 -1
  108. package/run/run-coverage.js +36 -0
  109. package/run/run-coverage.js.map +1 -0
  110. package/run/run-discovery.js +1 -2
  111. package/run/run-discovery.js.map +1 -1
  112. package/run/run-empty-shard.js +3 -4
  113. package/run/run-empty-shard.js.map +1 -1
  114. package/run/run-engine-selection.d.ts +1 -1
  115. package/run/run-engine-selection.d.ts.map +1 -1
  116. package/run/run-execution-config.d.ts +28 -0
  117. package/run/run-execution-config.d.ts.map +1 -0
  118. package/run/run-facts.js +2 -0
  119. package/run/run-facts.js.map +1 -1
  120. package/run/run-filter-grammar.d.ts +1 -1
  121. package/run/run-filter-grammar.d.ts.map +1 -1
  122. package/run/run-if-main-options.d.ts +0 -5
  123. package/run/run-if-main-options.d.ts.map +1 -1
  124. package/run/run-if-main-options.js +0 -16
  125. package/run/run-if-main-options.js.map +1 -1
  126. package/run/run-if-main-profile.d.ts.map +1 -1
  127. package/run/run-if-main-profile.js +0 -10
  128. package/run/run-if-main-profile.js.map +1 -1
  129. package/run/run-if-main.d.ts +2 -10
  130. package/run/run-if-main.d.ts.map +1 -1
  131. package/run/run-if-main.js +56 -62
  132. package/run/run-if-main.js.map +1 -1
  133. package/run/run-in-process-execution.js +3 -3
  134. package/run/run-in-process-execution.js.map +1 -1
  135. package/run/run-input-resolution.js +11 -2
  136. package/run/run-input-resolution.js.map +1 -1
  137. package/run/run-isolated-command.js +46 -20
  138. package/run/run-isolated-command.js.map +1 -1
  139. package/run/run-isolated-process.js +68 -101
  140. package/run/run-isolated-process.js.map +1 -1
  141. package/run/run-local-command.js +131 -0
  142. package/run/run-local-command.js.map +1 -0
  143. package/run/run-local-execution.js +7 -10
  144. package/run/run-local-execution.js.map +1 -1
  145. package/run/run-local-resolution.js +10 -5
  146. package/run/run-local-resolution.js.map +1 -1
  147. package/run/run-local-test-plan.js +6 -1
  148. package/run/run-local-test-plan.js.map +1 -1
  149. package/run/run-orchestrator.d.ts +6 -0
  150. package/run/run-orchestrator.d.ts.map +1 -1
  151. package/run/run-orchestrator.entry-point.d.ts +1 -2
  152. package/run/run-orchestrator.entry-point.d.ts.map +1 -1
  153. package/run/run-orchestrator.entry-point.js +4 -4
  154. package/run/run-orchestrator.entry-point.js.map +1 -1
  155. package/run/run-orchestrator.js +11 -4
  156. package/run/run-orchestrator.js.map +1 -1
  157. package/run/run-ordering.js +36 -0
  158. package/run/run-ordering.js.map +1 -0
  159. package/run/run-request-types.d.ts +89 -0
  160. package/run/run-request-types.d.ts.map +1 -0
  161. package/run/run-selection-filters.d.ts +7 -2
  162. package/run/run-selection-filters.d.ts.map +1 -1
  163. package/run/run-selection-filters.js +114 -15
  164. package/run/run-selection-filters.js.map +1 -1
  165. package/run/run-selection.js +10 -50
  166. package/run/run-selection.js.map +1 -1
  167. package/run/run-supervised-process.js +108 -0
  168. package/run/run-supervised-process.js.map +1 -0
  169. package/run/run-support.js +9 -0
  170. package/run/run-support.js.map +1 -1
  171. package/run/run-test-plan.js +13 -5
  172. package/run/run-test-plan.js.map +1 -1
  173. package/run/run-types.d.ts +12 -96
  174. package/run/run-types.d.ts.map +1 -1
  175. package/run/run-types.js +0 -18
  176. package/run/run-types.js.map +1 -1
  177. package/run/run-validation.js +1 -1
  178. package/run/run-validation.js.map +1 -1
  179. package/run/run.d.ts +10 -0
  180. package/run/run.d.ts.map +1 -0
  181. package/run/run.js +27 -54
  182. package/run/run.js.map +1 -1
  183. package/run/runtime-matrix-expansion.js +7 -0
  184. package/run/runtime-matrix-expansion.js.map +1 -1
  185. package/run/supervised-child-process.d.ts +24 -2
  186. package/run/supervised-child-process.d.ts.map +1 -1
  187. package/run/supervised-child-process.js +40 -1
  188. package/run/supervised-child-process.js.map +1 -1
  189. package/run/supervised-child-test-plan.js +1 -0
  190. package/run/supervised-child-test-plan.js.map +1 -1
  191. package/run/supervised-child.js +2 -5
  192. package/run/supervised-child.js.map +1 -1
  193. package/run/supervised-protocol.js +2 -7
  194. package/run/supervised-protocol.js.map +1 -1
  195. package/run/supervised-run-collection.js +2 -0
  196. package/run/supervised-run-collection.js.map +1 -1
  197. package/run/supervised-run-runtime.js +4 -105
  198. package/run/supervised-run-runtime.js.map +1 -1
  199. package/run/supervised-run-state.d.ts +4 -0
  200. package/run/supervised-run-state.d.ts.map +1 -1
  201. package/run/supervised-run-state.js +22 -0
  202. package/run/supervised-run-state.js.map +1 -1
  203. package/run/supervised-run.js +11 -79
  204. package/run/supervised-run.js.map +1 -1
  205. package/run/work-distribution-config.js +1 -1
  206. package/run/work-distribution-config.js.map +1 -1
  207. package/run/work-unit-planning.js +1 -1
  208. package/run/work-unit-planning.js.map +1 -1
  209. package/run/worker-pool-command.js +3 -0
  210. package/run/worker-pool-command.js.map +1 -1
  211. package/run/worker-pool-hedged-arbitration.js +3 -1
  212. package/run/worker-pool-hedged-arbitration.js.map +1 -1
  213. package/run/worker-pool-protocol.js.map +1 -1
  214. package/run/worker-pool-task-events.js +7 -5
  215. package/run/worker-pool-task-events.js.map +1 -1
  216. package/run/worker-pool-worker-plan.js +1 -0
  217. package/run/worker-pool-worker-plan.js.map +1 -1
  218. package/run/worker-pool-worker.js +2 -5
  219. package/run/worker-pool-worker.js.map +1 -1
  220. package/sbom.cdx.json +72 -4
  221. package/run/default-run-engine.d.ts +0 -3
  222. package/run/default-run-engine.d.ts.map +0 -1
  223. package/run/direct-runtime-policy.js +0 -24
  224. package/run/direct-runtime-policy.js.map +0 -1
  225. package/run/resource-usage.d.ts +0 -17
  226. package/run/resource-usage.d.ts.map +0 -1
  227. package/run/run-if-main-facts.js +0 -95
  228. package/run/run-if-main-facts.js.map +0 -1
@@ -1,88 +1,82 @@
1
- import { assertDirectTestPlanMatchesTestFamily, directRunFacts, finalizeDirectRunResult, runConfig } from "./run-if-main-facts.js";
2
- import { assertTestPlanCasesMatchProfilePolicy, createSeededTestPlan } from "./run-selection.js";
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
- async function createDirectRunContext(meta, testNode, options, dependencies) {
9
- const context = await dependencies.resolveDirectProfile(meta, dependencies.currentWorkingDirectory());
7
+ function directRunRequest(context) {
10
8
  return {
11
- ...context,
12
- options,
13
- testNode
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 directTestPlan(context, dependencies) {
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
- const config = runConfig(context.config, reporters);
28
- const ordered = createSeededTestPlan(testPlan);
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
- resourceBudgets: resourceUsagePolicy.budgets,
49
- resourceUsageTracker: resourceUsagePolicy.measure
50
- ? dependencies.createResourceUsageTracker(wallClock, {
51
- samplingIntervalMilliseconds: resourceUsagePolicy.samplingIntervalMilliseconds
52
- })
53
- : null,
54
- runtimePolicy,
55
- runFacts,
56
- startedAt: startedAt.toISOString(),
57
- timeoutPolicy: {
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 applyFailureExitCode(result, dependencies) {
67
- if (hasFailure(result) && shouldSetFailureExitCode(dependencies.readExitCode())) {
68
- dependencies.setExitCode(1);
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 testPlan = directTestPlan(context, dependencies);
73
- assertDirectTestPlanMatchesTestFamily(testPlan, context.profile.testFamily);
74
- assertTestPlanCasesMatchProfilePolicy(testPlan, context.profile);
75
- applyFailureExitCode(await executeDirectTestPlan(context, testPlan, dependencies), dependencies);
76
- }
77
- async function runDirectEntrypoint(meta, testNode, options, dependencies) {
78
- await executeDirectRun(await createDirectRunContext(meta, testNode, options, dependencies), dependencies);
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 runDirectEntrypoint(meta, testNode, options, dependencies);
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
@@ -1 +1 @@
1
- {"version":3,"file":"run-if-main.js","sourceRoot":"","sources":["../../../../source/run/run-if-main.ts"],"names":[],"mappings":"AAMA,OAAO,EACH,qCAAqC,EACrC,cAAc,EACd,uBAAuB,EACvB,SAAS,EACZ,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACH,qCAAqC,EACrC,oBAAoB,EACvB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACH,aAAa,EACb,eAAe,EACf,YAAY,EACZ,SAAS,EACT,sBAAsB,EACtB,iBAAiB,EACjB,yBAAyB,EAE5B,MAAM,0BAA0B,CAAC;AAoClC,MAAM,gBAAgB,GAAG,IAAI,GAAG,CAAqC,CAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,GAAG,CAAE,CAAC,CAAC;AAElG,SAAS,wBAAwB,CAAC,QAA4C;IAC1E,OAAO,gBAAgB,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC1C,CAAC;AAED,KAAK,UAAU,sBAAsB,CACjC,IAA0B,EAC1B,QAAkB,EAClB,OAAqC,EACrC,YAAmC;IAEnC,MAAM,OAAO,GAAG,MAAM,YAAY,CAAC,oBAAoB,CAAC,IAAI,EAAE,YAAY,CAAC,uBAAuB,EAAE,CAAC,CAAC;IAEtG,OAAO;QACH,GAAG,OAAO;QACV,OAAO;QACP,QAAQ;KACX,CAAC;AACN,CAAC;AAED,SAAS,cAA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,CAAC;IAEF,sBAAsB,CAAC,QAAQ,CAAC,uBAAuB,EAAE,YAAY,CAAC,CAAC;IAEvE,IAAI,UAAU,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,wBAAwB,CAAC,YAAY,CAAC,YAAY,EAAE,CAAC,EAAE,CAAC;QACvF,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, runtimePolicy, timing = null) {
6
+ export async function executeInProcessResolvedRun(resolvedRun, dependencies, options) {
7
7
  if (resolvedRun.plan.kind === 'empty-shard') {
8
- return await executeEmptyShardRun(resolvedRun, dependencies, runtimePolicy, timing);
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, runtimePolicy, timing);
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,EAC1B,MAAM,0BAA0B,CAAC;AAiBlC,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,aAAsC,EACtC,SAAsC,IAAI;IAE1C,IAAI,WAAW,CAAC,IAAI,CAAC,IAAI,KAAK,aAAa,EAAE,CAAC;QAC1C,OAAO,MAAM,oBAAoB,CAAC,WAAW,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,CAAC,CAAC;IACxF,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,aAAa,EAAE,MAAM,CAAC,CAAC;AAC3F,CAAC"}
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
- assertMicrotestCaptureSupported(request, profile);
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;AAQ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,uBAAuB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC1C,+BAA+B,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAClD,0BAA0B,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;AACjD,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,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(command, definitionLocationCapture, profile, files) {
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
- paths: resolvedPaths(files),
96
+ maxConcurrency: input.profile.execution.maxConcurrency,
97
+ paths: resolvedPaths(input.files),
73
98
  resourceBudgets: resourceUsagePolicy.budgets,
74
99
  resourceUsageSamplingIntervalMilliseconds: resourceUsagePolicy.samplingIntervalMilliseconds,
75
- scheduling: profile.execution.scheduling,
76
- testFamily: profile.testFamily,
77
- timeoutMilliseconds: profile.timeouts.softMilliseconds,
78
- workerLifecycle: profile.execution.processModel === 'worker-pool'
79
- ? profile.execution.workerLifecycle
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;AAuC5D,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,SAAS,gCAAgC,CACrC,OAAyB,EACzB,OAAmB;IAEnB,IAAI,OAAO,CAAC,UAAU,KAAK,aAAa,EAAE,CAAC;QACvC,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC;IAChC,CAAC;IAED,OAAO,OAAO,CAAC,OAAO,CAAC,sBAAsB,CAAC;AAClD,CAAC;AAED,SAAS,aAAa,CAAC,KAAgC;IACnD,OAAO,KAAK,CAAC,GAAG,CAAC,SAAS,UAAU,CAAC,IAAI;QACrC,OAAO,IAAI,CAAC,IAAI,CAAC;IACrB,CAAC,CAAC,CAAC;AACP,CAAC;AAED,SAAS,2BAA2B,CAAC,KAAiC;IAClE,MAAM,mBAAmB,GAAG,0BAA0B,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;IAE7F,OAAO;QACH,sBAAsB,EAAE,gCAAgC,CAAC,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC;QACtF,OAAO,EAAE,KAAK,CAAC,OAAO;QACtB,6BAA6B,EAAE,KAAK,CAAC,OAAO,CAAC,QAAQ,CA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;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 { createSupervisedCollectCommand, createSupervisedRunCommand, createWorkerPoolCommand } from "./run-isolated-command.js";
4
+ import { assertExpectedDirectEntrypointCollection, createExpectedDirectEntrypointPlan, createWorkerPoolCommand } from "./run-isolated-command.js";
5
5
  import { finalizeResultWithDurationHistory, readRunDurationHistory } from "./run-support.js";
6
- import { collectSupervisedRun } from "./supervised-run-collection.js";
7
- import { executeSupervisedRun, runSupervisedCommand } from "./supervised-run.js";
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, timing) {
40
- const collection = await (timing?.measureAsync('collection.import', emptyCollectionTimingMetadata, async function collectTimedWorkerPoolRun() {
41
- return await collectWorkerPoolRun(createWorkerPoolCommand(command, 'enabled', input.profile, input.files), dependencies, timing);
42
- }) ?? collectWorkerPoolRun(createWorkerPoolCommand(command, 'enabled', input.profile, input.files), dependencies, null));
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
- async function createSupervisedResolvedRun(command, dependencies, input, timing) {
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(command, dependencies, input, timing);
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, timing);
83
+ return createWorkerPoolResolvedRun(command, dependencies, input, options);
74
84
  }
75
85
  return null;
76
86
  }
77
- function addRunnerErrors(result, runnerErrors) {
78
- if (runnerErrors.length === 0) {
79
- return result;
80
- }
81
- return {
82
- ...result,
83
- runnerErrors: [...runnerErrors, ...result.runnerErrors],
84
- status: 'failed'
85
- };
86
- }
87
- async function createSupervisedRunResult(command, dependencies, timing) {
88
- const input = await readResolvedRunInput(command, dependencies);
89
- if (input.profile.execution.processModel !== 'supervised-process') {
90
- throw new Error('Expected supervised-process profile.');
91
- }
92
- try {
93
- return await runSupervisedCommand(createSupervisedRunCommand(command, input.profile, input.files), dependencies, async function createResolvedRunAfterCollection(collection) {
94
- return await createResolvedExecutionRun({
95
- allowEmptySelection: true,
96
- collection,
97
- command,
98
- dependencies,
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
- catch (error) {
111
- return await reportCollectionErrorResult(command, dependencies, createResultFromResolutionError(error, null), timing);
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
- const durationHistoryIndex = await readWorkerPoolDurationHistory(input, dependencies);
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, timing = null) {
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
  }