@cnc-tools/storm 0.14.2 → 0.15.0

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 (401) hide show
  1. package/dist/application.js +3 -1
  2. package/dist/bin/storm.js +9 -7
  3. package/dist/build-info.js +1 -1
  4. package/dist/chunks/chunk-4U4DZ7VG.js +40 -0
  5. package/dist/chunks/{chunk-GSC6SRTW.js → chunk-5CCP36QQ.js} +1 -1
  6. package/dist/chunks/chunk-5GBMR4HM.js +966 -0
  7. package/dist/chunks/{chunk-43MWZLJR.js → chunk-5VXBKPW6.js} +1 -1
  8. package/dist/chunks/{chunk-RA4L2ACU.js → chunk-AWBSONHB.js} +88 -34
  9. package/dist/chunks/{chunk-BRUIATTR.js → chunk-CN4EFA5J.js} +59 -12
  10. package/dist/chunks/{chunk-3HBPNQ4Y.js → chunk-CXAT7ZKP.js} +2 -2
  11. package/dist/chunks/chunk-E4PJNZVG.js +783 -0
  12. package/dist/chunks/{chunk-T6AZIDZD.js → chunk-F6N34UWB.js} +12 -244
  13. package/dist/chunks/{chunk-RUPD4TLT.js → chunk-KC4KDJ5K.js} +147 -26
  14. package/dist/chunks/{chunk-I7AN3DIJ.js → chunk-L36GBUBB.js} +1626 -676
  15. package/dist/chunks/{chunk-XZCDA5PE.js → chunk-OX7X4B2L.js} +7 -2
  16. package/dist/chunks/{chunk-UUBZTGLV.js → chunk-PN5ULTTH.js} +140 -130
  17. package/dist/chunks/chunk-QUHY6FGN.js +108 -0
  18. package/dist/chunks/chunk-QVS7HRU7.js +74 -0
  19. package/dist/chunks/{chunk-UC6DULWY.js → chunk-R7XVBZOY.js} +130 -39
  20. package/dist/chunks/{chunk-LUOHJ3LB.js → chunk-RAQEXKL6.js} +1120 -465
  21. package/dist/chunks/{chunk-GJOEPJJL.js → chunk-SZEURWRS.js} +446 -52
  22. package/dist/chunks/chunk-TJNFVNKR.js +246 -0
  23. package/dist/chunks/{chunk-BW2ADH7U.js → chunk-VUPZH7J2.js} +1 -1
  24. package/dist/chunks/{chunk-HDL4WKIB.js → chunk-XEVHP5ZW.js} +2 -2
  25. package/dist/chunks/{chunk-VH2POPW5.js → chunk-YV7GE6EV.js} +635 -79
  26. package/dist/chunks/{chunk-GQIL3AHY.js → chunk-ZG3WQ4UF.js} +1 -1
  27. package/dist/chunks/{live-app-SZGEILCQ.js → live-app-PI3BAN6Y.js} +28 -23
  28. package/dist/command-tree.d.ts +2 -2
  29. package/dist/command-tree.js +2 -2
  30. package/dist/commands/exec/across-sandboxes-outcomes.d.ts +364 -0
  31. package/dist/commands/exec/across-sandboxes-outcomes.js +229 -0
  32. package/dist/commands/exec/across-sandboxes-run.d.ts +180 -0
  33. package/dist/commands/exec/across-sandboxes-run.js +339 -0
  34. package/dist/commands/exec/command.d.ts +577 -75
  35. package/dist/commands/exec/command.js +165 -32
  36. package/dist/commands/exec/driver-plan.d.ts +8 -2
  37. package/dist/commands/exec/driver-plan.js +13 -3
  38. package/dist/commands/exec/exec-words.d.ts +17 -3
  39. package/dist/commands/exec/exec-words.js +27 -16
  40. package/dist/commands/exec/live-view.d.ts +3 -4
  41. package/dist/commands/exec/live-view.js +37 -28
  42. package/dist/commands/exec/metadata.js +2 -2
  43. package/dist/commands/exec/mint-failed.d.ts +4 -4
  44. package/dist/commands/exec/mint-failed.js +6 -6
  45. package/dist/commands/exec/outcomes.d.ts +530 -73
  46. package/dist/commands/exec/outcomes.js +202 -66
  47. package/dist/commands/exec/plan-only.d.ts +10 -0
  48. package/dist/commands/exec/plan-only.js +46 -0
  49. package/dist/commands/exec/plan-run.d.ts +54 -35
  50. package/dist/commands/exec/plan-run.js +81 -38
  51. package/dist/commands/exec/planned-outcome.d.ts +15 -0
  52. package/dist/commands/exec/planned-outcome.js +35 -0
  53. package/dist/commands/exec/progress.d.ts +2 -2
  54. package/dist/commands/exec/progress.js +35 -18
  55. package/dist/commands/exec/resource-refusals.d.ts +2 -2
  56. package/dist/commands/exec/resource-refusals.js +3 -3
  57. package/dist/commands/exec/run-bin.d.ts +1 -1
  58. package/dist/commands/exec/run-bin.js +2 -2
  59. package/dist/commands/exec/run-command.d.ts +345 -63
  60. package/dist/commands/exec/run-command.js +308 -258
  61. package/dist/commands/exec/run-metadata.d.ts +42 -8
  62. package/dist/commands/exec/run-metadata.js +40 -21
  63. package/dist/commands/exec/run-planned.d.ts +20 -0
  64. package/dist/commands/exec/run-planned.js +22 -0
  65. package/dist/commands/exec/sandbox-lines.d.ts +42 -0
  66. package/dist/commands/exec/sandbox-lines.js +59 -0
  67. package/dist/commands/exec/sandbox-progress.d.ts +30 -0
  68. package/dist/commands/exec/sandbox-progress.js +232 -0
  69. package/dist/commands/exec/sandbox-view.d.ts +19 -0
  70. package/dist/commands/exec/sandbox-view.js +72 -0
  71. package/dist/commands/exec/view.d.ts +3 -2
  72. package/dist/commands/exec/view.js +10 -6
  73. package/dist/commands/runs/facts.d.ts +51 -9
  74. package/dist/commands/runs/facts.js +49 -29
  75. package/dist/commands/runs/list/command.d.ts +80 -4
  76. package/dist/commands/runs/list/command.js +11 -10
  77. package/dist/commands/runs/list/metadata.js +1 -1
  78. package/dist/commands/runs/list/outcomes.d.ts +40 -2
  79. package/dist/commands/runs/logs/command.d.ts +103 -8
  80. package/dist/commands/runs/logs/command.js +139 -24
  81. package/dist/commands/runs/logs/metadata.d.ts +4 -0
  82. package/dist/commands/runs/logs/metadata.js +14 -7
  83. package/dist/commands/runs/logs/outcomes.d.ts +49 -2
  84. package/dist/commands/runs/logs/outcomes.js +110 -6
  85. package/dist/commands/runs/past-run.d.ts +77 -6
  86. package/dist/commands/runs/past-run.js +133 -4
  87. package/dist/commands/runs/show/command.d.ts +568 -10
  88. package/dist/commands/runs/show/command.js +634 -119
  89. package/dist/commands/runs/show/metadata.d.ts +17 -0
  90. package/dist/commands/runs/show/metadata.js +48 -7
  91. package/dist/commands/runs/show/outcomes.d.ts +276 -5
  92. package/dist/commands/runs/show/outcomes.js +484 -96
  93. package/dist/commands/snapshots/build/command.d.ts +109 -18
  94. package/dist/commands/snapshots/build/command.js +72 -36
  95. package/dist/commands/snapshots/build/metadata.d.ts +4 -0
  96. package/dist/commands/snapshots/build/metadata.js +5 -1
  97. package/dist/commands/snapshots/build/outcomes.d.ts +53 -8
  98. package/dist/commands/snapshots/build/outcomes.js +26 -3
  99. package/dist/commands/snapshots/list/command.d.ts +72 -7
  100. package/dist/commands/snapshots/list/command.js +57 -24
  101. package/dist/commands/snapshots/list/metadata.d.ts +4 -0
  102. package/dist/commands/snapshots/list/metadata.js +4 -0
  103. package/dist/commands/snapshots/list/outcomes.d.ts +31 -0
  104. package/dist/commands/snapshots/list/outcomes.js +25 -2
  105. package/dist/commands/suites/list/command.d.ts +129 -0
  106. package/dist/commands/suites/list/command.js +162 -0
  107. package/dist/commands/suites/list/metadata.d.ts +11 -0
  108. package/dist/commands/suites/list/metadata.js +15 -0
  109. package/dist/commands/suites/list/outcomes.d.ts +91 -0
  110. package/dist/commands/suites/list/outcomes.js +122 -0
  111. package/dist/commands/suites/metadata.js +8 -0
  112. package/dist/commands/test/command.d.ts +1389 -0
  113. package/dist/commands/test/command.js +583 -0
  114. package/dist/commands/test/metadata.js +8 -0
  115. package/dist/commands/test/outcomes.d.ts +765 -0
  116. package/dist/commands/test/outcomes.js +140 -0
  117. package/dist/commands/test/plan.d.ts +92 -0
  118. package/dist/commands/test/plan.js +128 -0
  119. package/dist/commands/test/test-words.d.ts +12 -0
  120. package/dist/commands/test/test-words.js +42 -0
  121. package/dist/config/check-resources.d.ts +14 -0
  122. package/dist/config/check-resources.js +98 -0
  123. package/dist/config/check-runner.d.ts +13 -0
  124. package/dist/config/check-runner.js +54 -0
  125. package/dist/config/check-suites.d.ts +14 -0
  126. package/dist/config/check-suites.js +99 -0
  127. package/dist/config/gateways.d.ts +24 -0
  128. package/dist/config/index.d.ts +6 -3
  129. package/dist/config/index.js +3 -1
  130. package/dist/config/live/file-lists-file-gateway.d.ts +4 -0
  131. package/dist/config/live/file-lists-file-gateway.js +27 -0
  132. package/dist/config/load.d.ts +11 -10
  133. package/dist/config/load.js +35 -103
  134. package/dist/config/recipe-run.d.ts +8 -1
  135. package/dist/config/recipe-run.js +2 -1
  136. package/dist/config/resolve.d.ts +3 -2
  137. package/dist/config/resolve.js +6 -3
  138. package/dist/config/resolver.d.ts +20 -6
  139. package/dist/config/resolver.js +11 -8
  140. package/dist/config/runner.d.ts +24 -0
  141. package/dist/config/runner.js +4 -0
  142. package/dist/config/schema.d.ts +26 -18
  143. package/dist/config/schema.js +41 -9
  144. package/dist/config/settings-file.d.ts +9 -3
  145. package/dist/config/settings-file.js +41 -4
  146. package/dist/config/suite.d.ts +39 -0
  147. package/dist/config/suite.js +5 -0
  148. package/dist/config-file/define.d.ts +49 -18
  149. package/dist/config-file/define.js +9 -8
  150. package/dist/config-file/runner.d.ts +12 -0
  151. package/dist/config-file/runner.js +9 -0
  152. package/dist/context.d.ts +12 -8
  153. package/dist/context.js +9 -3
  154. package/dist/core/across-sandboxes.d.ts +43 -0
  155. package/dist/core/across-sandboxes.js +319 -0
  156. package/dist/core/before-run.d.ts +5 -3
  157. package/dist/core/before-run.js +12 -1
  158. package/dist/core/events.d.ts +62 -6
  159. package/dist/core/events.js +14 -0
  160. package/dist/core/index.d.ts +4 -2
  161. package/dist/core/index.js +3 -1
  162. package/dist/core/payload.d.ts +2 -1
  163. package/dist/core/payload.js +2 -1
  164. package/dist/core/presentations.js +1 -1
  165. package/dist/core/resource.d.ts +1 -1
  166. package/dist/core/resources.d.ts +56 -6
  167. package/dist/core/resources.js +81 -5
  168. package/dist/core/run-state.js +9 -0
  169. package/dist/core/run.d.ts +77 -15
  170. package/dist/core/run.js +150 -86
  171. package/dist/core/sandbox-end.d.ts +64 -0
  172. package/dist/core/sandbox-end.js +128 -0
  173. package/dist/core/timeline.d.ts +4 -4
  174. package/dist/core/timeline.js +3 -3
  175. package/dist/credential/live/vercel-cli-gateway.d.ts +7 -0
  176. package/dist/credential/live/vercel-cli-gateway.js +14 -1
  177. package/dist/extensions/github/context.d.ts +1 -1
  178. package/dist/extensions/github/definition.d.ts +11 -9
  179. package/dist/extensions/github/definition.js +8 -6
  180. package/dist/extensions/github/extension.d.ts +3 -3
  181. package/dist/extensions/github/fixture-repo.d.ts +21 -2
  182. package/dist/extensions/github/fixture-repo.js +31 -2
  183. package/dist/extensions/github/index.d.ts +2 -2
  184. package/dist/extensions/github/index.js +2 -2
  185. package/dist/extensions/github/lifecycle.d.ts +16 -6
  186. package/dist/extensions/github/lifecycle.js +42 -25
  187. package/dist/extensions/github/options.d.ts +17 -11
  188. package/dist/extensions/github/options.js +14 -13
  189. package/dist/extensions/github/refusals.d.ts +23 -6
  190. package/dist/extensions/github/refusals.js +34 -12
  191. package/dist/extensions/github/resource.d.ts +21 -12
  192. package/dist/extensions/github/resource.js +16 -8
  193. package/dist/extensions/github/run/payload.d.ts +6 -6
  194. package/dist/extensions/github/run/payload.js +3 -5
  195. package/dist/extensions/github/split.d.ts +10 -0
  196. package/dist/extensions/github/split.js +12 -0
  197. package/dist/extensions/playwright/driver.js +6 -26
  198. package/dist/extensions/playwright/extension.js +1 -1
  199. package/dist/extensions/testserver/commands/pool/create/command.js +8 -8
  200. package/dist/extensions/testserver/commands/pool/list/command.js +4 -4
  201. package/dist/extensions/testserver/definition.d.ts +4 -4
  202. package/dist/extensions/testserver/definition.js +41 -31
  203. package/dist/extensions/testserver/extension.d.ts +4 -5
  204. package/dist/extensions/testserver/extension.js +14 -41
  205. package/dist/extensions/testserver/index.d.ts +1 -1
  206. package/dist/extensions/testserver/index.js +1 -1
  207. package/dist/extensions/testserver/lifecycle.d.ts +10 -2
  208. package/dist/extensions/testserver/lifecycle.js +29 -6
  209. package/dist/extensions/testserver/options/rules.d.ts +5 -5
  210. package/dist/extensions/testserver/options/rules.js +10 -8
  211. package/dist/extensions/testserver/options/sandboxes.d.ts +4 -2
  212. package/dist/extensions/testserver/options/sandboxes.js +8 -3
  213. package/dist/extensions/testserver/pool/gateways.d.ts +29 -4
  214. package/dist/extensions/testserver/pool/index.d.ts +2 -2
  215. package/dist/extensions/testserver/pool/index.js +1 -1
  216. package/dist/extensions/testserver/pool/lease.d.ts +10 -0
  217. package/dist/extensions/testserver/pool/lease.js +21 -0
  218. package/dist/extensions/testserver/pool/live/pool-store-gateway.js +38 -3
  219. package/dist/extensions/testserver/refusals.d.ts +12 -0
  220. package/dist/extensions/testserver/refusals.js +18 -0
  221. package/dist/extensions/testserver/release.d.ts +16 -0
  222. package/dist/extensions/testserver/release.js +56 -4
  223. package/dist/extensions/testserver/resource.d.ts +4 -4
  224. package/dist/extensions/testserver/resource.js +1 -1
  225. package/dist/extensions/testserver/split.d.ts +9 -0
  226. package/dist/extensions/testserver/split.js +22 -0
  227. package/dist/extensions/testserver/vitest/fixtures.d.ts +5 -5
  228. package/dist/extensions/testserver/vitest/fixtures.js +9 -38
  229. package/dist/extensions/vitest/driver.d.ts +7 -0
  230. package/dist/extensions/vitest/driver.js +33 -37
  231. package/dist/extensions/vitest/extension.js +1 -1
  232. package/dist/extensions/vitest/plan/plan-over.d.ts +8 -1
  233. package/dist/extensions/vitest/plan/plan-over.js +16 -2
  234. package/dist/extensions.d.ts +17 -16
  235. package/dist/extensions.js +5 -4
  236. package/dist/forward-sigterm.js +1 -1
  237. package/dist/launcher-resolvers/local-services.d.ts +1 -1
  238. package/dist/live-app.js +4 -3
  239. package/dist/local-services.js +1 -1
  240. package/dist/planning/driver-file-lists.d.ts +61 -0
  241. package/dist/planning/driver-file-lists.js +66 -0
  242. package/dist/{commands/exec → planning}/driver-refusals.d.ts +11 -10
  243. package/dist/{commands/exec → planning}/driver-refusals.js +18 -14
  244. package/dist/planning/file-lists-file.d.ts +58 -0
  245. package/dist/planning/file-lists-file.js +105 -0
  246. package/dist/planning/file-lists.d.ts +28 -0
  247. package/dist/planning/file-lists.js +52 -0
  248. package/dist/{commands/exec → planning}/final-results.d.ts +1 -1
  249. package/dist/{commands/exec → planning}/final-results.js +6 -6
  250. package/dist/planning/plan-only.d.ts +81 -0
  251. package/dist/planning/plan-only.js +83 -0
  252. package/dist/{commands/exec → planning}/redaction.d.ts +2 -2
  253. package/dist/{commands/exec → planning}/redaction.js +5 -4
  254. package/dist/{commands/exec → planning}/resource-flags.d.ts +5 -12
  255. package/dist/{commands/exec → planning}/resource-flags.js +6 -16
  256. package/dist/planning/run-kind-flags.d.ts +20 -0
  257. package/dist/planning/run-kind-flags.js +48 -0
  258. package/dist/planning/run-plan.d.ts +30 -0
  259. package/dist/planning/run-plan.js +4 -0
  260. package/dist/planning/sandbox-placeholders.d.ts +22 -0
  261. package/dist/planning/sandbox-placeholders.js +60 -0
  262. package/dist/planning/suite-not-found.d.ts +37 -0
  263. package/dist/planning/suite-not-found.js +36 -0
  264. package/dist/planning/suites.d.ts +43 -0
  265. package/dist/planning/suites.js +89 -0
  266. package/dist/{commands/exec → planning}/test-plan.d.ts +8 -3
  267. package/dist/{commands/exec → planning}/test-plan.js +32 -4
  268. package/dist/playwright/reporter.d.ts +20 -8
  269. package/dist/playwright/reporter.js +195 -15
  270. package/dist/presentation.d.ts +10 -6
  271. package/dist/presentation.js +13 -15
  272. package/dist/run-directory/gateways.d.ts +60 -4
  273. package/dist/run-directory/index.d.ts +4 -4
  274. package/dist/run-directory/index.js +2 -1
  275. package/dist/run-directory/live/run-directory-gateway.js +92 -16
  276. package/dist/run-directory/plan.d.ts +35 -2
  277. package/dist/run-directory/plan.js +44 -7
  278. package/dist/run-directory/reader.d.ts +26 -5
  279. package/dist/run-directory/reader.js +24 -1
  280. package/dist/run-directory/recording.d.ts +75 -49
  281. package/dist/run-directory/recording.js +214 -28
  282. package/dist/run-directory/run-directory.d.ts +22 -1
  283. package/dist/run-directory/run-directory.js +24 -0
  284. package/dist/run-directory/run-record.d.ts +144 -21
  285. package/dist/run-directory/run-record.js +118 -19
  286. package/dist/run-directory/timeline-facts.js +4 -4
  287. package/dist/runner/build-snapshots.d.ts +7 -7
  288. package/dist/runner/build-snapshots.js +12 -16
  289. package/dist/runner/events.d.ts +29 -8
  290. package/dist/runner/gateways.d.ts +49 -6
  291. package/dist/runner/index.d.ts +6 -4
  292. package/dist/runner/index.js +3 -2
  293. package/dist/runner/live/sandbox-gateway.js +161 -31
  294. package/dist/runner/network-policy.d.ts +55 -0
  295. package/dist/runner/network-policy.js +46 -0
  296. package/dist/runner/policy-writes.d.ts +40 -0
  297. package/dist/runner/policy-writes.js +124 -0
  298. package/dist/runner/prepare.d.ts +6 -7
  299. package/dist/runner/ready.d.ts +39 -10
  300. package/dist/runner/ready.js +59 -47
  301. package/dist/runner/recipe-check.d.ts +6 -0
  302. package/dist/runner/recipe-check.js +29 -0
  303. package/dist/runner/recipe-secrets.d.ts +67 -0
  304. package/dist/runner/recipe-secrets.js +230 -0
  305. package/dist/runner/recipe.d.ts +115 -26
  306. package/dist/runner/recipe.js +147 -154
  307. package/dist/runner/sandboxed-command.d.ts +22 -8
  308. package/dist/runner/sandboxed-command.js +33 -10
  309. package/dist/runner/scope.d.ts +107 -21
  310. package/dist/runner/scope.js +274 -54
  311. package/dist/runner/secrets.d.ts +42 -31
  312. package/dist/runner/secrets.js +62 -40
  313. package/dist/runner/session.d.ts +59 -26
  314. package/dist/runner/session.js +82 -41
  315. package/dist/runner/snapshot-build.d.ts +7 -4
  316. package/dist/runner/snapshot-build.js +48 -28
  317. package/dist/runner/snapshot-choice.d.ts +37 -0
  318. package/dist/runner/snapshot-choice.js +38 -0
  319. package/dist/runner/snapshot-key.d.ts +16 -14
  320. package/dist/runner/snapshot-key.js +24 -18
  321. package/dist/runner/steps.d.ts +13 -5
  322. package/dist/runner/steps.js +34 -4
  323. package/dist/runner/time-limit.d.ts +10 -0
  324. package/dist/runner/time-limit.js +43 -0
  325. package/dist/sdk/extension/commands.d.ts +1 -7
  326. package/dist/sdk/extension/driver.d.ts +39 -46
  327. package/dist/sdk/extension/driver.js +6 -6
  328. package/dist/sdk/extension/index.d.ts +3 -3
  329. package/dist/sdk/extension/index.js +3 -4
  330. package/dist/sdk/extension/lifecycle.d.ts +52 -9
  331. package/dist/sdk/extension/lifecycle.js +1 -1
  332. package/dist/sdk/extension/resource-definition.d.ts +13 -10
  333. package/dist/sdk/extension/resource-definition.js +7 -2
  334. package/dist/sdk/extension/resource.d.ts +2 -2
  335. package/dist/sdk/extension/secret-source.d.ts +58 -0
  336. package/dist/sdk/extension/secret-source.js +78 -0
  337. package/dist/sdk/index.d.ts +2 -2
  338. package/dist/sdk/index.js +1 -1
  339. package/dist/sdk/run/launcher.d.ts +1 -1
  340. package/dist/sdk/run/launcher.js +1 -1
  341. package/dist/sdk/run/payload.d.ts +16 -1
  342. package/dist/sdk/run/payload.js +17 -2
  343. package/dist/sdk/run/redact.js +2 -2
  344. package/dist/sdk/run/test-events.d.ts +23 -6
  345. package/dist/sdk/run/test-events.js +6 -4
  346. package/dist/sdk/run/test-result-writer.d.ts +8 -3
  347. package/dist/sdk/run/test-result-writer.js +22 -2
  348. package/dist/{commands/exec → shared}/cleanup.d.ts +3 -3
  349. package/dist/{commands/exec → shared}/cleanup.js +11 -6
  350. package/dist/shared/job-summary.d.ts +19 -0
  351. package/dist/{commands/exec → shared}/job-summary.js +17 -0
  352. package/dist/shared/sandbox-table.d.ts +48 -0
  353. package/dist/shared/sandbox-table.js +109 -0
  354. package/dist/{commands/exec → shared}/snapshot-text.d.ts +1 -1
  355. package/dist/{commands/exec → shared}/tests-summary.d.ts +22 -6
  356. package/dist/{commands/exec → shared}/tests-summary.js +74 -31
  357. package/dist/{commands/exec → shared}/text.d.ts +7 -2
  358. package/dist/{commands/exec → shared}/text.js +9 -1
  359. package/dist/{commands/exec → shared}/waterfall.d.ts +8 -6
  360. package/dist/{commands/exec → shared}/waterfall.js +71 -24
  361. package/dist/shared/worker-chart.d.ts +172 -0
  362. package/dist/shared/worker-chart.js +623 -0
  363. package/dist/vitest/config.d.ts +35 -11
  364. package/dist/vitest/config.js +47 -14
  365. package/dist/vitest/index.d.ts +1 -1
  366. package/dist/vitest/index.js +3 -3
  367. package/dist/vitest/sequencer.d.ts +23 -0
  368. package/dist/vitest/sequencer.js +73 -0
  369. package/dist/vitest/setup.d.ts +1 -0
  370. package/dist/vitest/setup.js +34 -0
  371. package/dist/vitest/test-events.d.ts +32 -6
  372. package/dist/vitest/test-events.js +25 -5
  373. package/dist/vitest/test-results.d.ts +8 -3
  374. package/dist/vitest/test-results.js +6 -0
  375. package/package.json +7 -2
  376. package/skills/overview.md +21 -17
  377. package/skills/plan-runs.md +67 -0
  378. package/skills/read-run-output.md +51 -19
  379. package/dist/chunks/chunk-E3QU74NX.js +0 -49
  380. package/dist/chunks/chunk-HP54VHGY.js +0 -201
  381. package/dist/chunks/chunk-NMVODY3P.js +0 -19
  382. package/dist/chunks/chunk-TVMEKVOW.js +0 -607
  383. package/dist/commands/exec/define-run-command.d.ts +0 -671
  384. package/dist/commands/exec/define-run-command.js +0 -91
  385. package/dist/commands/exec/job-summary.d.ts +0 -10
  386. package/dist/commands/exec/worker-chart.d.ts +0 -87
  387. package/dist/commands/exec/worker-chart.js +0 -343
  388. package/dist/commands/playwright/command.d.ts +0 -661
  389. package/dist/commands/playwright/command.js +0 -31
  390. package/dist/commands/playwright/metadata.js +0 -8
  391. package/dist/commands/vitest/command.d.ts +0 -662
  392. package/dist/commands/vitest/command.js +0 -31
  393. package/dist/commands/vitest/metadata.js +0 -8
  394. package/dist/sdk/extension/ci.d.ts +0 -2
  395. package/dist/sdk/extension/ci.js +0 -6
  396. package/dist/chunks/{chunk-YM6TZV4L.js → chunk-VL7WFTVQ.js} +52 -52
  397. package/dist/commands/{playwright → suites}/metadata.d.ts +1 -1
  398. package/dist/commands/{vitest → test}/metadata.d.ts +1 -1
  399. /package/dist/{commands → shared}/dashboard.d.ts +0 -0
  400. /package/dist/{commands → shared}/dashboard.js +0 -0
  401. /package/dist/{commands/exec → shared}/snapshot-text.js +0 -0
@@ -1,91 +0,0 @@
1
- // A driver's run command: `defineRunCommand` makes the command that starts a run from a driver (`GLOSSARY.md`,
2
- // **Driver**), the one an extension brings, which the registry gives by name (`driverNamed`, `src/extensions.ts`), so
3
- // `storm vitest` and `storm playwright` are one implementation and differ only in their driver. The driver gives the
4
- // command's word, its part of the leaf help, how to find its program, count its tests when the run counts, and start
5
- // it, and what its run's summary says to do next (its hints); everything else is the run every run command shares (`runCommand`,
6
- // `run-command.ts`), which `storm exec` is made from directly too (`command.ts`).
7
- import { defineOutcomes } from "@vercel/clinkr";
8
- import { z } from "zod";
9
- import { stormCommands } from "../../command-tree.js";
10
- import { planSchema } from "../../run-directory/index.js";
11
- import { planDriverCommand } from "./driver-plan.js";
12
- import { driverRefusals } from "./driver-refusals.js";
13
- import { RAN_DESCRIPTION, RUN_ERRORS, ranRenderer, ranSchema } from "./outcomes.js";
14
- import { RUN_CLI_OPTIONS, RUN_REQUEST_FIELDS, runCommand, runProblems } from "./run-command.js";
15
- import { runHelp } from "./run-metadata.js";
16
- import { recordedPlan } from "./test-plan.js";
17
- /**
18
- * The run command of `driver`, which its `command.ts` default-exports. It takes the flags every run takes, then the
19
- * driver's arguments, and runs the driver's command in a run (`runCommand`).
20
- *
21
- * It takes any arguments (`args`), which go to the driver's program unchanged, in order, those after `--` among
22
- * them, which Clinkr reads into the same field, and `--count-tests` (`countTests`) for a driver that counts only the
23
- * test files unless asked (`Driver.countTests`), with the driver's help for it. Its part of planning the run finds the
24
- * program and, when the config file sets `testPlan` or the run takes `--count-tests`, counts its tests, or their files,
25
- * before anything is minted, acquired or started (`planDriverCommand`). The count is the run's test plan, which sizes
26
- * any resource option whose default is a function of it, and which its `ran` carries as `plan`; a run that counts
27
- * nothing has no plan, as `storm exec`'s has none. Beside every run's
28
- * errors it ends with the driver's two refusals, `no_matching_tests` and `driver_plan_failed`, in the driver's words
29
- * (`driverRefusals`). Its `ran` warns `no_final_test_results` when its program exited 0 and saved no final test
30
- * result, with the driver's steps that add storm's reporter as its next steps (`ranRenderer`).
31
- */
32
- export function defineRunCommand(driver) {
33
- const errors = driverRefusals(driver);
34
- const counted = defineOutcomes({
35
- results: {
36
- ran: {
37
- schema: ranSchema.extend({
38
- /**
39
- * The test plan of a run that counted: what the driver's plan step counted before the run, and each resource
40
- * option whose default is a function of it, with its value and where that came from. Absent for a run that
41
- * counted nothing.
42
- */
43
- plan: planSchema.exactOptional(),
44
- }),
45
- description: RAN_DESCRIPTION,
46
- render: ranRenderer(driver.hints),
47
- },
48
- },
49
- errors: { ...RUN_ERRORS, ...errors.errors },
50
- });
51
- const help = runHelp(driver.help, "args", { driver: driver.name });
52
- return stormCommands.define({
53
- requestSchema: z.object({
54
- ...RUN_REQUEST_FIELDS,
55
- ...countTestsField(driver),
56
- args: z.array(z.string()).default([]),
57
- }),
58
- cli: { options: RUN_CLI_OPTIONS, positionals: ["args"] },
59
- help: driver.countTests === undefined
60
- ? help
61
- : { ...help, fields: { ...help.fields, countTests: { description: driver.countTests.description } } },
62
- response: counted,
63
- validate: runProblems,
64
- handler: async (context, request) => await runCommand(context, request, {
65
- name: driver.name,
66
- hints: driver.hints,
67
- planCommand: async (where, signal, { testPlan }) => await planDriverCommand(context.app, driver, errors, request.args, driverCount(driver, testPlan, request.countTests === true), where, signal),
68
- ran: (facts, { testPlan, options }) => {
69
- const plan = recordedPlan(testPlan, options);
70
- return counted.ran({ ...facts, ...(plan === undefined ? {} : { plan }) });
71
- },
72
- }),
73
- });
74
- }
75
- /**
76
- * What `driver`'s run counts: nothing unless the config file sets `testPlan` or the run takes `--count-tests`; then
77
- * each test with `--count-tests` or for a driver with no `countTests`, which always counts each test, and otherwise only
78
- * the test files.
79
- */
80
- function driverCount(driver, testPlan, countTests) {
81
- if (!testPlan && !countTests)
82
- return undefined;
83
- return { countTests: driver.countTests === undefined || countTests };
84
- }
85
- /**
86
- * The request field of `--count-tests` for a driver that counts only the test files unless asked (`Driver.countTests`);
87
- * none for a driver that always counts each test, so the field is optional in the request's type.
88
- */
89
- function countTestsField(driver) {
90
- return driver.countTests === undefined ? {} : { countTests: z.boolean().default(false) };
91
- }
@@ -1,10 +0,0 @@
1
- import type { TimelineFacts } from "../../run-directory/index.ts";
2
- /**
3
- * The job summary's Markdown for `timeline`, headed with the invoking command, `storm <command>`; `details` are
4
- * lines after the critical path, such as the tests'.
5
- */
6
- export declare function jobSummaryMarkdown(timeline: TimelineFacts, extras: {
7
- readonly command: string;
8
- readonly logs: string | undefined;
9
- readonly details?: readonly string[];
10
- }): string;
@@ -1,87 +0,0 @@
1
- import { type TimelineSpan } from "../../core/index.ts";
2
- import type { DriverHints } from "../../sdk/extension/index.ts";
3
- import type { TestEvent } from "../../sdk/run/launcher.ts";
4
- import { type Paint } from "./text.ts";
5
- /** The most workers the chart draws; the rest, those that finished first, are counted on one line. */
6
- export declare const MAX_WORKER_ROWS = 16;
7
- /** A stretch of a worker's time, in milliseconds since the run started. */
8
- interface Span {
9
- readonly startMs: number;
10
- readonly endMs: number;
11
- }
12
- interface FileRun extends Span {
13
- readonly file: string;
14
- /** The file as the chart names it: its file name, with as many directories as tell it from the chart's others. */
15
- readonly name: string;
16
- }
17
- /** One setup phase of a worker: its start through its finish and any warmup after it, and what its writer named. */
18
- interface SetupSpan extends Span {
19
- readonly ok: boolean;
20
- /** What the worker set up, as the phase's writer worded it. */
21
- readonly label: string;
22
- /** The resource that owns the setup, by its name. */
23
- readonly resource: string;
24
- }
25
- /**
26
- * What a test worker did, by the run's clock: the files it ran, in order, its setup phases, and how many tests it
27
- * started, each once however often it was retried.
28
- */
29
- export interface WorkerLane extends Span {
30
- /** Its worker index, from 0; its row names it one higher, so the first worker is `w1`. */
31
- readonly worker: number;
32
- readonly files: readonly FileRun[];
33
- readonly setups: readonly SetupSpan[];
34
- readonly tests: number;
35
- }
36
- /** How a worker's clock maps to the run's, and the tests lane the workers' rows stay within. */
37
- export interface WorkerClock {
38
- /** When the run started, in milliseconds since the epoch by the run's clock. */
39
- readonly runStartedAt: number;
40
- /** What to add to a worker's clock to read the run's: 0 when they share a clock. */
41
- readonly offsetMs: number;
42
- /** The tests lane, in milliseconds since the run started. */
43
- readonly tests: TimelineSpan;
44
- }
45
- /** The tests' part of the waterfall: the worker chart, and the lines after the critical path. */
46
- export interface TestsChart {
47
- readonly lanes: readonly WorkerLane[];
48
- readonly notes: readonly string[];
49
- }
50
- /**
51
- * The worker chart for `events` and the tests' lines that go with it: the totals, each resource's setup phases under
52
- * each label beside the `░` that marks them, how many of them failed beside the `×` that marks those, and what the
53
- * other glyphs mean; undefined when no worker started a file, so the summary
54
- * stands alone. `hints` are the run's driver's, for the totals of a run with no final test result; `unreadable` counts
55
- * the lines in the test events file that held none; `incomplete` is why its final read failed, when it did.
56
- */
57
- export declare function testsChart(events: readonly TestEvent[], hints: Pick<DriverHints, "noFinalResults">, unreadable: number, clock: WorkerClock, incomplete?: string): TestsChart | undefined;
58
- /**
59
- * Each worker's files and setup phases, from its events, by the run's clock, by worker; a worker that started no
60
- * file has none. A file without a `file-finished`, from a run that stopped, ends at its worker's last event. The
61
- * workers' time is moved, keeping its shape, to lie within the tests lane, however far the clocks disagree, and cut
62
- * to the lane where it is longer.
63
- */
64
- export declare function workerLanes(events: readonly TestEvent[], clock: WorkerClock): WorkerLane[];
65
- /**
66
- * What to add to a worker's clock to read the run's, from when the run heard each worker test event (`arrivedAt`, by
67
- * its clock) and when the worker reported it (`at`, by the worker's): the smallest difference, since an event arrives
68
- * no sooner than it happened. 0 without one.
69
- */
70
- export declare function workerClockOffset(heard: readonly {
71
- readonly at: number;
72
- readonly arrivedAt: number;
73
- }[]): number;
74
- /** The label column the worker chart needs at `width` columns: its widest label, cut to fit, and a space. */
75
- export declare function workerLabelWidth(lanes: readonly WorkerLane[], width: number): number;
76
- /** How the waterfall lays out the worker chart: its label column, where a time falls, its width and its paint. */
77
- export interface WorkerLayout {
78
- readonly labelWidth: number;
79
- readonly column: (ms: number) => number;
80
- readonly width: number;
81
- readonly paint: Paint;
82
- }
83
- /** The worker chart's lines: a row for each worker shown, then how many more there are. */
84
- export declare function workerLaneLines(lanes: readonly WorkerLane[], layout: WorkerLayout): string[];
85
- /** The columns the worker chart needs after its longest bar: `▏` and the widest tail. */
86
- export declare function workerTailWidth(lanes: readonly WorkerLane[]): number;
87
- export {};
@@ -1,343 +0,0 @@
1
- // The worker chart: the tests lane's breakdown in the waterfall, a row for each test worker under the `tests` row, on
2
- // the waterfall's time axis. A row names the worker (`w1`, the first worker, whose worker index is 0) and its first
3
- // test file, shows its files one after another and its setup phases among them, and says how long it ran and how many
4
- // tests it started. The row that ends last ran the file the run waited on. It reads the same with or without color,
5
- // at 80 columns.
6
- import { setupPhaseKey } from "../../core/index.js";
7
- import { setupWordsOf, testsSummary } from "./tests-summary.js";
8
- import { seconds, truncate, visibleLength } from "./text.js";
9
- /** The most workers the chart draws; the rest, those that finished first, are counted on one line. */
10
- export const MAX_WORKER_ROWS = 16;
11
- /** The widest a worker's label gets, as a share of the width and at most, its file name cut to fit. */
12
- const MAX_LABEL_SHARE = 0.3;
13
- const MAX_LABEL_WIDTH = 32;
14
- /** How far a worker's label is indented under the `tests` label. */
15
- const INDENT = " ";
16
- /**
17
- * The worker chart for `events` and the tests' lines that go with it: the totals, each resource's setup phases under
18
- * each label beside the `░` that marks them, how many of them failed beside the `×` that marks those, and what the
19
- * other glyphs mean; undefined when no worker started a file, so the summary
20
- * stands alone. `hints` are the run's driver's, for the totals of a run with no final test result; `unreadable` counts
21
- * the lines in the test events file that held none; `incomplete` is why its final read failed, when it did.
22
- */
23
- export function testsChart(events, hints, unreadable, clock, incomplete) {
24
- const lanes = workerLanes(events, clock);
25
- if (lanes.length === 0)
26
- return undefined;
27
- const summary = testsSummary(events, hints, unreadable, incomplete);
28
- const notes = [
29
- summary.tests,
30
- ...summary.setups.map((line) => ` ░ ${line}`),
31
- ...failedSetupsText(lanes, setupWordsOf(events)).map((line) => ` × ${line}`),
32
- lanes.some((lane) => lane.files.length > 1) ? " █▓ a worker's files, in turn" : undefined,
33
- summary.unreadable,
34
- summary.incomplete,
35
- ].filter((line) => line !== undefined);
36
- return { lanes, notes };
37
- }
38
- /**
39
- * `2 <label> starts failed` for each resource's failed setup phases under each label (`setupPhaseKey`), worded as the
40
- * summary words them (`words`), in the order each first failed in `lanes`; none when none failed.
41
- */
42
- function failedSetupsText(lanes, words) {
43
- const failed = new Map();
44
- for (const setup of lanes.flatMap((lane) => lane.setups)) {
45
- if (setup.ok)
46
- continue;
47
- const key = setupPhaseKey(setup);
48
- const group = failed.get(key) ?? { label: words(setup), count: 0 };
49
- failed.set(key, group);
50
- group.count += 1;
51
- }
52
- return [...failed.values()].map(({ label, count }) => `${count} ${label} ${count === 1 ? "start" : "starts"} failed`);
53
- }
54
- /**
55
- * Each worker's files and setup phases, from its events, by the run's clock, by worker; a worker that started no
56
- * file has none. A file without a `file-finished`, from a run that stopped, ends at its worker's last event. The
57
- * workers' time is moved, keeping its shape, to lie within the tests lane, however far the clocks disagree, and cut
58
- * to the lane where it is longer.
59
- */
60
- export function workerLanes(events, clock) {
61
- const reported = events.filter((event) => event.kind !== "test-result");
62
- const lanes = lanesOf(reported, clock.runStartedAt - clock.offsetMs);
63
- if (lanes.length === 0)
64
- return [];
65
- let first = Infinity;
66
- let last = -Infinity;
67
- for (const lane of lanes) {
68
- first = Math.min(first, lane.startMs);
69
- last = Math.max(last, lane.endMs);
70
- }
71
- const { startMs, endMs } = clock.tests;
72
- const shift = first < startMs ? startMs - first : last > endMs ? Math.max(startMs - first, endMs - last) : 0;
73
- const within = (ms) => Math.min(Math.max(ms + shift, startMs), endMs);
74
- const moved = (span) => ({ ...span, startMs: within(span.startMs), endMs: within(span.endMs) });
75
- const names = fileNames(lanes.flatMap((lane) => lane.files.map((run) => run.file)));
76
- return lanes.map((lane) => ({
77
- ...moved(lane),
78
- files: lane.files.map((run) => ({ ...moved(run), name: names.get(run.file) ?? run.file })),
79
- setups: lane.setups.map(moved),
80
- }));
81
- }
82
- /**
83
- * How the chart names each of `files`: its file name, such as `teams.test.ts`, or with as many of its directories as
84
- * tell it from another file of the same name, such as `env/teams.test.ts` beside `link/teams.test.ts`.
85
- */
86
- function fileNames(files) {
87
- const distinct = [...new Set(files)];
88
- const parts = new Map(distinct.map((file) => [file, file.split("/").filter((part) => part !== "")]));
89
- const names = new Map();
90
- for (const file of distinct) {
91
- const own = parts.get(file) ?? [file];
92
- for (let depth = 1; depth <= own.length; depth += 1) {
93
- const name = own.slice(-depth).join("/");
94
- const shared = distinct.some((other) => other !== file && (parts.get(other) ?? []).slice(-depth).join("/") === name);
95
- if (!shared || depth === own.length) {
96
- names.set(file, name);
97
- break;
98
- }
99
- }
100
- }
101
- return names;
102
- }
103
- /**
104
- * What to add to a worker's clock to read the run's, from when the run heard each worker test event (`arrivedAt`, by
105
- * its clock) and when the worker reported it (`at`, by the worker's): the smallest difference, since an event arrives
106
- * no sooner than it happened. 0 without one.
107
- */
108
- export function workerClockOffset(heard) {
109
- let offset = Infinity;
110
- for (const { at, arrivedAt } of heard)
111
- offset = Math.min(offset, arrivedAt - at);
112
- return offset === Infinity ? 0 : offset;
113
- }
114
- /** The label column the worker chart needs at `width` columns: its widest label, cut to fit, and a space. */
115
- export function workerLabelWidth(lanes, width) {
116
- const digits = digitsOf(lanes);
117
- const most = labelRoom(width);
118
- let widest = 0;
119
- for (const lane of shownLanes(lanes))
120
- widest = Math.max(widest, labelText(lane, digits, most).length);
121
- return widest + 1;
122
- }
123
- /** The most columns a worker's label takes at `width` columns. */
124
- function labelRoom(width) {
125
- return Math.min(MAX_LABEL_WIDTH, Math.floor(width * MAX_LABEL_SHARE));
126
- }
127
- /** The worker chart's lines: a row for each worker shown, then how many more there are. */
128
- export function workerLaneLines(lanes, layout) {
129
- const shown = shownLanes(lanes);
130
- const digits = digitsOf(lanes);
131
- let lastMs = -Infinity;
132
- for (const lane of lanes)
133
- lastMs = Math.max(lastMs, lane.endMs);
134
- const lines = shown.flatMap((lane) => laneLines(lane, digits, layout, lane.endMs === lastMs));
135
- const hidden = lanes.filter((lane) => !shown.includes(lane));
136
- if (hidden.length > 0) {
137
- let doneMs = -Infinity;
138
- for (const lane of hidden)
139
- doneMs = Math.max(doneMs, lane.endMs - lane.startMs);
140
- lines.push(`${" ".repeat(layout.labelWidth)}+${hidden.length} more workers, each done within ${seconds(doneMs)}`);
141
- }
142
- return lines;
143
- }
144
- /** Each worker's files and setup phases, with times in milliseconds after `origin` by the worker's clock. */
145
- function lanesOf(events, origin) {
146
- const byWorker = new Map();
147
- for (const event of events) {
148
- const own = byWorker.get(event.worker);
149
- if (own === undefined)
150
- byWorker.set(event.worker, [event]);
151
- else
152
- own.push(event);
153
- }
154
- const lanes = [];
155
- for (const [worker, own] of [...byWorker].toSorted(([a], [b]) => a - b)) {
156
- const files = [];
157
- const setups = [];
158
- const tests = new Set();
159
- const openFiles = new Map();
160
- // The setup phases under way, each by its file and what it sets up: one a run stopped has no finish.
161
- const settingUp = new Map();
162
- const phase = (event) => `${event.file}\u0000${setupPhaseKey(event)}`;
163
- let lastMs = -Infinity;
164
- for (const event of own) {
165
- const atMs = event.at - origin;
166
- lastMs = Math.max(lastMs, atMs);
167
- switch (event.kind) {
168
- case "file-started":
169
- openFiles.set(event.file, atMs);
170
- break;
171
- case "file-finished": {
172
- const startMs = openFiles.get(event.file);
173
- if (startMs !== undefined)
174
- files.push({ file: event.file, startMs, endMs: atMs });
175
- openFiles.delete(event.file);
176
- break;
177
- }
178
- case "setup-started":
179
- settingUp.set(phase(event), { startMs: atMs, label: event.label, resource: event.resource });
180
- break;
181
- case "setup-finished":
182
- // The span covers the setup and any warmup after it, which the event comes after.
183
- setups.push({
184
- startMs: atMs - event.ms - (event.warmupMs ?? 0),
185
- endMs: atMs,
186
- ok: event.ok,
187
- label: event.label,
188
- resource: event.resource,
189
- });
190
- settingUp.delete(phase(event));
191
- break;
192
- case "test-started":
193
- tests.add(`${event.file}\u0000${event.test}`);
194
- break;
195
- case "test-attempt-finished":
196
- break;
197
- }
198
- }
199
- for (const [file, startMs] of openFiles)
200
- files.push({ file, startMs, endMs: lastMs });
201
- for (const setup of settingUp.values())
202
- setups.push({ ...setup, endMs: lastMs, ok: true });
203
- if (files.length === 0)
204
- continue;
205
- files.sort((a, b) => a.startMs - b.startMs);
206
- let startMs = Infinity;
207
- let endMs = -Infinity;
208
- for (const run of files) {
209
- startMs = Math.min(startMs, run.startMs);
210
- endMs = Math.max(endMs, run.endMs);
211
- }
212
- lanes.push({
213
- worker,
214
- files: files.map((run) => ({ ...run, name: run.file })),
215
- setups,
216
- startMs,
217
- endMs,
218
- tests: tests.size,
219
- });
220
- }
221
- return lanes;
222
- }
223
- /** The workers the chart draws: all of them, or past `MAX_WORKER_ROWS` those that finished last, by worker. */
224
- function shownLanes(lanes) {
225
- if (lanes.length <= MAX_WORKER_ROWS)
226
- return lanes;
227
- return [...lanes]
228
- .toSorted((a, b) => b.endMs - a.endMs || a.worker - b.worker)
229
- .slice(0, MAX_WORKER_ROWS)
230
- .toSorted((a, b) => a.worker - b.worker);
231
- }
232
- /** A worker's number as its row names it: its worker index and one, so the workers count from `w1`. */
233
- function workerNumber(lane) {
234
- return lane.worker + 1;
235
- }
236
- function digitsOf(lanes) {
237
- let worker = 1;
238
- for (const lane of lanes)
239
- worker = Math.max(worker, workerNumber(lane));
240
- return String(worker).length;
241
- }
242
- /**
243
- * A worker's label, at most `room` columns: indented, `w` and its number, its first file, and how many more files it
244
- * ran.
245
- */
246
- function labelText(lane, digits, room) {
247
- const [first] = lane.files;
248
- const more = lane.files.length > 1 ? ` +${lane.files.length - 1}` : "";
249
- const head = `${INDENT}w${String(workerNumber(lane)).padEnd(digits)} `;
250
- const name = first?.name ?? "";
251
- return `${head}${shortened(name, Math.max(1, room - head.length - more.length))}${more}`;
252
- }
253
- /**
254
- * `name` in at most `room` columns: whole when it fits, else with the end of its stem cut to `…`, keeping its test
255
- * file extension, such as `existi….test.ts`, and cut at the end when not even that fits.
256
- */
257
- function shortened(name, room) {
258
- if (name.length <= room)
259
- return name;
260
- const extension = /(\.(test|spec))?\.[cm]?[jt]sx?$/.exec(name)?.[0] ?? "";
261
- const stemRoom = room - extension.length - 1;
262
- if (extension === "" || stemRoom < 1)
263
- return truncate(name, room);
264
- return `${name.slice(0, stemRoom)}…${extension}`;
265
- }
266
- /** What follows a worker's bar: how long it ran, and how many tests it started; its label counts its files. */
267
- function tailText(lane) {
268
- const tests = lane.tests === 0 ? "" : ` · ${lane.tests} ${lane.tests === 1 ? "test" : "tests"}`;
269
- return ` ${seconds(lane.endMs - lane.startMs)}${tests}`;
270
- }
271
- /** The columns the worker chart needs after its longest bar: `▏` and the widest tail. */
272
- export function workerTailWidth(lanes) {
273
- let widest = 0;
274
- for (const lane of shownLanes(lanes))
275
- widest = Math.max(widest, tailText(lane).length);
276
- return widest + 1;
277
- }
278
- const GLYPH = { file: "█", "next-file": "▓", setup: "░", "failed-setup": "×" };
279
- /**
280
- * A worker's row: its bar, how long it ran from its first file's start to its last's finish, and, when it ran several,
281
- * its files with their times when they fit on the row. The worker the run waited on lists its files on their own line
282
- * when they don't; the others' labels count them.
283
- */
284
- function laneLines(lane, digits, layout, waitedOn) {
285
- const { labelWidth, column, width, paint } = layout;
286
- const startColumn = column(lane.startMs);
287
- const endColumn = Math.max(startColumn, column(lane.endMs));
288
- const cells = Array.from({ length: endColumn }, () => undefined);
289
- const fill = (span, cell, atLeastOne = false) => {
290
- const from = Math.min(Math.max(column(span.startMs), startColumn), endColumn);
291
- const to = Math.min(Math.max(column(span.endMs), atLeastOne ? from + 1 : from), endColumn);
292
- for (let index = from; index < to; index += 1)
293
- cells[index] = cell;
294
- };
295
- lane.files.forEach((run, index) => fill(run, index % 2 === 0 ? "file" : "next-file"));
296
- for (const setup of lane.setups)
297
- fill(setup, setup.ok ? "setup" : "failed-setup", !setup.ok);
298
- const label = labelText(lane, digits, Math.min(labelWidth - 1, labelRoom(width))).padEnd(labelWidth);
299
- const text = tailText(lane);
300
- const line = `${label}${paintedBar(cells, paint, waitedOn)}▏${text}`;
301
- if (lane.files.length < 2)
302
- return [line];
303
- const plainWidth = label.length + cells.length + 1 + text.length;
304
- const names = lane.files.map((run) => `${run.name} ${seconds(run.endMs - run.startMs)}`);
305
- const sameLine = names.join(" · ");
306
- if (plainWidth + 3 + visibleLength(sameLine) <= width)
307
- return [`${line} ${sameLine}`];
308
- if (!waitedOn)
309
- return [line];
310
- return [line, `${" ".repeat(labelWidth)}${fittingNames(names, width - labelWidth)}`];
311
- }
312
- /** The bar's cells as text: files painted to stand out on the row the run waited on, setup phases faint. */
313
- function paintedBar(cells, paint, waitedOn) {
314
- let text = "";
315
- let index = 0;
316
- while (index < cells.length) {
317
- const cell = cells[index];
318
- let end = index + 1;
319
- while (end < cells.length && cells[end] === cell)
320
- end += 1;
321
- const run = cell === undefined ? " ".repeat(end - index) : GLYPH[cell].repeat(end - index);
322
- if (cell === "setup")
323
- text += paint.faint(run);
324
- else if (cell === "failed-setup")
325
- text += paint.failed(run);
326
- else if (cell !== undefined && waitedOn)
327
- text += paint.active(run);
328
- else
329
- text += run;
330
- index = end;
331
- }
332
- return text;
333
- }
334
- /** As many of `names` as fit in `room` columns, joined by ` · `, ending in `+N more` when some don't. */
335
- function fittingNames(names, room) {
336
- for (let count = names.length; count > 0; count -= 1) {
337
- const kept = [...names.slice(0, count), ...(count < names.length ? [`+${names.length - count} more`] : [])];
338
- const text = kept.join(" · ");
339
- if (visibleLength(text) <= room)
340
- return text;
341
- }
342
- return `+${names.length} more`;
343
- }