@elench/testkit 0.1.65 → 0.1.66

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 (305) hide show
  1. package/lib/app/browser-bridge.mjs +66 -0
  2. package/lib/app/configs.mjs +81 -0
  3. package/lib/app/configs.test.mjs +34 -0
  4. package/lib/cli/command-helpers.mjs +2 -10
  5. package/lib/cli/commands/browser/serve.mjs +3 -62
  6. package/lib/cli/db.mjs +3 -68
  7. package/lib/config/binaries.mjs +34 -0
  8. package/lib/config/database.mjs +9 -6
  9. package/lib/config/index.mjs +2 -31
  10. package/lib/config/runtime.mjs +24 -95
  11. package/lib/config/validation.mjs +18 -62
  12. package/lib/coverage/backend-discovery.mjs +68 -85
  13. package/lib/coverage/backend-discovery.test.mjs +55 -46
  14. package/lib/coverage/graph-builder.mjs +5 -5
  15. package/lib/coverage/next-ir-to-graph.mjs +0 -1
  16. package/lib/coverage/routing.mjs +2 -29
  17. package/lib/coverage/routing.test.mjs +0 -16
  18. package/lib/coverage/shared.mjs +22 -82
  19. package/lib/database/fingerprint.mjs +1 -1
  20. package/lib/known-failures/github-cache.mjs +159 -0
  21. package/lib/known-failures/github-transport.mjs +174 -0
  22. package/lib/known-failures/github.mjs +17 -325
  23. package/lib/runner/default-runtime-runner.mjs +4 -10
  24. package/lib/runner/execution-config.mjs +12 -83
  25. package/lib/runner/live-run.mjs +45 -0
  26. package/lib/runner/managed-processes.mjs +29 -0
  27. package/lib/runner/orchestrator.mjs +57 -188
  28. package/lib/runner/playwright-runner.mjs +4 -11
  29. package/lib/runner/run-finalization.mjs +132 -0
  30. package/lib/runner/run-guards.mjs +45 -0
  31. package/lib/runner/runtime-preparation.mjs +1 -1
  32. package/lib/runner/services.mjs +3 -4
  33. package/lib/runner/template-steps.mjs +8 -45
  34. package/lib/runner/template.mjs +7 -28
  35. package/lib/shared/configured-steps.mjs +178 -0
  36. package/lib/shared/configured-steps.test.mjs +73 -0
  37. package/lib/shared/execution-schema.mjs +74 -0
  38. package/lib/shared/execution-schema.test.mjs +26 -0
  39. package/node_modules/@elench/next-analysis/dist/api-routes.d.ts +7 -0
  40. package/node_modules/@elench/next-analysis/dist/api-routes.d.ts.map +1 -0
  41. package/node_modules/@elench/next-analysis/dist/api-routes.js +66 -0
  42. package/node_modules/@elench/next-analysis/dist/api-routes.js.map +1 -0
  43. package/node_modules/@elench/next-analysis/dist/app-root.d.ts +2 -0
  44. package/node_modules/@elench/next-analysis/dist/app-root.d.ts.map +1 -0
  45. package/node_modules/@elench/next-analysis/dist/app-root.js +7 -0
  46. package/node_modules/@elench/next-analysis/dist/app-root.js.map +1 -0
  47. package/node_modules/@elench/next-analysis/dist/backend-links.d.ts +8 -0
  48. package/node_modules/@elench/next-analysis/dist/backend-links.d.ts.map +1 -0
  49. package/node_modules/@elench/next-analysis/dist/backend-links.js +30 -0
  50. package/node_modules/@elench/next-analysis/dist/backend-links.js.map +1 -0
  51. package/node_modules/@elench/next-analysis/dist/index.d.ts +11 -0
  52. package/node_modules/@elench/next-analysis/dist/index.d.ts.map +1 -0
  53. package/node_modules/@elench/next-analysis/dist/index.js +10 -0
  54. package/node_modules/@elench/next-analysis/dist/index.js.map +1 -0
  55. package/node_modules/@elench/next-analysis/dist/pages.d.ts +7 -0
  56. package/node_modules/@elench/next-analysis/dist/pages.d.ts.map +1 -0
  57. package/node_modules/@elench/next-analysis/dist/pages.js +47 -0
  58. package/node_modules/@elench/next-analysis/dist/pages.js.map +1 -0
  59. package/node_modules/@elench/next-analysis/dist/project.d.ts +3 -0
  60. package/node_modules/@elench/next-analysis/dist/project.d.ts.map +1 -0
  61. package/node_modules/@elench/next-analysis/dist/project.js +102 -0
  62. package/node_modules/@elench/next-analysis/dist/project.js.map +1 -0
  63. package/node_modules/@elench/next-analysis/dist/route-tree.d.ts +7 -0
  64. package/node_modules/@elench/next-analysis/dist/route-tree.d.ts.map +1 -0
  65. package/node_modules/@elench/next-analysis/dist/route-tree.js +575 -0
  66. package/node_modules/@elench/next-analysis/dist/route-tree.js.map +1 -0
  67. package/node_modules/@elench/next-analysis/dist/routes.d.ts +6 -0
  68. package/node_modules/@elench/next-analysis/dist/routes.d.ts.map +1 -0
  69. package/node_modules/@elench/next-analysis/dist/routes.js +41 -0
  70. package/node_modules/@elench/next-analysis/dist/routes.js.map +1 -0
  71. package/node_modules/@elench/next-analysis/dist/server-actions.d.ts +7 -0
  72. package/node_modules/@elench/next-analysis/dist/server-actions.d.ts.map +1 -0
  73. package/node_modules/@elench/next-analysis/dist/server-actions.js +37 -0
  74. package/node_modules/@elench/next-analysis/dist/server-actions.js.map +1 -0
  75. package/node_modules/@elench/next-analysis/dist/shared.d.ts +57 -0
  76. package/node_modules/@elench/next-analysis/dist/shared.d.ts.map +1 -0
  77. package/node_modules/@elench/next-analysis/dist/shared.js +229 -0
  78. package/node_modules/@elench/next-analysis/dist/shared.js.map +1 -0
  79. package/node_modules/@elench/next-analysis/dist/swc.d.ts +53 -0
  80. package/node_modules/@elench/next-analysis/dist/swc.d.ts.map +1 -0
  81. package/node_modules/@elench/next-analysis/dist/swc.js +387 -0
  82. package/node_modules/@elench/next-analysis/dist/swc.js.map +1 -0
  83. package/node_modules/@elench/next-analysis/dist/types.d.ts +125 -0
  84. package/node_modules/@elench/next-analysis/dist/types.d.ts.map +1 -0
  85. package/node_modules/@elench/next-analysis/dist/types.js +2 -0
  86. package/node_modules/@elench/next-analysis/dist/types.js.map +1 -0
  87. package/node_modules/@elench/next-analysis/package.json +15 -2
  88. package/node_modules/@elench/testkit-bridge/dist/index.d.ts +36 -0
  89. package/node_modules/@elench/testkit-bridge/dist/index.d.ts.map +1 -0
  90. package/node_modules/@elench/testkit-bridge/dist/index.js +538 -0
  91. package/node_modules/@elench/testkit-bridge/dist/index.js.map +1 -0
  92. package/node_modules/@elench/testkit-bridge/package.json +16 -5
  93. package/node_modules/@elench/testkit-protocol/dist/index.d.ts +190 -0
  94. package/node_modules/@elench/testkit-protocol/dist/index.d.ts.map +1 -0
  95. package/node_modules/@elench/testkit-protocol/dist/index.js +296 -0
  96. package/node_modules/@elench/testkit-protocol/dist/index.js.map +1 -0
  97. package/node_modules/@elench/testkit-protocol/package.json +14 -7
  98. package/node_modules/@elench/ts-analysis/dist/callables.d.ts +8 -0
  99. package/node_modules/@elench/ts-analysis/dist/callables.d.ts.map +1 -0
  100. package/node_modules/@elench/ts-analysis/dist/callables.js +126 -0
  101. package/node_modules/@elench/ts-analysis/dist/callables.js.map +1 -0
  102. package/node_modules/@elench/ts-analysis/dist/exports.d.ts +6 -0
  103. package/node_modules/@elench/ts-analysis/dist/exports.d.ts.map +1 -0
  104. package/node_modules/@elench/ts-analysis/dist/exports.js +70 -0
  105. package/node_modules/@elench/ts-analysis/dist/exports.js.map +1 -0
  106. package/node_modules/@elench/ts-analysis/dist/index.d.ts +10 -0
  107. package/node_modules/@elench/ts-analysis/dist/index.d.ts.map +1 -0
  108. package/node_modules/@elench/ts-analysis/{src/index.mjs → dist/index.js} +9 -14
  109. package/node_modules/@elench/ts-analysis/dist/index.js.map +1 -0
  110. package/node_modules/@elench/ts-analysis/dist/jsx.d.ts +9 -0
  111. package/node_modules/@elench/ts-analysis/dist/jsx.d.ts.map +1 -0
  112. package/node_modules/@elench/ts-analysis/dist/jsx.js +68 -0
  113. package/node_modules/@elench/ts-analysis/dist/jsx.js.map +1 -0
  114. package/node_modules/@elench/ts-analysis/dist/project.d.ts +5 -0
  115. package/node_modules/@elench/ts-analysis/dist/project.d.ts.map +1 -0
  116. package/node_modules/@elench/ts-analysis/dist/project.js +90 -0
  117. package/node_modules/@elench/ts-analysis/dist/project.js.map +1 -0
  118. package/node_modules/@elench/ts-analysis/dist/requests.d.ts +6 -0
  119. package/node_modules/@elench/ts-analysis/dist/requests.d.ts.map +1 -0
  120. package/node_modules/@elench/ts-analysis/dist/requests.js +140 -0
  121. package/node_modules/@elench/ts-analysis/dist/requests.js.map +1 -0
  122. package/node_modules/@elench/ts-analysis/dist/resolution.d.ts +4 -0
  123. package/node_modules/@elench/ts-analysis/dist/resolution.d.ts.map +1 -0
  124. package/node_modules/@elench/ts-analysis/dist/resolution.js +53 -0
  125. package/node_modules/@elench/ts-analysis/dist/resolution.js.map +1 -0
  126. package/node_modules/@elench/ts-analysis/dist/shared.d.ts +6 -0
  127. package/node_modules/@elench/ts-analysis/dist/shared.d.ts.map +1 -0
  128. package/node_modules/@elench/ts-analysis/dist/shared.js +31 -0
  129. package/node_modules/@elench/ts-analysis/dist/shared.js.map +1 -0
  130. package/node_modules/@elench/ts-analysis/dist/syntax.d.ts +7 -0
  131. package/node_modules/@elench/ts-analysis/dist/syntax.d.ts.map +1 -0
  132. package/node_modules/@elench/ts-analysis/dist/syntax.js +27 -0
  133. package/node_modules/@elench/ts-analysis/dist/syntax.js.map +1 -0
  134. package/node_modules/@elench/ts-analysis/dist/types.d.ts +58 -0
  135. package/node_modules/@elench/ts-analysis/dist/types.d.ts.map +1 -0
  136. package/node_modules/@elench/ts-analysis/dist/types.js +2 -0
  137. package/node_modules/@elench/ts-analysis/dist/types.js.map +1 -0
  138. package/node_modules/@elench/ts-analysis/package.json +18 -2
  139. package/node_modules/typescript/LICENSE.txt +55 -0
  140. package/node_modules/typescript/README.md +50 -0
  141. package/node_modules/typescript/SECURITY.md +41 -0
  142. package/node_modules/typescript/ThirdPartyNoticeText.txt +193 -0
  143. package/node_modules/typescript/bin/tsc +2 -0
  144. package/node_modules/typescript/bin/tsserver +2 -0
  145. package/node_modules/typescript/lib/_tsc.js +133818 -0
  146. package/node_modules/typescript/lib/_tsserver.js +659 -0
  147. package/node_modules/typescript/lib/_typingsInstaller.js +222 -0
  148. package/node_modules/typescript/lib/cs/diagnosticMessages.generated.json +2122 -0
  149. package/node_modules/typescript/lib/de/diagnosticMessages.generated.json +2122 -0
  150. package/node_modules/typescript/lib/es/diagnosticMessages.generated.json +2122 -0
  151. package/node_modules/typescript/lib/fr/diagnosticMessages.generated.json +2122 -0
  152. package/node_modules/typescript/lib/it/diagnosticMessages.generated.json +2122 -0
  153. package/node_modules/typescript/lib/ja/diagnosticMessages.generated.json +2122 -0
  154. package/node_modules/typescript/lib/ko/diagnosticMessages.generated.json +2122 -0
  155. package/node_modules/typescript/lib/lib.d.ts +22 -0
  156. package/node_modules/typescript/lib/lib.decorators.d.ts +384 -0
  157. package/node_modules/typescript/lib/lib.decorators.legacy.d.ts +22 -0
  158. package/node_modules/typescript/lib/lib.dom.asynciterable.d.ts +41 -0
  159. package/node_modules/typescript/lib/lib.dom.d.ts +39429 -0
  160. package/node_modules/typescript/lib/lib.dom.iterable.d.ts +571 -0
  161. package/node_modules/typescript/lib/lib.es2015.collection.d.ts +147 -0
  162. package/node_modules/typescript/lib/lib.es2015.core.d.ts +597 -0
  163. package/node_modules/typescript/lib/lib.es2015.d.ts +28 -0
  164. package/node_modules/typescript/lib/lib.es2015.generator.d.ts +77 -0
  165. package/node_modules/typescript/lib/lib.es2015.iterable.d.ts +605 -0
  166. package/node_modules/typescript/lib/lib.es2015.promise.d.ts +81 -0
  167. package/node_modules/typescript/lib/lib.es2015.proxy.d.ts +128 -0
  168. package/node_modules/typescript/lib/lib.es2015.reflect.d.ts +144 -0
  169. package/node_modules/typescript/lib/lib.es2015.symbol.d.ts +46 -0
  170. package/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts +326 -0
  171. package/node_modules/typescript/lib/lib.es2016.array.include.d.ts +116 -0
  172. package/node_modules/typescript/lib/lib.es2016.d.ts +21 -0
  173. package/node_modules/typescript/lib/lib.es2016.full.d.ts +23 -0
  174. package/node_modules/typescript/lib/lib.es2016.intl.d.ts +31 -0
  175. package/node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts +21 -0
  176. package/node_modules/typescript/lib/lib.es2017.d.ts +26 -0
  177. package/node_modules/typescript/lib/lib.es2017.date.d.ts +31 -0
  178. package/node_modules/typescript/lib/lib.es2017.full.d.ts +23 -0
  179. package/node_modules/typescript/lib/lib.es2017.intl.d.ts +44 -0
  180. package/node_modules/typescript/lib/lib.es2017.object.d.ts +49 -0
  181. package/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts +135 -0
  182. package/node_modules/typescript/lib/lib.es2017.string.d.ts +45 -0
  183. package/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts +53 -0
  184. package/node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts +77 -0
  185. package/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts +53 -0
  186. package/node_modules/typescript/lib/lib.es2018.d.ts +24 -0
  187. package/node_modules/typescript/lib/lib.es2018.full.d.ts +24 -0
  188. package/node_modules/typescript/lib/lib.es2018.intl.d.ts +83 -0
  189. package/node_modules/typescript/lib/lib.es2018.promise.d.ts +30 -0
  190. package/node_modules/typescript/lib/lib.es2018.regexp.d.ts +37 -0
  191. package/node_modules/typescript/lib/lib.es2019.array.d.ts +79 -0
  192. package/node_modules/typescript/lib/lib.es2019.d.ts +24 -0
  193. package/node_modules/typescript/lib/lib.es2019.full.d.ts +24 -0
  194. package/node_modules/typescript/lib/lib.es2019.intl.d.ts +23 -0
  195. package/node_modules/typescript/lib/lib.es2019.object.d.ts +33 -0
  196. package/node_modules/typescript/lib/lib.es2019.string.d.ts +37 -0
  197. package/node_modules/typescript/lib/lib.es2019.symbol.d.ts +24 -0
  198. package/node_modules/typescript/lib/lib.es2020.bigint.d.ts +765 -0
  199. package/node_modules/typescript/lib/lib.es2020.d.ts +27 -0
  200. package/node_modules/typescript/lib/lib.es2020.date.d.ts +42 -0
  201. package/node_modules/typescript/lib/lib.es2020.full.d.ts +24 -0
  202. package/node_modules/typescript/lib/lib.es2020.intl.d.ts +474 -0
  203. package/node_modules/typescript/lib/lib.es2020.number.d.ts +28 -0
  204. package/node_modules/typescript/lib/lib.es2020.promise.d.ts +47 -0
  205. package/node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts +99 -0
  206. package/node_modules/typescript/lib/lib.es2020.string.d.ts +44 -0
  207. package/node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts +41 -0
  208. package/node_modules/typescript/lib/lib.es2021.d.ts +23 -0
  209. package/node_modules/typescript/lib/lib.es2021.full.d.ts +24 -0
  210. package/node_modules/typescript/lib/lib.es2021.intl.d.ts +166 -0
  211. package/node_modules/typescript/lib/lib.es2021.promise.d.ts +48 -0
  212. package/node_modules/typescript/lib/lib.es2021.string.d.ts +33 -0
  213. package/node_modules/typescript/lib/lib.es2021.weakref.d.ts +78 -0
  214. package/node_modules/typescript/lib/lib.es2022.array.d.ts +121 -0
  215. package/node_modules/typescript/lib/lib.es2022.d.ts +25 -0
  216. package/node_modules/typescript/lib/lib.es2022.error.d.ts +75 -0
  217. package/node_modules/typescript/lib/lib.es2022.full.d.ts +24 -0
  218. package/node_modules/typescript/lib/lib.es2022.intl.d.ts +145 -0
  219. package/node_modules/typescript/lib/lib.es2022.object.d.ts +26 -0
  220. package/node_modules/typescript/lib/lib.es2022.regexp.d.ts +39 -0
  221. package/node_modules/typescript/lib/lib.es2022.string.d.ts +25 -0
  222. package/node_modules/typescript/lib/lib.es2023.array.d.ts +924 -0
  223. package/node_modules/typescript/lib/lib.es2023.collection.d.ts +21 -0
  224. package/node_modules/typescript/lib/lib.es2023.d.ts +22 -0
  225. package/node_modules/typescript/lib/lib.es2023.full.d.ts +24 -0
  226. package/node_modules/typescript/lib/lib.es2023.intl.d.ts +56 -0
  227. package/node_modules/typescript/lib/lib.es2024.arraybuffer.d.ts +65 -0
  228. package/node_modules/typescript/lib/lib.es2024.collection.d.ts +29 -0
  229. package/node_modules/typescript/lib/lib.es2024.d.ts +26 -0
  230. package/node_modules/typescript/lib/lib.es2024.full.d.ts +24 -0
  231. package/node_modules/typescript/lib/lib.es2024.object.d.ts +29 -0
  232. package/node_modules/typescript/lib/lib.es2024.promise.d.ts +35 -0
  233. package/node_modules/typescript/lib/lib.es2024.regexp.d.ts +25 -0
  234. package/node_modules/typescript/lib/lib.es2024.sharedmemory.d.ts +68 -0
  235. package/node_modules/typescript/lib/lib.es2024.string.d.ts +29 -0
  236. package/node_modules/typescript/lib/lib.es5.d.ts +4601 -0
  237. package/node_modules/typescript/lib/lib.es6.d.ts +23 -0
  238. package/node_modules/typescript/lib/lib.esnext.array.d.ts +35 -0
  239. package/node_modules/typescript/lib/lib.esnext.collection.d.ts +96 -0
  240. package/node_modules/typescript/lib/lib.esnext.d.ts +29 -0
  241. package/node_modules/typescript/lib/lib.esnext.decorators.d.ts +28 -0
  242. package/node_modules/typescript/lib/lib.esnext.disposable.d.ts +193 -0
  243. package/node_modules/typescript/lib/lib.esnext.error.d.ts +24 -0
  244. package/node_modules/typescript/lib/lib.esnext.float16.d.ts +445 -0
  245. package/node_modules/typescript/lib/lib.esnext.full.d.ts +24 -0
  246. package/node_modules/typescript/lib/lib.esnext.intl.d.ts +21 -0
  247. package/node_modules/typescript/lib/lib.esnext.iterator.d.ts +148 -0
  248. package/node_modules/typescript/lib/lib.esnext.promise.d.ts +34 -0
  249. package/node_modules/typescript/lib/lib.esnext.sharedmemory.d.ts +25 -0
  250. package/node_modules/typescript/lib/lib.scripthost.d.ts +322 -0
  251. package/node_modules/typescript/lib/lib.webworker.asynciterable.d.ts +41 -0
  252. package/node_modules/typescript/lib/lib.webworker.d.ts +13150 -0
  253. package/node_modules/typescript/lib/lib.webworker.importscripts.d.ts +23 -0
  254. package/node_modules/typescript/lib/lib.webworker.iterable.d.ts +340 -0
  255. package/node_modules/typescript/lib/pl/diagnosticMessages.generated.json +2122 -0
  256. package/node_modules/typescript/lib/pt-br/diagnosticMessages.generated.json +2122 -0
  257. package/node_modules/typescript/lib/ru/diagnosticMessages.generated.json +2122 -0
  258. package/node_modules/typescript/lib/tr/diagnosticMessages.generated.json +2122 -0
  259. package/node_modules/typescript/lib/tsc.js +8 -0
  260. package/node_modules/typescript/lib/tsserver.js +8 -0
  261. package/node_modules/typescript/lib/tsserverlibrary.d.ts +17 -0
  262. package/node_modules/typescript/lib/tsserverlibrary.js +21 -0
  263. package/node_modules/typescript/lib/typesMap.json +497 -0
  264. package/node_modules/typescript/lib/typescript.d.ts +11437 -0
  265. package/node_modules/typescript/lib/typescript.js +200276 -0
  266. package/node_modules/typescript/lib/typingsInstaller.js +8 -0
  267. package/node_modules/typescript/lib/watchGuard.js +53 -0
  268. package/node_modules/typescript/lib/zh-cn/diagnosticMessages.generated.json +2122 -0
  269. package/node_modules/typescript/lib/zh-tw/diagnosticMessages.generated.json +2122 -0
  270. package/node_modules/typescript/package.json +120 -0
  271. package/package.json +12 -9
  272. package/lib/coverage/fs-walk.mjs +0 -64
  273. package/node_modules/@elench/next-analysis/src/api-routes.mjs +0 -81
  274. package/node_modules/@elench/next-analysis/src/api-routes.test.mjs +0 -22
  275. package/node_modules/@elench/next-analysis/src/app-root.mjs +0 -7
  276. package/node_modules/@elench/next-analysis/src/backend-links.mjs +0 -31
  277. package/node_modules/@elench/next-analysis/src/index.mjs +0 -21
  278. package/node_modules/@elench/next-analysis/src/pages.mjs +0 -68
  279. package/node_modules/@elench/next-analysis/src/project.mjs +0 -94
  280. package/node_modules/@elench/next-analysis/src/project.test.mjs +0 -35
  281. package/node_modules/@elench/next-analysis/src/route-tree.mjs +0 -621
  282. package/node_modules/@elench/next-analysis/src/routes.mjs +0 -41
  283. package/node_modules/@elench/next-analysis/src/routes.test.mjs +0 -25
  284. package/node_modules/@elench/next-analysis/src/server-actions.mjs +0 -53
  285. package/node_modules/@elench/next-analysis/src/server-actions.test.mjs +0 -37
  286. package/node_modules/@elench/next-analysis/src/shared.mjs +0 -209
  287. package/node_modules/@elench/next-analysis/src/swc.mjs +0 -388
  288. package/node_modules/@elench/testkit-bridge/src/index.mjs +0 -583
  289. package/node_modules/@elench/testkit-bridge/src/index.test.mjs +0 -409
  290. package/node_modules/@elench/testkit-protocol/src/index.d.ts +0 -231
  291. package/node_modules/@elench/testkit-protocol/src/index.mjs +0 -265
  292. package/node_modules/@elench/testkit-protocol/src/index.test.mjs +0 -242
  293. package/node_modules/@elench/ts-analysis/src/callables.mjs +0 -135
  294. package/node_modules/@elench/ts-analysis/src/callables.test.mjs +0 -55
  295. package/node_modules/@elench/ts-analysis/src/exports.mjs +0 -69
  296. package/node_modules/@elench/ts-analysis/src/exports.test.mjs +0 -50
  297. package/node_modules/@elench/ts-analysis/src/jsx.mjs +0 -69
  298. package/node_modules/@elench/ts-analysis/src/jsx.test.mjs +0 -43
  299. package/node_modules/@elench/ts-analysis/src/project.mjs +0 -100
  300. package/node_modules/@elench/ts-analysis/src/project.test.mjs +0 -54
  301. package/node_modules/@elench/ts-analysis/src/requests.mjs +0 -141
  302. package/node_modules/@elench/ts-analysis/src/requests.test.mjs +0 -35
  303. package/node_modules/@elench/ts-analysis/src/resolution.mjs +0 -53
  304. package/node_modules/@elench/ts-analysis/src/shared.mjs +0 -32
  305. package/node_modules/@elench/ts-analysis/src/syntax.mjs +0 -27
@@ -2,7 +2,7 @@ import fs from "fs";
2
2
  import path from "path";
3
3
  import { execa } from "execa";
4
4
  import { bundleK6File } from "../bundler/index.mjs";
5
- import { resolveK6Binary } from "../config/index.mjs";
5
+ import { resolveK6Binary } from "../config/binaries.mjs";
6
6
  import {
7
7
  buildFileTimeoutEnv,
8
8
  formatFileTimeoutBudgetError,
@@ -16,6 +16,7 @@ import { collectFailureDetailsFromRuntimeArtifacts } from "./failure-details.mjs
16
16
  import { RUNTIME_ARTIFACT_MARKER } from "../runtime-src/k6/artifacts.js";
17
17
  import { readDatabaseUrl } from "./state-io.mjs";
18
18
  import { buildTaskExecutionEnv } from "./template.mjs";
19
+ import { registerManagedProcess, unregisterManagedProcess } from "./managed-processes.mjs";
19
20
  import { killChildProcess } from "./processes.mjs";
20
21
 
21
22
  export async function runHttpK6Task(targetConfig, task, lifecycle, lease, reporter = null) {
@@ -105,21 +106,14 @@ export async function runDefaultRuntimeTask(
105
106
  forceKillAfterDelay: 5_000,
106
107
  }
107
108
  );
108
- lifecycle.registerProcess(subprocess, () => {
109
- killChildProcess(subprocess, "SIGINT");
110
- });
111
- if (lifecycle.isStopRequested()) {
112
- const interruptSubprocess = () => killChildProcess(subprocess, "SIGINT");
113
- if (subprocess.pid) interruptSubprocess();
114
- else subprocess.once?.("spawn", interruptSubprocess);
115
- }
109
+ registerManagedProcess(lifecycle, subprocess, "SIGINT");
116
110
  reporter?.taskStarted?.(task, targetConfig);
117
111
  let result;
118
112
  let timedOut;
119
113
  try {
120
114
  ({ result, timedOut } = await settleSubprocess(subprocess, fileTimeoutSeconds));
121
115
  } finally {
122
- lifecycle.unregisterProcess(subprocess.pid);
116
+ unregisterManagedProcess(lifecycle, subprocess);
123
117
  }
124
118
 
125
119
  const stdout = parseDefaultRuntimeOutput(result.stdout || "");
@@ -1,85 +1,14 @@
1
- import {
1
+ export {
2
+ DATABASE_BINDINGS,
2
3
  DEFAULT_FILE_TIMEOUT_SECONDS,
3
- normalizeFileTimeoutSeconds,
4
+ buildRuntimeIds,
5
+ normalizeDatabaseBinding,
6
+ normalizeExecutionConfig,
7
+ normalizeRuntimeInstances,
8
+ normalizeRuntimeMaxConcurrentTasks,
4
9
  parseFileTimeoutOption,
5
- } from "../shared/file-timeout.mjs";
6
-
7
- export const DATABASE_BINDINGS = new Set(["shared", "per-runtime"]);
8
-
9
- export { DEFAULT_FILE_TIMEOUT_SECONDS, parseFileTimeoutOption };
10
-
11
- export function parseWorkersOption(value) {
12
- return parsePositiveInteger(value, "--workers");
13
- }
14
-
15
- export function parseRuntimeInstancesOption(value, label = "runtime.instances") {
16
- return parsePositiveInteger(value, label);
17
- }
18
-
19
- export function normalizeRuntimeInstances(value, label = "runtime.instances") {
20
- return normalizePositiveInteger(value, label);
21
- }
22
-
23
- export function parseRuntimeMaxConcurrentTasksOption(
24
- value,
25
- label = "runtime.maxConcurrentTasks"
26
- ) {
27
- return parsePositiveInteger(value, label);
28
- }
29
-
30
- export function normalizeRuntimeMaxConcurrentTasks(
31
- value,
32
- label = "runtime.maxConcurrentTasks"
33
- ) {
34
- if (value === undefined || value === null) {
35
- return Number.POSITIVE_INFINITY;
36
- }
37
- return normalizePositiveInteger(value, label);
38
- }
39
-
40
- export function normalizeDatabaseBinding(value, label = "database.binding") {
41
- const normalized = String(value || "").trim();
42
- if (!DATABASE_BINDINGS.has(normalized)) {
43
- throw new Error(
44
- `Invalid ${label} value "${value}". Expected one of: shared, per-runtime.`
45
- );
46
- }
47
- return normalized;
48
- }
49
-
50
- export function resolveExecutionConfig({ cli = {}, repo = {} } = {}) {
51
- return normalizeExecutionConfig({
52
- workers: cli.workers ?? repo.workers ?? 1,
53
- fileTimeoutSeconds:
54
- cli.fileTimeoutSeconds ?? repo.fileTimeoutSeconds ?? DEFAULT_FILE_TIMEOUT_SECONDS,
55
- });
56
- }
57
-
58
- export function normalizeExecutionConfig(input = {}) {
59
- return {
60
- workers: normalizePositiveInteger(input.workers ?? 1, "execution.workers"),
61
- fileTimeoutSeconds: normalizeFileTimeoutSeconds(
62
- input.fileTimeoutSeconds ?? DEFAULT_FILE_TIMEOUT_SECONDS
63
- ),
64
- };
65
- }
66
-
67
- export function buildRuntimeIds(count) {
68
- return Array.from({ length: count }, (_unused, index) => `runtime-${index + 1}`);
69
- }
70
-
71
- function parsePositiveInteger(value, label) {
72
- const parsed = Number.parseInt(String(value), 10);
73
- if (!Number.isInteger(parsed) || parsed <= 0) {
74
- throw new Error(`Invalid ${label} value "${value}". Expected a positive integer.`);
75
- }
76
- return parsed;
77
- }
78
-
79
- function normalizePositiveInteger(value, label) {
80
- const parsed = Number(value);
81
- if (!Number.isInteger(parsed) || parsed <= 0) {
82
- throw new Error(`${label} must be a positive integer.`);
83
- }
84
- return parsed;
85
- }
10
+ parseRuntimeInstancesOption,
11
+ parseRuntimeMaxConcurrentTasksOption,
12
+ parseWorkersOption,
13
+ resolveExecutionConfig,
14
+ } from "../shared/execution-schema.mjs";
@@ -0,0 +1,45 @@
1
+ import { finalizeServiceResult, summarizeDbBackend } from "./results.mjs";
2
+ import { buildLiveRunArtifact } from "./reporting.mjs";
3
+ import { writeLiveRunArtifact } from "./artifacts.mjs";
4
+
5
+ export function createLiveSnapshotWriter({
6
+ productDir,
7
+ configs,
8
+ trackers,
9
+ startedAt,
10
+ execution,
11
+ workerState,
12
+ selection,
13
+ metadata,
14
+ logRegistry,
15
+ setupRegistry,
16
+ }) {
17
+ return () => {
18
+ const now = Date.now();
19
+ const partialResults = configs.map((config) => finalizeServiceResult(trackers.get(config.name), startedAt, now));
20
+ writeLiveRunArtifact(
21
+ productDir,
22
+ buildLiveRunArtifact({
23
+ productDir,
24
+ results: partialResults,
25
+ startedAt,
26
+ updatedAt: now,
27
+ execution,
28
+ workerCount: workerState.workerCount,
29
+ runtimeInstanceCount: workerState.runtimeInstanceCount,
30
+ runtimeStats: workerState.runtimeStats,
31
+ typeValues: selection.typeValues,
32
+ suiteSelectors: selection.suiteSelectors,
33
+ fileNames: selection.fileNames,
34
+ shard: selection.shard,
35
+ serviceFilter: selection.serviceFilter,
36
+ scenarioSeed: selection.scenarioSeed,
37
+ metadata,
38
+ summarizeDbBackend,
39
+ serviceLogs: logRegistry.listServiceLogs(),
40
+ setupLogs: logRegistry.listSetupLogs(),
41
+ setupOperations: setupRegistry.listOperations(),
42
+ })
43
+ );
44
+ };
45
+ }
@@ -0,0 +1,29 @@
1
+ import { killChildProcess } from "./processes.mjs";
2
+
3
+ export function registerManagedProcess(lifecycle, subprocess, signal = "SIGINT") {
4
+ lifecycle.registerProcess(subprocess, () => {
5
+ killChildProcess(subprocess, signal);
6
+ });
7
+ if (lifecycle.isStopRequested()) {
8
+ interruptManagedProcess(subprocess, signal);
9
+ }
10
+ }
11
+
12
+ export function unregisterManagedProcess(lifecycle, subprocess) {
13
+ lifecycle.unregisterProcess(subprocess.pid);
14
+ }
15
+
16
+ export function registerManagedService(lifecycle, config, child, cwd, signal = "SIGTERM") {
17
+ lifecycle.registerService(config, child, cwd, () => {
18
+ killChildProcess(child, signal);
19
+ });
20
+ if (lifecycle.isStopRequested()) {
21
+ interruptManagedProcess(child, signal);
22
+ }
23
+ }
24
+
25
+ function interruptManagedProcess(subprocess, signal) {
26
+ const interruptSubprocess = () => killChildProcess(subprocess, signal);
27
+ if (subprocess.pid) interruptSubprocess();
28
+ else subprocess.once?.("spawn", interruptSubprocess);
29
+ }
@@ -12,26 +12,13 @@ import {
12
12
  finalizeServiceResult,
13
13
  recordGraphError,
14
14
  recordTaskOutcome,
15
- summarizeDbBackend,
16
15
  } from "./results.mjs";
17
- import { buildLiveRunArtifact, buildRunArtifact, buildStatusArtifact } from "./reporting.mjs";
18
- import {
19
- applyKnownFailureIssueValidationToArtifacts,
20
- applyKnownFailuresToArtifacts,
21
- loadKnownFailuresConfig,
22
- } from "./triage.mjs";
16
+ import { loadKnownFailuresConfig } from "./triage.mjs";
23
17
  import { formatError } from "./formatting.mjs";
24
- import {
25
- shouldFailKnownFailureIssueValidation,
26
- validateKnownFailureIssues,
27
- } from "../known-failures/github.mjs";
28
18
  import {
29
19
  loadTimings,
30
20
  resetResultArtifacts,
31
21
  saveTimings,
32
- writeLiveRunArtifact,
33
- writeRunArtifact,
34
- writeStatusArtifact,
35
22
  } from "./artifacts.mjs";
36
23
  import { createRunLogRegistry } from "./logs.mjs";
37
24
  import { createSetupOperationRegistry } from "./setup-operations.mjs";
@@ -50,9 +37,9 @@ import {
50
37
  import { resolveExecutionConfig } from "./execution-config.mjs";
51
38
  import { createRuntimeManager } from "./runtime-manager.mjs";
52
39
  import { createWorker, runWorker } from "./worker-loop.mjs";
53
- import { findUnmatchedRequestedFiles, isFullRunSelection } from "./selection.mjs";
54
- import { uploadTelemetryArtifact } from "../telemetry/index.mjs";
55
- import { loadHistory, saveHistory, updateHistoryFromRunArtifact } from "../history/index.mjs";
40
+ import { ensureRequestedFilesMatch, ensureStatusWriteAllowed } from "./run-guards.mjs";
41
+ import { createLiveSnapshotWriter } from "./live-run.mjs";
42
+ import { finalizeRunArtifacts } from "./run-finalization.mjs";
56
43
 
57
44
  export async function runAll(configs, typeValues, suiteSelectors, opts, allConfigs = configs) {
58
45
  const configMap = new Map(allConfigs.map((config) => [config.name, config]));
@@ -75,42 +62,14 @@ export async function runAll(configs, typeValues, suiteSelectors, opts, allConfi
75
62
  );
76
63
  const reporter = opts.reporter || null;
77
64
  const logRegistry = createRunLogRegistry(productDir);
78
- let workerCount = 0;
79
- let runtimeInstanceCount = 0;
80
- let runtimeStats = [];
65
+ const workerState = {
66
+ workerCount: 0,
67
+ runtimeInstanceCount: 0,
68
+ runtimeStats: [],
69
+ };
81
70
  const requestedFiles = opts.fileNames || [];
82
- if (requestedFiles.length > 0) {
83
- const unmatchedFiles = findUnmatchedRequestedFiles(
84
- configs,
85
- typeValues,
86
- suiteSelectors,
87
- requestedFiles,
88
- collectSuites,
89
- normalizePathSeparators
90
- );
91
- if (unmatchedFiles.length > 0) {
92
- throw new Error(
93
- `Requested file${unmatchedFiles.length === 1 ? "" : "s"} did not match any selected suites:\n` +
94
- unmatchedFiles.map((file) => `- ${file}`).join("\n")
95
- );
96
- }
97
- }
98
- if (
99
- opts.writeStatus &&
100
- !opts.allowPartialStatus &&
101
- !isFullRunSelection(
102
- typeValues,
103
- suiteSelectors,
104
- requestedFiles,
105
- opts.shard || null,
106
- opts.serviceFilter || null
107
- )
108
- ) {
109
- throw new Error(
110
- "Refusing to overwrite testkit.status.json from a filtered run. " +
111
- "Run the full suite with --write-status, or pass --allow-partial-status to opt in."
112
- );
113
- }
71
+ ensureRequestedFilesMatch(configs, typeValues, suiteSelectors, requestedFiles);
72
+ ensureStatusWriteAllowed(opts, typeValues, suiteSelectors, requestedFiles);
114
73
 
115
74
  const execution = resolveExecutionConfig({
116
75
  cli: opts,
@@ -126,39 +85,26 @@ export async function runAll(configs, typeValues, suiteSelectors, opts, allConfi
126
85
  reporter
127
86
  );
128
87
  const trackers = buildServiceTrackers(servicePlans, startedAt);
129
- const writeLiveSnapshot = () => {
130
- const now = Date.now();
131
- const partialResults = configs.map((config) =>
132
- finalizeServiceResult(trackers.get(config.name), startedAt, now)
133
- );
134
- writeLiveRunArtifact(
135
- productDir,
136
- buildLiveRunArtifact({
137
- productDir,
138
- results: partialResults,
139
- startedAt,
140
- updatedAt: now,
141
- execution,
142
- workerCount,
143
- runtimeInstanceCount,
144
- runtimeStats,
145
- typeValues,
146
- suiteSelectors,
147
- fileNames: requestedFiles,
148
- shard: opts.shard || null,
149
- serviceFilter: opts.serviceFilter || null,
150
- scenarioSeed: opts.scenarioSeed || null,
151
- metadata,
152
- summarizeDbBackend,
153
- serviceLogs: logRegistry.listServiceLogs(),
154
- setupLogs: logRegistry.listSetupLogs(),
155
- setupOperations: setupRegistry.listOperations(),
156
- })
157
- );
158
- };
159
- const setupRegistry = createSetupOperationRegistry({
88
+ let writeLiveSnapshot = () => {};
89
+ const setupRegistry = createSetupOperationRegistry({ logRegistry, onChange: () => writeLiveSnapshot() });
90
+ writeLiveSnapshot = createLiveSnapshotWriter({
91
+ productDir,
92
+ configs,
93
+ trackers,
94
+ startedAt,
95
+ execution,
96
+ workerState,
97
+ selection: {
98
+ typeValues,
99
+ suiteSelectors,
100
+ fileNames: requestedFiles,
101
+ shard: opts.shard || null,
102
+ serviceFilter: opts.serviceFilter || null,
103
+ scenarioSeed: opts.scenarioSeed || null,
104
+ },
105
+ metadata,
160
106
  logRegistry,
161
- onChange: writeLiveSnapshot,
107
+ setupRegistry,
162
108
  });
163
109
  const executedPlans = servicePlans.filter((plan) => !plan.skipped);
164
110
  let exitCode = 0;
@@ -178,9 +124,9 @@ export async function runAll(configs, typeValues, suiteSelectors, opts, allConfi
178
124
  for (const task of queue) {
179
125
  task.scenarioSeed = opts.scenarioSeed || null;
180
126
  }
181
- workerCount = Math.max(1, Math.min(execution.workers, queue.length));
182
- runtimeInstanceCount = graphs.reduce((sum, graph) => sum + graph.instanceCount, 0);
183
- const workers = Array.from({ length: workerCount }, (_unused, index) =>
127
+ workerState.workerCount = Math.max(1, Math.min(execution.workers, queue.length));
128
+ workerState.runtimeInstanceCount = graphs.reduce((sum, graph) => sum + graph.instanceCount, 0);
129
+ const workers = Array.from({ length: workerState.workerCount }, (_unused, index) =>
184
130
  createWorker(index + 1, productDir)
185
131
  );
186
132
  const runtimeManager = createRuntimeManager({
@@ -228,7 +174,7 @@ export async function runAll(configs, typeValues, suiteSelectors, opts, allConfi
228
174
  writeLiveSnapshot();
229
175
  }
230
176
  }
231
- runtimeStats = runtimeManager.getStats();
177
+ workerState.runtimeStats = runtimeManager.getStats();
232
178
  writeLiveSnapshot();
233
179
  } finally {
234
180
  await runtimeManager.cleanupAll();
@@ -241,85 +187,41 @@ export async function runAll(configs, typeValues, suiteSelectors, opts, allConfi
241
187
  results = configs.map((config) =>
242
188
  finalizeServiceResult(trackers.get(config.name), startedAt, finishedAt)
243
189
  );
244
- const runArtifact = buildRunArtifact({
190
+ const finalized = await finalizeRunArtifacts({
245
191
  productDir,
246
192
  results,
247
193
  startedAt,
248
194
  finishedAt,
249
195
  execution,
250
- workerCount,
251
- runtimeInstanceCount,
252
- runtimeStats,
253
- typeValues,
254
- suiteSelectors,
255
- fileNames: requestedFiles,
256
- shard: opts.shard || null,
257
- serviceFilter: opts.serviceFilter || null,
258
- scenarioSeed: opts.scenarioSeed || null,
259
- metadata,
260
- summarizeDbBackend,
261
- serviceLogs: logRegistry.listServiceLogs(),
262
- setupLogs: logRegistry.listSetupLogs(),
263
- setupOperations: setupRegistry.listOperations(),
264
- });
265
- const statusArtifact = opts.writeStatus
266
- ? buildStatusArtifact({
267
- productDir,
268
- results,
269
- typeValues,
270
- suiteSelectors,
271
- fileNames: requestedFiles,
272
- shard: opts.shard || null,
273
- serviceFilter: opts.serviceFilter || null,
274
- scenarioSeed: opts.scenarioSeed || null,
196
+ workerCount: workerState.workerCount,
197
+ runtimeInstanceCount: workerState.runtimeInstanceCount,
198
+ runtimeStats: workerState.runtimeStats,
199
+ selection: {
200
+ typeValues,
201
+ suiteSelectors,
202
+ fileNames: requestedFiles,
203
+ shard: opts.shard || null,
204
+ serviceFilter: opts.serviceFilter || null,
205
+ scenarioSeed: opts.scenarioSeed || null,
206
+ },
275
207
  metadata,
276
- })
277
- : null;
278
- const enrichedArtifacts = applyKnownFailuresToArtifacts(
279
- runArtifact,
280
- statusArtifact,
281
- knownFailures
282
- );
283
- knownFailureIssueValidation = await validateKnownFailureIssues({
284
- productDir,
285
- document: knownFailures,
286
- runArtifact: enrichedArtifacts.runArtifact,
287
- statusArtifact: enrichedArtifacts.statusArtifact,
288
- config: configs[0]?.testkit?.reporting?.issueValidation || null,
289
- gitMetadata: metadata.git,
208
+ logRegistry,
209
+ setupRegistry,
210
+ knownFailures,
211
+ issueValidationConfig: configs[0]?.testkit?.reporting?.issueValidation || null,
212
+ telemetry,
213
+ reporter,
214
+ writeStatus: opts.writeStatus,
290
215
  });
291
- applyKnownFailureIssueValidationToArtifacts(
292
- enrichedArtifacts.runArtifact,
293
- enrichedArtifacts.statusArtifact,
294
- knownFailureIssueValidation
295
- );
296
- attachKnownFailureIssueValidation(
297
- enrichedArtifacts.runArtifact,
298
- enrichedArtifacts.statusArtifact,
299
- knownFailureIssueValidation
300
- );
301
-
302
- writeRunArtifact(productDir, enrichedArtifacts.runArtifact);
303
- if (opts.writeStatus) {
304
- writeStatusArtifact(productDir, enrichedArtifacts.statusArtifact);
305
- }
306
- const nextHistory = updateHistoryFromRunArtifact(
307
- loadHistory(productDir),
308
- enrichedArtifacts.runArtifact,
309
- enrichedArtifacts.runArtifact.generatedAt
310
- );
311
- saveHistory(productDir, nextHistory);
312
-
313
- reporter?.runSummary?.(results, finishedAt - startedAt, knownFailureIssueValidation);
314
- await reportTelemetry(telemetry, enrichedArtifacts.runArtifact, reporter);
216
+ knownFailureIssueValidation = finalized.knownFailureIssueValidation;
315
217
  if (results.some((result) => result.failed)) exitCode = 1;
316
- if (shouldFailKnownFailureIssueValidation(knownFailureIssueValidation)) {
218
+ if (finalized.shouldFailIssueValidation) {
317
219
  exitCode = 1;
318
220
  }
319
221
  if (lifecycle.isStopRequested()) exitCode = Math.max(exitCode, 130);
320
222
  return {
321
- runArtifact: enrichedArtifacts.runArtifact,
322
- statusArtifact: enrichedArtifacts.statusArtifact,
223
+ runArtifact: finalized.runArtifact,
224
+ statusArtifact: finalized.statusArtifact,
323
225
  results,
324
226
  exitCode,
325
227
  };
@@ -386,36 +288,3 @@ function collectServicePlans(configs, configMap, typeValues, suiteSelectors, opt
386
288
  };
387
289
  });
388
290
  }
389
-
390
- async function reportTelemetry(telemetry, artifact, reporter = null) {
391
- if (!telemetry?.enabled) return;
392
-
393
- try {
394
- const outcome = await uploadTelemetryArtifact(telemetry, artifact);
395
- if (outcome?.ok) {
396
- reporter?.telemetry?.("Telemetry: uploaded run artifact");
397
- return;
398
- }
399
- if (outcome?.reason === "missing-token") {
400
- reporter?.telemetry?.(
401
- `Telemetry: skipped upload because ${telemetry.tokenEnv || "configured token env"} is not set`
402
- );
403
- return;
404
- }
405
- if (outcome?.reason && !outcome.skipped) return;
406
- } catch (error) {
407
- reporter?.telemetry?.(`Telemetry: upload failed (${formatError(error)})`);
408
- }
409
- }
410
-
411
- function normalizePathSeparators(filePath) {
412
- return filePath.split("\\").join("/");
413
- }
414
-
415
- function attachKnownFailureIssueValidation(runArtifact, statusArtifact, validation) {
416
- if (!validation) return;
417
- runArtifact.knownFailuresIssueValidation = validation;
418
- if (statusArtifact) {
419
- statusArtifact.knownFailuresIssueValidation = validation;
420
- }
421
- }
@@ -1,14 +1,14 @@
1
1
  import path from "path";
2
2
  import { execa } from "execa";
3
3
  import { parsePlaywrightJsonResults } from "../reporters/playwright.mjs";
4
- import { resolveServiceCwd } from "../config/index.mjs";
4
+ import { resolveServiceCwd } from "../config/paths.mjs";
5
5
  import { formatFileTimeoutBudgetError } from "../shared/file-timeout.mjs";
6
6
  import { persistTaskOutputArtifacts } from "./artifacts.mjs";
7
7
  import { settleSubprocess } from "./default-runtime-runner.mjs";
8
8
  import { ensurePlaywrightTestConfig } from "./playwright-config.mjs";
9
+ import { registerManagedProcess, unregisterManagedProcess } from "./managed-processes.mjs";
9
10
  import { normalizePathSeparators } from "./state.mjs";
10
11
  import { buildPlaywrightEnv } from "./template.mjs";
11
- import { killChildProcess } from "./processes.mjs";
12
12
 
13
13
  export async function runPlaywrightTask(targetConfig, task, lifecycle, lease, reporter = null) {
14
14
  const local = targetConfig.testkit.local;
@@ -36,21 +36,14 @@ export async function runPlaywrightTask(targetConfig, task, lifecycle, lease, re
36
36
  forceKillAfterDelay: 5_000,
37
37
  }
38
38
  );
39
- lifecycle.registerProcess(subprocess, () => {
40
- killChildProcess(subprocess, "SIGINT");
41
- });
42
- if (lifecycle.isStopRequested()) {
43
- const interruptSubprocess = () => killChildProcess(subprocess, "SIGINT");
44
- if (subprocess.pid) interruptSubprocess();
45
- else subprocess.once?.("spawn", interruptSubprocess);
46
- }
39
+ registerManagedProcess(lifecycle, subprocess, "SIGINT");
47
40
  reporter?.taskStarted?.(task, targetConfig);
48
41
  let result;
49
42
  let timedOut;
50
43
  try {
51
44
  ({ result, timedOut } = await settleSubprocess(subprocess, fileTimeoutSeconds));
52
45
  } finally {
53
- lifecycle.unregisterProcess(subprocess.pid);
46
+ unregisterManagedProcess(lifecycle, subprocess);
54
47
  }
55
48
 
56
49
  const parsed = parsePlaywrightJsonResults(result.stdout || "", cwd);