@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,27 +1,60 @@
1
- // storm's Vitest config helpers, exported as `@vercel/storm/vitest/config`: the reporters a project's
2
- // `vitest.config.ts` lists under a storm run. A config file imports this, never an extension's Vitest fixtures: loading
3
- // a fixture's `test` extends vitest's, which throws inside a config file. So nothing here imports vitest.
1
+ // storm's Vitest config helpers, exported as `@vercel/storm/vitest/config`: the reporters, setup file, and sequencer a
2
+ // project's `vitest.config.ts` uses under a storm run. A config file imports this, never an extension's Vitest
3
+ // fixtures: loading a fixture's `test` extends vitest's, which throws inside a config file. So nothing here imports
4
+ // `vitest`, the entry of a test file, and nothing from Vitest at all as it loads. The setup file (`setup.ts`) imports
5
+ // `vitest` and Vitest loads it in its workers by its path; the sequencer (`sequencer.ts`) imports `vitest/node`, the
6
+ // entry of Vitest's main process, only when Vitest calls it.
7
+ import { extname } from "node:path";
8
+ import { fileURLToPath } from "node:url";
4
9
  import { readRunPayload, RUN_PAYLOAD_VARIABLE } from "../sdk/index.js";
10
+ import { createStormSequencer } from "./sequencer.js";
5
11
  import { testResultReporter } from "./test-results.js";
6
- /**
7
- * A vitest reporter for a project's config under a storm run: it appends each test's final result, retries settled, to the
8
- * run payload's `testEvents` file, which the run counts the tests from. It prints nothing, so list it beside
9
- * the reporter a person reads, `reporters: ["default", stormReporter()]`; a `--reporter` given to vitest on the
10
- * command line replaces both. Outside a storm run, or when the run payload names no test events file, it
11
- * reports nothing, and once an append fails it drops every later result: it never fails a test.
12
- */
12
+ /** A vitest reporter for a project's config under a storm run. */
13
13
  export function stormReporter(options = {}) {
14
14
  return testResultReporter(options.env ?? process.env);
15
15
  }
16
16
  /**
17
- * The reporters for a project's config under a storm run: vitest's `default`, which names each file
18
- * and its slow or failed tests as each file finishes, or under a run's `--verbose` its `verbose`, which names
19
- * each test as it finishes; and `stormReporter()`. With `STORM_RUN` unset or empty it picks `default`.
20
- * Throws a `RunPayloadError` when `STORM_RUN` holds no valid run payload.
17
+ * storm's Vitest setup file (`setup.ts`), by its path: beside this module, with this module's extension, `.ts` from
18
+ * source and `.js` in a build. A path, not a module name, because storm is published under two package names.
21
19
  */
20
+ const SETUP_FILE = fileURLToPath(new URL(`./setup${extname(import.meta.url)}`, import.meta.url));
21
+ /** The reporters for a project's config under a storm run: `default` (or `verbose`) and `stormReporter()`. */
22
22
  export function stormReporters(options = {}) {
23
23
  const env = options.env ?? process.env;
24
24
  const raw = env[RUN_PAYLOAD_VARIABLE];
25
25
  const verbose = raw !== undefined && raw !== "" && readRunPayload(env).verbose === true;
26
26
  return [verbose ? "verbose" : "default", stormReporter({ env })];
27
27
  }
28
+ /**
29
+ * The absolute path to storm's Vitest setup file, whose hooks report each file's start and finish and each test
30
+ * attempt from inside each worker. It reports nothing outside a storm run.
31
+ */
32
+ export function stormSetupFile() {
33
+ return SETUP_FILE;
34
+ }
35
+ /**
36
+ * A Vitest `sequence.sequencer` class for a project's config under a storm run: Vitest's own `BaseSequencer`, which in
37
+ * a run across runner sandboxes first keeps only the test files of this runner sandbox's file list, `sandbox.files` in
38
+ * `STORM_RUN`. It keeps each test file's project and `file:line` selectors as Vitest gave them. The order of the test
39
+ * files, and Vitest's own `--shard`, are the installed Vitest's. Outside a run across runner sandboxes it is Vitest's
40
+ * `BaseSequencer`, unchanged.
41
+ */
42
+ export function stormSequencer(options = {}) {
43
+ return createStormSequencer(options.env ?? process.env, options.cwd);
44
+ }
45
+ /**
46
+ * Convenience helper for `vitest.config.ts`: when `STORM_RUN` is set, returns `{ reporters: stormReporters(),
47
+ * setupFiles: [stormSetupFile()], sequence: { sequencer: stormSequencer() } }`; when unset or empty, returns `{}` so
48
+ * Vitest uses its own defaults.
49
+ */
50
+ export function stormVitestConfig(options = {}) {
51
+ const env = options.env ?? process.env;
52
+ const raw = env[RUN_PAYLOAD_VARIABLE];
53
+ if (raw === undefined || raw === "")
54
+ return {};
55
+ return {
56
+ reporters: stormReporters({ env }),
57
+ setupFiles: [SETUP_FILE],
58
+ sequence: { sequencer: stormSequencer({ env, ...(options.cwd === undefined ? {} : { cwd: options.cwd }) }) },
59
+ };
60
+ }
@@ -1,3 +1,3 @@
1
1
  export { acquireOwned, Acquisitions } from "./ownership.ts";
2
- export { countTests, testEventReporter, testEventState } from "./test-events.ts";
2
+ export { testEventReporter } from "./test-events.ts";
3
3
  export { workerIndex } from "./worker-index.ts";
@@ -1,7 +1,7 @@
1
1
  // storm's Vitest library's entry for an extension's Vitest fixtures, not a published export: owning what a
2
2
  // fixture acquires (`acquireOwned`, `Acquisitions`), a worker's test events (`testEventReporter`, the run API's writer
3
- // for this worker, and the helpers that read Vitest's tasks for it) and a worker's worker index (`workerIndex`). The launcher imports nothing here, and a `vitest.config.ts` only
4
- // `config.ts`.
3
+ // for this worker, which a fixture writes its setup phases with), and a worker's worker index (`workerIndex`). The
4
+ // launcher imports nothing here, and a `vitest.config.ts` only `config.ts`.
5
5
  export { acquireOwned, Acquisitions } from "./ownership.js";
6
- export { countTests, testEventReporter, testEventState } from "./test-events.js";
6
+ export { testEventReporter } from "./test-events.js";
7
7
  export { workerIndex } from "./worker-index.js";
@@ -0,0 +1,23 @@
1
+ import type { TestSequencerConstructor } from "vitest/node";
2
+ /**
3
+ * This runner sandbox's file list, from the run payload in `env`: undefined outside a storm run, in a run that is not
4
+ * across runner sandboxes, and in a run across runner sandboxes that gives its runner sandboxes no list, as
5
+ * `storm exec --sandboxes` does. Throws a `RunPayloadError` when `STORM_RUN` holds no valid run payload.
6
+ */
7
+ export declare function payloadFileList(env: Readonly<Record<string, string | undefined>>): ReadonlySet<string> | undefined;
8
+ /**
9
+ * The test files among `specs` that file list `list` holds, in the order given. A file list names each test file
10
+ * as storm listed it, relative to the directory the run started in (`cwd`), which is Vitest's `root` unless the config
11
+ * sets another. So a test file matches by its path relative to either.
12
+ */
13
+ export declare function inFileList<Spec extends {
14
+ readonly moduleId: string;
15
+ }>(specs: readonly Spec[], list: ReadonlySet<string>, where: {
16
+ readonly root: string;
17
+ readonly cwd: string;
18
+ }): Spec[];
19
+ /**
20
+ * The sequencer class for a run whose payload is in `env`, started in `cwd`. It reads the file list each time Vitest
21
+ * sorts.
22
+ */
23
+ export declare function createStormSequencer(env: Readonly<Record<string, string | undefined>>, cwd?: string): TestSequencerConstructor;
@@ -0,0 +1,73 @@
1
+ // storm's Vitest sequencer (`stormSequencer`): the installed Vitest's own `BaseSequencer`, which in a run across runner
2
+ // sandboxes first keeps only the test files of this runner sandbox's file list, `sandbox.files` in `STORM_RUN`. It
3
+ // changes nothing else: Vitest hands `sort()` the test files its arguments select, each as a `TestSpecification` with
4
+ // its project and its `file:line` selectors, and the sequencer returns some of those as they are.
5
+ //
6
+ // The order of the test files it keeps (`sort`) and Vitest's own `--shard` (`shard`) are the installed Vitest's: the
7
+ // sequencer hands both to a `BaseSequencer` from `vitest/node`. storm copies neither, because Vitest 4.1 and Vitest 5
8
+ // differ there, and storm supports both.
9
+ //
10
+ // It imports `vitest/node` only when Vitest calls it, and only its types before that. `vitest/node` is the entry of
11
+ // Vitest's main process, which has loaded it before it loads a config file, so the import costs a run nothing. It also
12
+ // loads Vite and its native binding, which the default test lane can't load, since that lane runs with native addons
13
+ // disabled; so a test of this library there loads this file and `config.ts` without it. `vitest`, the entry of a test
14
+ // file, is never imported here: a config file must not load it.
15
+ import { relative, resolve } from "node:path";
16
+ import { readRunPayload, RUN_PAYLOAD_VARIABLE } from "../sdk/index.js";
17
+ /** A path in the form both sides of the match take: `/` separators, and no leading `./`. */
18
+ function comparedPath(path) {
19
+ let normal = path.replaceAll("\\", "/").replace(/\/{2,}/g, "/");
20
+ while (normal.startsWith("./"))
21
+ normal = normal.slice(2);
22
+ return normal;
23
+ }
24
+ /**
25
+ * This runner sandbox's file list, from the run payload in `env`: undefined outside a storm run, in a run that is not
26
+ * across runner sandboxes, and in a run across runner sandboxes that gives its runner sandboxes no list, as
27
+ * `storm exec --sandboxes` does. Throws a `RunPayloadError` when `STORM_RUN` holds no valid run payload.
28
+ */
29
+ export function payloadFileList(env) {
30
+ const raw = env[RUN_PAYLOAD_VARIABLE];
31
+ if (raw === undefined || raw === "")
32
+ return undefined;
33
+ const files = readRunPayload(env).sandbox?.files;
34
+ return files === undefined ? undefined : new Set(files.map(comparedPath));
35
+ }
36
+ /**
37
+ * The test files among `specs` that file list `list` holds, in the order given. A file list names each test file
38
+ * as storm listed it, relative to the directory the run started in (`cwd`), which is Vitest's `root` unless the config
39
+ * sets another. So a test file matches by its path relative to either.
40
+ */
41
+ export function inFileList(specs, list, where) {
42
+ return specs.filter((spec) => {
43
+ const absolute = resolve(where.root, spec.moduleId);
44
+ return (list.has(comparedPath(relative(where.cwd, absolute))) || list.has(comparedPath(relative(where.root, absolute))));
45
+ });
46
+ }
47
+ /**
48
+ * The sequencer class for a run whose payload is in `env`, started in `cwd`. It reads the file list each time Vitest
49
+ * sorts.
50
+ */
51
+ export function createStormSequencer(env, cwd = process.cwd()) {
52
+ return class StormSequencer {
53
+ #ctx;
54
+ constructor(ctx) {
55
+ this.#ctx = ctx;
56
+ }
57
+ /** The installed Vitest's sequencer, which this one hands the order and Vitest's own `--shard` to. */
58
+ async #vitest() {
59
+ const { BaseSequencer } = await import("vitest/node");
60
+ return new BaseSequencer(this.#ctx);
61
+ }
62
+ async shard(files) {
63
+ return await (await this.#vitest()).shard(files);
64
+ }
65
+ async sort(files) {
66
+ const list = payloadFileList(env);
67
+ const kept = list === undefined ? files : inFileList(files, list, { root: this.#ctx.config.root, cwd });
68
+ // `TestSequencer.sort`, which the rule takes for `Array#sort`.
69
+ // oxlint-disable-next-line unicorn/no-array-sort
70
+ return await (await this.#vitest()).sort(kept);
71
+ }
72
+ };
73
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,34 @@
1
+ // storm's Vitest setup file, which `stormVitestConfig()` (`config.ts`) lists in a project's `setupFiles` under a storm
2
+ // run. Vitest loads it in each worker before each test file, so its hooks run for every test file, whatever the file's
3
+ // tests import: they report the file's start and finish and each attempt at a test to the run's test events
4
+ // (`workerTestProgress`, `test-events.ts`), with the worker's worker index. Vitest's reporter API doesn't say which
5
+ // worker ran a test, so only a worker can report these.
6
+ //
7
+ // Vitest registers a setup file's hooks before the test file's own, so its `beforeAll` and `beforeEach` run first: a
8
+ // file's span starts before the file's own `beforeAll` hooks, and an attempt is timed from before the test's own
9
+ // `beforeEach` hooks and before each fixture the test asks for, such as one that starts what the test runs against.
10
+ // An `auto` fixture is set up before any `beforeEach` hook, so its setup is not in the attempt's time.
11
+ // `onTestFinished` runs after the test's fixture cleanups. `afterAll` runs before Vitest cleans up the file's
12
+ // file-scoped fixtures, so a file's span doesn't hold that cleanup.
13
+ // `test/integration/vitest/setup-file.integration.test.ts` holds this order on the Vitest that runs it.
14
+ import { afterAll, beforeAll, beforeEach } from "vitest";
15
+ import { testEventsFile } from "../sdk/index.js";
16
+ import { testEventReporter, workerTestProgress } from "./test-events.js";
17
+ // Outside a storm run, or when the run payload names no test events file, there is nothing to report to.
18
+ if (testEventsFile(process.env) !== undefined) {
19
+ const progress = workerTestProgress(testEventReporter());
20
+ // oxlint-disable-next-line no-empty-pattern -- vitest requires a hook to destructure its first argument
21
+ beforeAll(({}, suite) => {
22
+ progress.fileStarted(suite.file.name);
23
+ });
24
+ // oxlint-disable-next-line no-empty-pattern -- vitest requires a hook to destructure its first argument
25
+ afterAll(({}, suite) => {
26
+ progress.fileFinished(suite.file.name);
27
+ });
28
+ beforeEach(({ task, onTestFinished }) => {
29
+ const finished = progress.attemptStarted(task);
30
+ onTestFinished(({ task: ended }) => {
31
+ finished(ended.result?.state);
32
+ });
33
+ });
34
+ }
@@ -6,9 +6,35 @@ import { type WorkerTestEventWriter } from "../sdk/index.ts";
6
6
  * event: reporting never fails a test.
7
7
  */
8
8
  export declare function testEventReporter(env?: Readonly<Record<string, string | undefined>>, append?: (path: string, text: string) => void, now?: () => number): WorkerTestEventWriter;
9
- /** The tests in a vitest file or suite, counted through its suites. */
10
- export declare function countTests(task: {
11
- readonly tasks?: readonly unknown[];
12
- }): number;
13
- /** A finished test attempt's state as a test event reports it: passed, failed, or anything else as skipped. */
14
- export declare function testEventState(state: string | undefined): "pass" | "fail" | "skip";
9
+ /** The parts of a Vitest test's task, in a worker, a worker's test events read. */
10
+ export interface ReportedTestTask {
11
+ /** Vitest's id for the test, unique within a run: the id its final result has, the reporter's `TestCase.id`. */
12
+ readonly id: string;
13
+ /** The test's name with its suites', `<describe> > <title>`, as its final result names it (`TestCase.fullName`). */
14
+ readonly fullTestName: string;
15
+ /** The test's file: its path relative to the project, and its suites and tests. */
16
+ readonly file: {
17
+ readonly name: string;
18
+ readonly tasks?: readonly unknown[];
19
+ };
20
+ }
21
+ /** What a Vitest worker reports as it runs a test file, each at the moment it happens. */
22
+ export interface WorkerTestProgress {
23
+ /** The worker started `file`, its path relative to the project. */
24
+ fileStarted(file: string): void;
25
+ /** The worker finished `file`. */
26
+ fileFinished(file: string): void;
27
+ /**
28
+ * The worker started an attempt at `task`'s test. Call what it returns once the attempt has ended, with the task's
29
+ * state then, Vitest's `task.result?.state`.
30
+ */
31
+ attemptStarted(task: ReportedTestTask): (state: string | undefined) => void;
32
+ }
33
+ /**
34
+ * A worker's file and test attempt events, written with `report`: `file-started` and `file-finished` for a file, and
35
+ * for each attempt at a test `test-started`, with the file's test count, then `test-attempt-finished`, with how it
36
+ * ended and how long it took from `attemptStarted` to the call that ends it. Both attempt events carry Vitest's id for
37
+ * the test, by which a reader joins them to the test's final result, and its full name. A retried test reports each
38
+ * attempt.
39
+ */
40
+ export declare function workerTestProgress(report: WorkerTestEventWriter, now?: () => number): WorkerTestProgress;
@@ -1,7 +1,8 @@
1
1
  // A Vitest worker's test events: the run API's writer of a worker's test events (`workerTestEventWriter`,
2
- // `src/sdk/run/worker-test-event-writer.ts`) for this worker, by its worker index (`worker-index.ts`), and how a
3
- // fixture reads what a test event says from Vitest's tasks. A test's final result comes from vitest's main process
4
- // instead (`test-results.ts`). It imports no vitest.
2
+ // `src/sdk/run/worker-test-event-writer.ts`) for this worker, by its worker index (`worker-index.ts`), and what the
3
+ // worker reports of each file it runs and each attempt at a test (`workerTestProgress`), which storm's Vitest setup
4
+ // file (`setup.ts`) calls from Vitest's hooks. A test's final result comes from vitest's main process instead
5
+ // (`test-results.ts`). It imports no vitest.
5
6
  import { workerTestEventWriter } from "../sdk/index.js";
6
7
  import { workerIndex } from "./worker-index.js";
7
8
  /**
@@ -20,8 +21,27 @@ export function testEventReporter(env = process.env, append, now) {
20
21
  }
21
22
  return workerTestEventWriter(env, worker, append, now);
22
23
  }
24
+ /**
25
+ * A worker's file and test attempt events, written with `report`: `file-started` and `file-finished` for a file, and
26
+ * for each attempt at a test `test-started`, with the file's test count, then `test-attempt-finished`, with how it
27
+ * ended and how long it took from `attemptStarted` to the call that ends it. Both attempt events carry Vitest's id for
28
+ * the test, by which a reader joins them to the test's final result, and its full name. A retried test reports each
29
+ * attempt.
30
+ */
31
+ export function workerTestProgress(report, now = Date.now) {
32
+ return {
33
+ fileStarted: (file) => report({ kind: "file-started", file }),
34
+ fileFinished: (file) => report({ kind: "file-finished", file }),
35
+ attemptStarted: (task) => {
36
+ const attempt = { file: task.file.name, id: task.id, test: task.fullTestName };
37
+ report({ kind: "test-started", ...attempt, fileTests: countTests(task.file) });
38
+ const startedAt = now();
39
+ return (state) => report({ kind: "test-attempt-finished", ...attempt, state: testEventState(state), ms: now() - startedAt });
40
+ },
41
+ };
42
+ }
23
43
  /** The tests in a vitest file or suite, counted through its suites. */
24
- export function countTests(task) {
44
+ function countTests(task) {
25
45
  let count = 0;
26
46
  for (const child of task.tasks ?? []) {
27
47
  const node = child;
@@ -33,6 +53,6 @@ export function countTests(task) {
33
53
  return count;
34
54
  }
35
55
  /** A finished test attempt's state as a test event reports it: passed, failed, or anything else as skipped. */
36
- export function testEventState(state) {
56
+ function testEventState(state) {
37
57
  return state === "pass" ? "pass" : state === "fail" ? "fail" : "skip";
38
58
  }
@@ -22,8 +22,12 @@ export interface ReportedTestCase {
22
22
  readonly flaky: boolean;
23
23
  } | undefined;
24
24
  }
25
- /** The parts of vitest's `TestModule` the reporter reads. */
26
- export interface ReportedTestModule {
25
+ /** The parts of vitest's `TestModule` the reporter reads when a module starts. */
26
+ export interface ReportedTestModuleStart {
27
+ readonly relativeModuleId?: string | undefined;
28
+ }
29
+ /** The parts of vitest's `TestModule` the reporter reads when a module ends. */
30
+ export interface ReportedTestModule extends ReportedTestModuleStart {
27
31
  readonly children: {
28
32
  allTests(): Iterable<ReportedTestCase>;
29
33
  };
@@ -36,9 +40,10 @@ export interface ReportedConsoleLog {
36
40
  readonly content: string;
37
41
  readonly taskId?: string | undefined;
38
42
  }
39
- /** A vitest reporter that appends each test's final result to the run payload's `testEvents` file. */
43
+ /** A vitest reporter that appends each test's final result and each file's start and finish to the run payload's `testEvents` file. */
40
44
  export interface StormReporter {
41
45
  onUserConsoleLog(log: ReportedConsoleLog): void;
46
+ onTestModuleStart(testModule: ReportedTestModuleStart): void;
42
47
  onTestCaseResult(testCase: ReportedTestCase): void;
43
48
  onTestModuleEnd(testModule: ReportedTestModule): void;
44
49
  onTestRunEnd(): void;
@@ -53,10 +53,16 @@ export function testResultReporter(env, append, now) {
53
53
  if (log.taskId !== undefined)
54
54
  writer.output(log.taskId, log.content);
55
55
  },
56
+ onTestModuleStart: (testModule) => {
57
+ if (testModule.relativeModuleId !== undefined)
58
+ writer.fileStarted(testModule.relativeModuleId);
59
+ },
56
60
  onTestCaseResult: report,
57
61
  onTestModuleEnd: (testModule) => {
58
62
  for (const testCase of testModule.children.allTests())
59
63
  report(testCase);
64
+ if (testModule.relativeModuleId !== undefined)
65
+ writer.fileFinished(testModule.relativeModuleId);
60
66
  },
61
67
  onTestRunEnd: () => {
62
68
  writer.end();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cnc-tools/storm",
3
- "version": "0.14.2",
3
+ "version": "0.15.0",
4
4
  "description": "A test orchestrator: run your tests in the inner loop of development, in the cloud, in a test environment that you define",
5
5
  "repository": {
6
6
  "type": "git",
@@ -163,7 +163,12 @@
163
163
  "test": "pnpm run test:default && pnpm run test:integration",
164
164
  "test:default": "vitest run --project default --project sanity",
165
165
  "test:integration": "vitest run --project integration --passWithNoTests",
166
- "test:testserver": "node bin/storm.js vitest --unsandboxed --testserver-sandboxes 2 -- --project testserver",
166
+ "test:testserver": "node bin/storm.js test --suite testserver",
167
+ "live:allowed-domains": "node scripts/live/allowed-domains-check.ts",
168
+ "live:credential": "node scripts/live/credential-check.ts",
169
+ "live:network-policy": "node scripts/live/network-policy-check.ts",
170
+ "live:network-policy-write": "node scripts/live/network-policy-write-check.ts",
171
+ "live:registry-injection": "node scripts/live/registry-injection-check.ts",
167
172
  "live:runner": "node scripts/live/runner-checks.ts"
168
173
  }
169
174
  }
@@ -1,37 +1,41 @@
1
1
  ---
2
2
  name: overview
3
- description: Start here. What a run, a run id, a run directory, test output and a run log are, and how the storm commands fit together.
4
- commands: all
3
+ description: Start here. What a run, a run id, a run directory, test output, and a run log are, and how the storm commands fit together.
5
4
  ---
6
5
 
7
6
  # Overview
8
7
 
9
- `storm vitest` runs vitest, in a runner sandbox or on this machine. When `storm.config.ts` sets `testPlan: true`, it first counts the test files on this machine, and a resource can size itself from that count. Without it, it counts nothing. `storm playwright` does the same for Playwright. `storm exec` runs a different command, such as `pnpm test`, in the same way, but it does not count tests. After the run, the `runs` commands read the run back on this machine.
8
+ `storm test` runs the project's tests declared in `storm.config.ts`, or a named suite with `--suite <name>`, in a runner sandbox or on this machine. When `storm.config.ts` sets `testPlan: true` or the command takes `--count-tests`, it first counts the test files (or each test) on this machine, and a resource can size itself from that count. `storm exec` runs any other command, such as `pnpm test`, in the same way, without counting tests. After the run, the `runs` commands read the run back on this machine.
10
9
 
11
10
  ## Concepts
12
11
 
13
- - A **run** is one `storm vitest`, one `storm playwright` or one `storm exec`. It runs one command: `vitest run` for `storm vitest`, `playwright test` for `storm playwright`, the command after `--` for `storm exec`.
14
- - A **sandboxed run** runs the command in a **runner sandbox**, a Vercel Sandbox. This is the default.
15
- - An **unsandboxed run** runs the command on this machine. Add `--unsandboxed` to make an unsandboxed run.
16
- - A **resource** is a thing that a run gets for its command, such as a set of test servers. Declare it under `resources` in `storm.config.ts`, under its resource key, or give one of its flags. The run acquires the resource before the command starts, gives the command what it needs of it in the run payload, and releases it after the command stops. Each resource adds its flags and examples to the help of `storm vitest` and `storm exec`. Its own commands are under `storm ext`.
17
- - A **run id** is the name of a run, such as `20261103T192655-8277`. It is the start time of the run in UTC and a short suffix. `storm vitest`, `storm playwright` and `storm exec` print it at the end, in the `logs` line. With `--json`, the result gives it as `runId`.
18
- - A **run directory** is the directory where a run writes what it did, on the machine that started the run. This is true for a sandboxed run and for an unsandboxed run. Its name is the run id. Do not read its files directly. Use the `runs` commands.
12
+ - A **run** is one `storm test` or one `storm exec`. It runs one command: the driver's program with arguments from the command line and `storm.config.ts` for `storm test`, or the command after `--` for `storm exec`.
13
+ - The **project's tests** are the tests and test environment declared at the top level of `storm.config.ts` (`driver`, `args`, `runner`, and `resources`). `storm test` runs them when no `--suite` is given.
14
+ - A **suite** is a named variation of the project's tests declared under `suites` in `storm.config.ts`. A suite inherits every top-level setting it does not set, the runner included. Select it with `storm test --suite <name>`, or inspect all suites with `storm suites list`.
15
+ - A **runner** is where the command runs, declared under `runner` in `storm.config.ts` with one of two peer factories from `@vercel/storm/config`: `vercelSandbox({ … })` (the **Vercel Sandbox runner**, which readies a **runner sandbox** from the runner recipe and runs the command in it) or `launchMachine()` (the **launch machine runner**, which runs the command on this machine with no isolation). There is no built-in default runner: a run whose effective config declares no `runner` is refused with `missing_runner`. `storm test` has no runner flag; `storm exec` takes `--runner launch-machine` to run on the launch machine without a config file or ignoring the top-level runner.
16
+ - A **resource** is a thing that a run gets for its command, such as a set of test servers. Declare it under `resources` in `storm.config.ts`, under its resource key, or give one of its flags. The run acquires the resource before the command starts, gives the command what it needs of it in the run payload, and releases it after the command stops. Each resource adds its flags to the help of `storm test` and `storm exec`. Its own commands are under `storm ext`.
17
+ - A **run id** is the name of a run, such as `20261103T192655-8277`. It is the start time of the run in UTC and a short suffix. `storm test` and `storm exec` print it at the end, in the `logs` line. With `--json`, the result gives it as `runId`.
18
+ - A **run directory** is the directory where a run writes what it did, on the machine that started the run. This is true for every run, whether on the launch machine or in a runner sandbox. Its name is the run id. Do not read its files directly. Use the `runs` commands.
19
19
  - A run is **active** while it goes on. A run is **finished** when it has ended and saved its test results. `runs show` shows test results only for a finished run.
20
- - A **test result** is the final result of one test: `pass`, `fail`, or `skip`, with its errors. The command saves test results only with a storm reporter in the config of its test runner: `stormReporter` for vitest, `@vercel/storm/playwright/reporter` for Playwright. When the command of a run exits 0 but reports no test result, the run warns `no_final_test_results`. The exit code does not change. Do the steps in its `next`: they name the config file and the code to add. Then run the same command again.
20
+ - A **test result** is the final result of one test: `pass`, `fail`, or `skip`, with its errors. The command saves test results only with a storm reporter in the config of its test runner: `stormReporter` for vitest, `@vercel/storm/playwright/reporter` for Playwright. When the command of a `storm test` run exits 0 but reports no test result, the run warns `no_final_test_results`. The exit code does not change. Do the steps in its `next`: they name the config file and the code to add. Then run the same command again.
21
21
  - **Test output** is what one test printed to the console, stdout and stderr together. storm keeps the last 8 MiB of the test output of each test. `droppedChars` counts the characters that storm did not keep.
22
- - A **runner secret** is a variable in your environment that the `secrets` key of the runner recipe declares, such as an npm token for a private package. A sandboxed run reads it on the machine that starts the run. The run does not start when the variable is not set, is empty, holds a line break or has fewer than 8 characters. A step of the recipe gets the variable only when the `secrets` key of that step names it. The command does not get it. storm shows the value as `<token>` in all that it prints and writes. storm does not write the value to a file. A step can leave the value in the sandbox, and a runner snapshot then keeps it. Do not let a step leave the value.
23
- - A **run log** is a log in the run directory. The **command log** (`command`) holds all the output of the command. It also holds output that no test owns: output from a `beforeAll`, a global setup, a raw `process.stdout.write`, or a child process. A **step log** (`install`, `build`, `apply`, `snapshot`) holds the output of one step of a sandboxed run.
22
+ - A **sandbox credential** is a secret that the `credentials` key of the runner recipe declares, such as a token for a private npm registry: `credentials: [{ domain: "registry.npmjs.org", source: { kind: "env", name: "NPM_AUTH" } }]`. `source` is a `SecretSource` plain object (`{ kind: "env", name }`) naming a variable in your environment that holds the whole header value, such as `Bearer …`. `header` is the name of the header, `authorization` by default. `requests` is `read`, the default, for `GET` and `HEAD` only, or `all`. A run in a runner sandbox reads the variable on the machine that starts the run. The run does not start, with `credentials_invalid`, when the variable is not set, is empty, holds a line break, or has fewer than 8 characters. The value never goes into a sandbox: the firewall of the sandbox adds the header to the requests to the domain. Vercel calls this "credentials brokering". The credentials are in place for the toolchain and prebuild steps of a snapshot build, and from before the install step of a run until the command has ended. The upload and the apply step do not get them. A resource can give credentials too, for the command only. With `read`, the firewall refuses every other request to the domain. Code that runs while a credential is in place, the command included, can send requests with the header to the domain, but it cannot read the value. Each install must find the registry configuration that names the domain: `npm --prefix <dir>` reads the `.npmrc` of that directory, not the project's. storm shows the value as `<token>` in all that it prints and writes, and does not write it to a file or a snapshot. A sandbox credential is not the credential that `--credential` picks, the Vercel OIDC token that storm uses for its own calls: the word has both uses until a rename.
23
+ - An **unsafe secret environment variable** is a secret declared in the `unsafeSecretEnvVars` key of the runner recipe as `{ name, source: { kind: "env", name } }`, for a secret that cannot travel as an HTTPS header. A run in a runner sandbox reads `source` on the machine that starts the run and passes `name` into the command's environment alone, never into a step or a snapshot, and forbids keeping the runner sandbox. The run does not start, with `unsafe_secret_env_vars_invalid`, when the source variable is not set, is empty, holds a line break, or has fewer than 8 characters.
24
+ - An **allowed domain** is a domain that the `allowedDomains` key of the runner recipe lists, such as `example.com` or `*.example.com`. With the list, the sandboxes of a run in a runner sandbox, every step and the command, reach only the allowed domains, and the domain of each sandbox credential while it is in place. A host outside them does not resolve: `curl` exits 6. A host that a resource gives the command must be in the list too. Without the list, every host is reachable.
25
+ - A **run log** is a log in the run directory. The **command log** (`command`) holds all the output of the command. It also holds output that no test owns: output from a `beforeAll`, a global setup, a raw `process.stdout.write`, or a child process. A **step log** (`install`, `build`, `apply`, `snapshot`) holds the output of one step of a run in a runner sandbox.
24
26
 
25
27
  ## Commands
26
28
 
27
- - `storm vitest [--count-tests] [<vitest run args>...] [-- <vitest dash options>...]` runs `vitest run` with the arguments, after it counts the test files when `storm.config.ts` sets `testPlan`. Put the dash options of vitest, such as `-t` or `--project`, after `--`. The count applies the file filters and `--project`, but not `-t`. A `-t` that matches no test does not stop the run: vitest skips every test and exits 0. Add `--count-tests` to count each test too, with or without `testPlan`. Then the run stops with `no_matching_tests` when no test matches. This count imports every test file, so it is slow for a large suite.
28
- - `storm playwright [<playwright test args>...] [-- <playwright dash options>...]` runs `playwright test` with the arguments, after it counts the tests when `storm.config.ts` sets `testPlan`. Put the dash options of Playwright, such as `--project` or `--grep`, after `--`.
29
- - `storm exec -- <command>` runs a different command. It does not count tests.
29
+ - `storm test [--suite <name>] [--count-tests] [<args>...] [-- <dash options>...]` runs the project's tests declared at the top level of `storm.config.ts`, or a named suite with `--suite <name>`. Plain arguments and arguments after `--` go to the test runner before the config file's `args`. When `storm.config.ts` sets `testPlan: true` or the run takes `--count-tests`, storm counts the tests first and stops with `no_matching_tests` when none match.
30
+ - `storm suites list` (alias `ls`) shows what `storm test` runs and lists each declared suite from `storm.config.ts`.
31
+ - `storm exec -- <command>` runs any other command. It does not count tests.
30
32
  - `storm runs list --json` lists the recent runs.
31
- - `storm runs show <run-id> --json` shows a run, the test plan of a `storm vitest` or `storm playwright` run, its test results, and with `--failed` or `--test` the errors and test output of tests.
32
- - `storm runs logs <run-id>` prints a run log.
33
+ - `storm runs show <run-id> --json` shows a run, the test plan of a `storm test` run, its test results, and with `--failed`, `--summary`, or `--test` compact or filtered views.
34
+ - `storm runs logs <run-id> [--sandbox <N>] [--step <step>]` prints a run log, of the run or of one runner sandbox entry, with ANSI escape sequences stripped.
33
35
 
34
36
  ## Other skills
35
37
 
38
+ - To inspect a planned run, pass custom file lists, or rerun failed test files, run `storm skills get plan-runs`.
36
39
  - To read the output and the errors of a run, run `storm skills get read-run-output`.
40
+ - To see the full command index, global options, and `--json` output rules, run `storm skills get commands`. For one command's options and examples, run `storm <command> --help`.
37
41
  - To see all the skills, run `storm skills list`.
@@ -0,0 +1,67 @@
1
+ ---
2
+ name: plan-runs
3
+ description: Read the planned run before you start it, give storm your own file lists, read how long each test file took, and run only the failed test files again.
4
+ ---
5
+
6
+ # Plan runs
7
+
8
+ storm gives you parts that you can combine. storm does not choose which tests to run, in which order, or how many runner sandboxes a run is worth. You choose. storm runs the plan that you give it, and checks the plan before it starts anything. No storm code calls a model.
9
+
10
+ The parts are:
11
+
12
+ - **The planned run**: `--plan-only --json`. It shows the test files, the number of runner sandboxes and the max, and the file lists, and it starts nothing.
13
+ - **A run with your own lists**: `storm test --file-lists <file>` (or `--file-lists -` to read JSON from stdin), for a project whose `storm.config.ts` selects `driver: "vitest"`, at the top level or in the suite that `--suite` names. Each list runs in its own runner sandbox; storm passes each runner sandbox its file list in `STORM_RUN` (`sandbox.files`) while keeping the run's Vitest arguments unchanged, and `vitest.config.ts` reads `sandbox.files` through `stormSequencer()` or `stormVitestConfig()` (`@vercel/storm/vitest/config`).
14
+ - **The time of each test file**: `files` in `storm runs show <run-id> --json`.
15
+ - **Failed test files**: `storm runs show <run-id> --failed --json` returns only the failed files, which you can pass directly to `storm test` or pipe into `storm test --file-lists -`.
16
+
17
+ ## 1. Read the planned run
18
+
19
+ 1. Add `--plan-only --json` to a run command. Put every storm flag before `--`. For example: `storm test --plan-only --sandboxes 2 --json test/unit/`.
20
+ 2. storm loads `storm.config.ts`, does the local checks, and lists the test files on this machine. It mints nothing, acquires no resource, starts no sandbox, and opens no run directory. It does not need a credential. It exits 0.
21
+ 3. Read the result. Its `outcome` is `planned`. Read these fields:
22
+ - `testFiles`: the test files of the run, as paths relative to the project. Use these paths in your lists. It is `null` when the run lists no test files: a `storm exec` run, or a run that is not across runner sandboxes and counts nothing. Add `--sandboxes 1` to list them.
23
+ - `runnerSandboxes`: `sandboxes` in the run's `vercelSandbox({ … })` runner (`runner.sandboxes`), the suite's laid over the top level's. `max` is the most runner sandboxes a run can have. `default` is the number of runner sandboxes of a `storm test` run with no `--sandboxes` and no `--file-lists`: a number, `"function"` when `storm.config.ts` gives a function of the test plan, or `null` when it gives no default. `runnerSandboxes` is `null` when the runner has no `sandboxes`, or is `launchMachine()`. Then no run can be a run across runner sandboxes.
24
+ - `plan.sandboxes`: the number of runner sandboxes (`count`), where it came from (`from`: `flag` for `--sandboxes`, `file-lists` for `--file-lists`, `default` for `runner.sandboxes.default`), and its max (`max`). For `default`, `default` is the number that the default gave for this run. When that number is more than `max`, the run has `max` runner sandboxes. `requested` is the number asked for when the run has fewer test files than that. `leftOut` is the number of test files that your lists leave out.
25
+ - `sandboxes`: one item for each runner sandbox, with `sandbox` (the runner sandbox index, from 0), `argv` (the command of the runner sandbox, unchanged across runner sandboxes for `storm test`), and `files` (its file list, delivered in `STORM_RUN.sandbox.files`, or `null` for `storm exec`).
26
+ - `options`: each option of each resource, with its `value` and where the value came from (`from`: `flag`, `file`, or `default`). With `--sandboxes` or `--file-lists`, a default is the total for the whole run with that number of runner sandboxes, and each runner sandbox gets its own part of the resource.
27
+ - `vcpus`: the vCPUs of each runner sandbox, as the recipe gives them for that number of runner sandboxes. It is `null` for a run on the launch machine runner.
28
+ 4. A refusal that a run gets before it mints, `--plan-only` gets too. Read `reason` in the error document, as for a run.
29
+
30
+ ## 2. Give your own file lists
31
+
32
+ 1. Ensure the project's `vitest.config.ts` includes `...stormVitestConfig()` (or `sequence: { sequencer: stormSequencer() }`) from `@vercel/storm/vitest/config` (or `@cnc-tools/storm/vitest/config`), so each runner sandbox runs only the test files in `STORM_RUN.sandbox.files`.
33
+ 2. Write a JSON file (or pipe JSON to `--file-lists -` on stdin). It holds an array with one array of test file paths for each runner sandbox, in order of runner sandbox index:
34
+
35
+ ```json
36
+ [["test/whoami/whoami.test.ts", "test/teams/list.test.ts"], ["test/env/add.test.ts"]]
37
+ ```
38
+
39
+ 3. Use the paths of `testFiles` from step 1, with the same arguments. A path that the run's listing does not have stops the run.
40
+ 4. Run `storm test --file-lists <file> -- <arguments>` (or `storm test --file-lists - -- <arguments>`). The number of lists is the number of runner sandboxes. It must not be more than `runner.sandboxes.max`. If you also give `--sandboxes`, the two numbers must be the same. Every Vitest argument (including `--project`, `-t`, `--coverage false`, and `file:line` selectors) passes through unchanged; drop only Vitest's own `--shard`.
41
+ 5. To check the lists first, add `--plan-only --json`. Read `sandboxes` and `plan.sandboxes.leftOut`.
42
+ 6. A test file that is in no list does not run. The plan line says how many test files the run runs: `Running 12 of 57 test files in 2 runner sandboxes (--file-lists, max 4)`.
43
+ 7. storm stops the run before it mints when the lists are wrong. Read `reason` and `data`:
44
+ - `file_lists_unreadable`: storm cannot read the file, or it is not JSON, or it is not an array of arrays of paths. Read `data.problem` and `data.message`.
45
+ - `invalid_file_lists`: a list is empty, a test file is in two lists or two times in one list, or the number of lists is not the number of `--sandboxes`. Read `data.problems`.
46
+ - `file_lists_unlisted`: a path is not one of the run's test files. Read `data.files`. Use the paths of `testFiles`.
47
+ - `sandboxes_over_max`: there are more lists than `runner.sandboxes.max`. Read `data.max`.
48
+ - `missing_sandboxes_max`: the run's `vercelSandbox({ … })` runner has no `sandboxes`.
49
+ - `driver_sandboxes_refused`: the selected driver has no file list support (`kind: "unsupported"`), or it refuses an argument in a run across runner sandboxes, such as Vitest's own `--shard` (`kind: "args"`).
50
+ - `conflicting_options`: the run uses the launch machine runner, which runs in no runner sandbox.
51
+ 8. `--file-lists` does not go with `--show-output`. `storm test` takes it; `storm exec` takes only `--sandboxes`.
52
+
53
+ ## 3. Read how long each test file took
54
+
55
+ 1. Run `storm runs show <run-id> --json`. Read `files`.
56
+ 2. Each item has `file`, `sandbox`, `startedAt`, `finishedAt`, `ms`, and `tests: { passed, failed, skipped }`. `ms` is the time from the first `file-started` test event of the file to its last `file-finished` test event.
57
+ 3. storm's own Vitest reporter (`stormReporter()`) and Playwright reporter (`@vercel/storm/playwright/reporter`) emit `file-started` and `file-finished` events automatically, so `ms` is populated whenever either reporter is configured. `ms` is `null` when no reporter or support library wrote those events.
58
+ 4. To make lists that are equal in time, put the test files with the longest `ms` in different lists.
59
+
60
+ ## 4. Run only the failed test files again
61
+
62
+ 1. Run `storm runs show <run-id> --failed --json`. Read `files`, which lists only the test files that had failed tests.
63
+ 2. For a few failed files, pass them directly to `storm test <file1> <file2> -- <arguments>`.
64
+ 3. For many failed files across runner sandboxes, build a JSON array of file lists from `files` and pipe it into `storm test --file-lists - -- <arguments>` (keeping your original Vitest arguments unchanged through `STORM_RUN.sandbox.files`).
65
+ 4. Read the new run as in `storm skills get read-run-output`.
66
+
67
+ For the full command index, global options, and `--json` output rules, run `storm skills get commands`. For one command's options and examples, run `storm <command> --help`.