@gfdelarue/testkit 0.5.0 → 0.6.1

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 (215) hide show
  1. package/README.md +590 -165
  2. package/bin/testkit-windows-owner-arm64.exe +0 -0
  3. package/bin/testkit-windows-owner-x64.exe +0 -0
  4. package/dist/app/bugs/batch.js +1 -0
  5. package/dist/app/bugs/ci-report.js +2 -2
  6. package/dist/app/bugs/ci-summary.js +3 -3
  7. package/dist/app/bugs/draft.js +2 -2
  8. package/dist/app/bugs/file.js +1 -1
  9. package/dist/app/bugs/guide.js +1 -1
  10. package/dist/app/bugs/record.js +2 -2
  11. package/dist/app/bugs/run-reading.js +1 -1
  12. package/dist/app/bugs/store.js +1 -1
  13. package/dist/app/campaigns/index.js +2 -2
  14. package/dist/app/campaigns/summary.js +1 -1
  15. package/dist/app/cleanup/index.js +1 -1
  16. package/dist/app/db-schema/prepare.js +1 -1
  17. package/dist/app/db-schema/refresh.js +1 -1
  18. package/dist/app/db-schema/verify.js +1 -1
  19. package/dist/app/destroy/index.js +1 -1
  20. package/dist/app/discover/index.js +2 -2
  21. package/dist/app/environments/config-driven.js +1 -1
  22. package/dist/app/environments/file-setup.js +1 -1
  23. package/dist/app/environments/routing.js +1 -1
  24. package/dist/app/environments/static-values.js +1 -1
  25. package/dist/app/environments/supplied.js +1 -1
  26. package/dist/app/inspect/index.js +1 -1
  27. package/dist/app/lint/native.js +1 -1
  28. package/dist/app/lint/options.js +1 -1
  29. package/dist/app/lint/shared.js +1 -1
  30. package/dist/app/run/engine-orchestration.js +1 -1
  31. package/dist/app/run/environment.js +1 -1
  32. package/dist/app/run/live-run.js +1 -1
  33. package/dist/app/run/orchestrator.js +1 -1
  34. package/dist/app/run/planning.js +1 -1
  35. package/dist/app/run/request.js +1 -1
  36. package/dist/app/run/results.js +1 -1
  37. package/dist/app/run/run-finalization.js +1 -1
  38. package/dist/app/run/run-finisher.js +1 -0
  39. package/dist/app/run/setup/runtime-node-setup-protocol.js +1 -1
  40. package/dist/app/run/setup/runtime-node-setup-worker.js +1 -1
  41. package/dist/app/run/setup/runtime-node-setup.js +2 -2
  42. package/dist/app/run/task-batches.js +1 -1
  43. package/dist/app/run/worker-loop.js +1 -1
  44. package/dist/app/status/model.js +1 -1
  45. package/dist/app/status/runs.js +1 -1
  46. package/dist/app/stop/index.js +1 -1
  47. package/dist/app/tracker/index.js +1 -1
  48. package/dist/app/tracker/token.js +2 -2
  49. package/dist/app/typecheck/index.js +4 -4
  50. package/dist/cli/command-catalog.js +1 -1
  51. package/dist/cli/command-flags.js +1 -1
  52. package/dist/cli/commands/artifacts.js +2 -2
  53. package/dist/cli/commands/bug/file.js +3 -2
  54. package/dist/cli/commands/discover.js +1 -1
  55. package/dist/cli/commands/guard/unsafe-entrypoint.js +1 -1
  56. package/dist/cli/commands/run.js +2 -2
  57. package/dist/cli/commands/typecheck.js +1 -1
  58. package/dist/cli/commands/workspace.js +1 -1
  59. package/dist/cli/framework/help.js +5 -5
  60. package/dist/cli/framework/parser.js +1 -1
  61. package/dist/cli/json-errors.js +1 -1
  62. package/dist/cli/renderers/bug/text.js +1 -1
  63. package/dist/cli/renderers/run/formatting.js +1 -1
  64. package/dist/config/authoring/database-fixture-discovery.js +1 -0
  65. package/dist/config/authoring/index.js +1 -1
  66. package/dist/config/loader/config-loader.js +1 -1
  67. package/dist/config/loader/decode-discovery.js +1 -1
  68. package/dist/config/loader/discover-tests.js +1 -1
  69. package/dist/config/loader/discovery-result.js +1 -0
  70. package/dist/config/loader/discovery.js +2 -2
  71. package/dist/config/loader/file-metadata.js +1 -1
  72. package/dist/config/loader/groups.js +2 -1
  73. package/dist/config/loader/index.js +1 -1
  74. package/dist/config/loader/load.js +1 -1
  75. package/dist/config/loader/managed-configs.js +1 -1
  76. package/dist/config/loader/owned-discovery.js +1 -1
  77. package/dist/config/loader/runtime-isolation.js +1 -1
  78. package/dist/config/loader/skip-config.js +1 -1
  79. package/dist/config/loader/test-selection.js +1 -1
  80. package/dist/database/admin.js +5 -2
  81. package/dist/database/call-caps.js +1 -0
  82. package/dist/database/cleanup.js +1 -1
  83. package/dist/database/configured-steps.js +1 -1
  84. package/dist/database/constants.js +1 -1
  85. package/dist/database/docker-endpoint.js +1 -0
  86. package/dist/database/docker-metadata.js +2 -2
  87. package/dist/database/docker.js +5 -5
  88. package/dist/database/index.js +2 -1
  89. package/dist/database/lifecycle-cleanup.js +1 -1
  90. package/dist/database/local-postgres.js +4 -1
  91. package/dist/database/naming.js +1 -1
  92. package/dist/database/operation-deadline.js +1 -0
  93. package/dist/database/postgres/connection-check.js +1 -1
  94. package/dist/database/postgres/index.js +2 -2
  95. package/dist/database/postgres/owned-exec.js +27 -0
  96. package/dist/database/postgres/protocol.js +2 -2
  97. package/dist/database/provider.js +1 -0
  98. package/dist/database/roles.js +2 -2
  99. package/dist/database/schema-operations.js +5 -1
  100. package/dist/database/schema-source.js +3 -3
  101. package/dist/database/steps.js +1 -1
  102. package/dist/database/template-steps.js +4 -4
  103. package/dist/domain/identifiers.js +1 -1
  104. package/dist/domain/retired-test-types.js +1 -1
  105. package/dist/domain/suite-selection.js +1 -1
  106. package/dist/domain/test-types.js +1 -1
  107. package/dist/engines/adapters/evidence-files.js +1 -1
  108. package/dist/engines/adapters/execution.js +1 -1
  109. package/dist/engines/catalog.js +1 -1
  110. package/dist/engines/definitions.js +1 -1
  111. package/dist/engines/environment/index.js +1 -1
  112. package/dist/engines/installations/node-vitest.js +1 -1
  113. package/dist/engines/installations/playwright.js +1 -1
  114. package/dist/engines/managed-module-resolution.js +6 -2
  115. package/dist/engines/node-vitest/adapter/adapter.js +1 -1
  116. package/dist/engines/node-vitest/adapter/driver.js +2 -2
  117. package/dist/engines/node-vitest/adapter/evidence.js +2 -2
  118. package/dist/engines/node-vitest/adapter/workspace.js +8 -24
  119. package/dist/engines/node-vitest/inventory/index.js +2 -2
  120. package/dist/engines/node-vitest/inventory/list-files.js +3 -3
  121. package/dist/engines/node-vitest/runtime/data/index.js +1 -1
  122. package/dist/engines/node-vitest/runtime/data/report.js +1 -1
  123. package/dist/engines/node-vitest/runtime/data/scenario.js +2 -2
  124. package/dist/engines/node-vitest/runtime/runtime-input.js +1 -1
  125. package/dist/engines/playwright/adapter/adapter.js +1 -1
  126. package/dist/engines/playwright/adapter/browser-network-evidence.js +4 -0
  127. package/dist/engines/playwright/adapter/config.js +16 -6
  128. package/dist/engines/playwright/adapter/evidence.js +2 -1
  129. package/dist/engines/playwright/adapter/failure-details.js +2 -2
  130. package/dist/engines/playwright/adapter/reporter.js +1 -1
  131. package/dist/engines/playwright/runtime/browser-network.js +1 -0
  132. package/dist/engines/playwright/runtime/browser-traffic.js +1 -0
  133. package/dist/engines/playwright/runtime/chromium-environment.js +1 -0
  134. package/dist/engines/playwright/runtime/emulation.js +1 -0
  135. package/dist/engines/playwright/runtime/index.js +1 -1
  136. package/dist/engines/playwright/runtime/managed-test.js +1 -0
  137. package/dist/engines/playwright/runtime/runtime-input.js +2 -2
  138. package/dist/environment/lifecycle-controller.js +1 -1
  139. package/dist/environment/lifecycle.js +1 -1
  140. package/dist/environment/maintenance.js +1 -1
  141. package/dist/environment/run-environment.js +1 -1
  142. package/dist/environment/run-stopping.js +1 -1
  143. package/dist/environment/runtime-manager.js +1 -1
  144. package/dist/evidence/artifact-config.js +1 -1
  145. package/dist/evidence/artifacts.js +5 -2
  146. package/dist/evidence/bundles.js +2 -1
  147. package/dist/evidence/compressed-artifacts.js +1 -0
  148. package/dist/evidence/environment-record.js +1 -1
  149. package/dist/evidence/index.js +1 -1
  150. package/dist/evidence/live-run-summary.js +1 -0
  151. package/dist/evidence/local-paths.js +1 -0
  152. package/dist/evidence/maintenance.js +1 -0
  153. package/dist/evidence/operation-timings.js +1 -1
  154. package/dist/evidence/read-run.js +1 -1
  155. package/dist/evidence/redaction.js +4 -4
  156. package/dist/evidence/run-evidence.js +1 -0
  157. package/dist/evidence/setup-progress.js +1 -1
  158. package/dist/evidence/storage-inventory.js +1 -1
  159. package/dist/evidence/storage.js +2 -2
  160. package/dist/kernel/known-keys.js +1 -0
  161. package/dist/kernel/redaction-targets.js +1 -1
  162. package/dist/kernel/redaction.js +7 -4
  163. package/dist/process/engine-environment-keys.js +1 -0
  164. package/dist/process/environment-overlay.js +1 -1
  165. package/dist/process/environment.js +1 -1
  166. package/dist/process/execa-bundle.json +3 -3
  167. package/dist/process/files/evidence-writes.js +1 -0
  168. package/dist/process/files/product-dir.js +1 -1
  169. package/dist/process/host-process.js +1 -1
  170. package/dist/process/index.js +1 -1
  171. package/dist/process/lifecycle-fence.js +1 -1
  172. package/dist/process/lock-progress.js +2 -0
  173. package/dist/process/locks.js +4 -4
  174. package/dist/process/process-identity.js +1 -1
  175. package/dist/process/process.js +35 -35
  176. package/dist/process/recovery.js +1 -1
  177. package/dist/process/runs/manifest.js +1 -1
  178. package/dist/process/runs/ownership.js +1 -1
  179. package/dist/process/runs/stop.js +1 -1
  180. package/dist/process/shutdown.js +1 -1
  181. package/dist/process/windows-native.js +1 -1
  182. package/dist/repo/fingerprint-policy.js +1 -1
  183. package/dist/repo/history.js +7 -4
  184. package/dist/repo/managed-git.js +1 -1
  185. package/dist/repo/state.js +4 -4
  186. package/dist/steps/configured-step-testkit-modules.js +1 -1
  187. package/dist/steps/environment.js +1 -1
  188. package/dist/toolchains/index.js +2 -2
  189. package/dist/toolchains/node-provisioning.js +2 -2
  190. package/dist/toolchains/vitest/index.js +1 -1
  191. package/dist/tracker/gitea.js +1 -1
  192. package/dist/tracker/github.js +1 -1
  193. package/dist/tracker/http.js +1 -1
  194. package/dist/tracker/ownership.js +1 -0
  195. package/dist/tracker/redaction.js +1 -1
  196. package/dist/tracker/responses.js +1 -1
  197. package/dist/types/config.d.ts +7 -86
  198. package/dist/types/environment.d.ts +6 -0
  199. package/dist/types/node-vitest-data.d.ts +2 -218
  200. package/dist/types/playwright.d.ts +21 -0
  201. package/dist/types/workspace.d.ts +30 -14
  202. package/docs/bug-records.md +19 -18
  203. package/docs/engines.md +115 -21
  204. package/docs/release-notes.md +2846 -0
  205. package/docs/test-types.md +19 -69
  206. package/package.json +15 -6
  207. package/testkit-config-schema.md +101 -170
  208. package/dist/app/lint/rules/data.js +0 -1
  209. package/dist/config/authoring/runtime.js +0 -1
  210. package/dist/config/loader/task-policy.js +0 -1
  211. package/dist/engines/node-vitest/runtime/contract/index.js +0 -1
  212. package/dist/engines/node-vitest/runtime/data/http.js +0 -1
  213. package/dist/engines/node-vitest/runtime/data/runner.js +0 -1
  214. package/dist/environment/lifecycle-artifacts.js +0 -1
  215. package/dist/types/node-vitest-contract.d.ts +0 -75
@@ -1 +1 @@
1
- import{isUnknownRecord as u}from"../kernel/unknown-values.js";import{TrackerError as c}from"./http.js";export function decodeTrackerLabel(t,e){const n=s(t,e,"label");return{id:m(n.id,e,"label.id"),name:i(n.name,e,"label.name")}}export function decodeTrackerLabels(t,e){return a(t,e,"labels").map(n=>decodeTrackerLabel(n,e))}export function decodeTrackerIssue(t,e){const n=s(t,e,"issue");return{issue:{body:f(n.body,e,"issue.body"),labels:(n.labels===void 0?[]:a(n.labels,e,"issue.labels")).map(r=>typeof r=="string"?r:i(s(r,e,"issue.labels[]").name,e,"issue.labels[].name")),number:m(n.number,e,"issue.number"),title:i(n.title,e,"issue.title"),url:b(n.html_url,e,"issue.html_url")},pullRequest:n.pull_request!==void 0&&n.pull_request!==null}}export function requireIssueLabels(t,e,n,r){const p=new Set(t.labels.map(l=>l.toLowerCase())),d=e.filter(l=>!p.has(l.toLowerCase()));if(d.length===0)return t;const h=`${r.owner}/${r.name}`;throw new c("forbidden",`${n} created ${t.url} without these labels: ${d.join(", ")}. The token's user may not label issues in ${h}. Close that issue, then run this again with a token whose user may label issues.`)}export function decodeTrackerIssues(t,e){return a(t,e,"issues").map(n=>decodeTrackerIssue(n,e))}export function decodeTrackerComment(t,e){const n=s(t,e,"comment");return{body:f(n.body,e,"comment.body"),id:m(n.id,e,"comment.id"),url:b(n.html_url,e,"comment.html_url")}}export function decodeTrackerComments(t,e){return a(t,e,"comments").map(n=>decodeTrackerComment(n,e))}export function decodeTrackerCommitStatusContext(t,e){return i(s(t,e,"commit status").context,e,"commit status.context")}export function isDuplicateLabelRejection(t){return!u(t)||!Array.isArray(t.errors)?!1:t.errors.some(e=>u(e)&&e.code==="already_exists")}export function decodeGiteaVersion(t){return u(t)&&typeof t.version=="string"&&t.version.length>0?t.version:null}function o(t,e,n){return new c("rejected",`${t} returned a response Testkit cannot read: ${e} must be ${n}`)}function s(t,e,n){if(!u(t))throw o(e,n,"an object");return t}function a(t,e,n){if(!Array.isArray(t))throw o(e,n,"a list");return t}function i(t,e,n){if(typeof t!="string")throw o(e,n,"a string");return t}function f(t,e,n){return t==null?"":i(t,e,n)}function m(t,e,n){if(typeof t!="number"||!Number.isSafeInteger(t)||t<=0)throw o(e,n,"a positive integer");return t}function b(t,e,n){const r=i(t,e,n);if(!/^https?:\/\/[^\s/]/u.test(r)||!URL.canParse(r))throw o(e,n,"an http or https URL");return r}
1
+ import{isUnknownRecord as s}from"../kernel/unknown-values.js";import{TrackerError as c}from"./http.js";export function decodeTrackerLabel(e,t){const n=o(e,t,"label");return{id:l(n.id,t,"label.id"),name:i(n.name,t,"label.name")}}export function decodeTrackerLabels(e,t){return a(e,t,"labels").map(n=>decodeTrackerLabel(n,t))}export function decodeTrackerIssue(e,t){const n=o(e,t,"issue");return{issue:{body:m(n.body,t,"issue.body"),labels:(n.labels===void 0?[]:a(n.labels,t,"issue.labels")).map(r=>typeof r=="string"?r:i(o(r,t,"issue.labels[]").name,t,"issue.labels[].name")),number:l(n.number,t,"issue.number"),title:i(n.title,t,"issue.title"),url:f(n.html_url,t,"issue.html_url")},pullRequest:n.pull_request!==void 0&&n.pull_request!==null}}export function missingIssueLabels(e,t){const n=new Set(e.labels.map(r=>r.toLowerCase()));return t.filter(r=>!n.has(r.toLowerCase()))}export function unlabelledIssueError(e,t,n,r,b){const p=`${r.owner}/${r.name}`,h=b?"Testkit closed that issue. Run this again":"Testkit could not close that issue. Close it, then run this again";return new c("forbidden",`${e} created ${t.url} without these labels: ${n.join(", ")}. The token's user may not label issues in ${p}. ${h} with a token whose user may label issues.`)}export function decodeTrackerIssues(e,t){return a(e,t,"issues").map(n=>decodeTrackerIssue(n,t))}export function decodeTrackerComment(e,t){const n=o(e,t,"comment");return{author:d(n.user),body:m(n.body,t,"comment.body"),id:l(n.id,t,"comment.id"),url:f(n.html_url,t,"comment.html_url")}}export function decodeTrackerUserLogin(e,t){return i(o(e,t,"user").login,t,"user.login")}export function decodeTrackerComments(e,t){return a(e,t,"comments").map(n=>decodeTrackerComment(n,t))}export function decodeTrackerCommitStatus(e,t){const n=o(e,t,"commit status");return{context:i(n.context,t,"commit status.context"),creator:d(n.creator)}}function d(e){return s(e)&&typeof e.login=="string"?e.login:null}export function isDuplicateLabelRejection(e){return!s(e)||!Array.isArray(e.errors)?!1:e.errors.some(t=>s(t)&&t.code==="already_exists")}export function decodeGiteaVersion(e){return s(e)&&typeof e.version=="string"&&e.version.length>0?e.version:null}function u(e,t,n){return new c("rejected",`${e} returned a response Testkit cannot read: ${t} must be ${n}`)}function o(e,t,n){if(!s(e))throw u(t,n,"an object");return e}function a(e,t,n){if(!Array.isArray(e))throw u(t,n,"a list");return e}function i(e,t,n){if(typeof e!="string")throw u(t,n,"a string");return e}function m(e,t,n){return e==null?"":i(e,t,n)}function l(e,t,n){if(typeof e!="number"||!Number.isSafeInteger(e)||e<=0)throw u(t,n,"a positive integer");return e}function f(e,t,n){const r=i(e,t,n);if(!/^https?:\/\/[^\s/]/u.test(r)||!URL.canParse(r))throw u(t,n,"an http or https URL");return r}
@@ -3,79 +3,6 @@ declare const RUNTIME_ISOLATION_POLICIES: readonly [
3
3
  "resetBefore"
4
4
  ];
5
5
  export type RuntimeIsolationPolicy = (typeof RUNTIME_ISOLATION_POLICIES)[number];
6
- export type RuntimeMethod = "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
7
- export interface RuntimeHeaders {
8
- [key: string]: string;
9
- }
10
- export interface RuntimeCookie {
11
- value: string;
12
- }
13
- export interface RuntimeEnv {
14
- BASE: string;
15
- rawEnv?: Record<string, string | undefined>;
16
- }
17
- export interface HttpRequestParams {
18
- [key: string]: unknown;
19
- headers?: RuntimeHeaders;
20
- }
21
- export type HttpProfileEnvironment = Readonly<Record<string, string | undefined>>;
22
- export interface HttpProfileEnv {
23
- [key: string]: unknown;
24
- BASE?: string;
25
- rawEnv?: HttpProfileEnvironment;
26
- }
27
- export type HttpProfileResolvedEnv = HttpProfileEnv & RuntimeEnv;
28
- export interface HttpProfileHeaderContext {
29
- actor?: string | null;
30
- env?: HttpProfileEnv;
31
- }
32
- export type HttpProfileHeaderBuilder<TSetup = unknown> = (setupData: TSetup | null, context?: HttpProfileHeaderContext & {
33
- env: HttpProfileResolvedEnv;
34
- }) => RuntimeHeaders | undefined;
35
- /** Response shape the in-process profile setup client resolves to. */
36
- export interface HttpProfileResponse {
37
- body: string;
38
- cookies?: Record<string, RuntimeCookie[] | undefined>;
39
- headers?: Record<string, string>;
40
- status: number;
41
- }
42
- export type HttpProfileRequestMethod = "del" | "get" | "patch" | "post" | "put";
43
- /** HTTP verbs an execution engine hands to a profile's setup step. */
44
- export type HttpProfileRequestClient<TResult = Promise<HttpProfileResponse>> = {
45
- [Method in HttpProfileRequestMethod]: Method extends "get" ? (url: string, params?: HttpRequestParams) => TResult : (url: string, body?: unknown, params?: HttpRequestParams) => TResult;
46
- };
47
- export interface HttpProfileSetupContext {
48
- env: HttpProfileResolvedEnv;
49
- http: HttpProfileRequestClient;
50
- json(response: unknown): unknown;
51
- }
52
- /**
53
- * Explicit, test-owned authentication for a named HTTP profile. The data
54
- * profile runs `setup` or `setupAsync` once and passes the
55
- * result to `headers` for every request.
56
- */
57
- export interface HttpProfileAuth<TSetup = unknown> {
58
- headers?: HttpProfileHeaderBuilder<TSetup>;
59
- setup?(context: HttpProfileSetupContext): TSetup;
60
- setupAsync?(context: HttpProfileSetupContext): Promise<TSetup>;
61
- }
62
- export interface HttpProfileConfig<TSetup = unknown> {
63
- [key: string]: unknown;
64
- auth?: HttpProfileAuth<TSetup> | null;
65
- baseUrl?: string;
66
- env?: HttpProfileEnv;
67
- headers?: HttpProfileHeaderBuilder<TSetup>;
68
- rawHeaders?: HttpProfileHeaderBuilder<TSetup>;
69
- }
70
- export interface RepoConfig {
71
- [key: string]: unknown;
72
- profiles?: {
73
- http?: Record<string, HttpProfileConfig>;
74
- };
75
- }
76
- export declare function registerRepoConfig(config: RepoConfig | null | undefined): void;
77
- export declare function getRepoConfig(): RepoConfig | null;
78
- export declare function clearRepoConfig(): void;
79
6
  export interface DatabaseBindingEnvConfig {
80
7
  prefix: string;
81
8
  service: string;
@@ -128,6 +55,7 @@ export interface StepsBuildConfigInput extends BuildConfigInputBase {
128
55
  steps?: ConfiguredStepInput[];
129
56
  }
130
57
  export type BuildConfigInput = TscBuildConfigInput | ScriptBuildConfigInput | NextBuildConfigInput | StepsBuildConfigInput;
58
+ export type RuntimeMethod = "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
131
59
  export type TemplateCommandStepConfig = ConfiguredCommandStepInput;
132
60
  export type TemplateSqlFileStepConfig = ConfiguredSqlFileStepInput;
133
61
  export type TemplateModuleStepConfig = ConfiguredModuleStepInput;
@@ -251,7 +179,7 @@ export interface RuntimeIsolationConfig {
251
179
  export interface TestkitExecutionConfig {
252
180
  fileTimeoutSeconds?: number;
253
181
  taskConcurrency?: number;
254
- /** @deprecated Use taskConcurrency. Removed in 0.3.0. */
182
+ /** @deprecated Use taskConcurrency. */
255
183
  workers?: number;
256
184
  }
257
185
  export interface FingerprintConfig {
@@ -267,7 +195,7 @@ export interface TestkitBoundaryLintRuleConfig extends TestkitLintRuleConfig {
267
195
  allowed?: string[];
268
196
  trackedOnly?: boolean;
269
197
  }
270
- export type TestkitLintRuleName = "engineImports" | "uiSpecShape" | "dataSuiteContract" | "configImports" | "testkitBoundary" | "unitTestBoundaries";
198
+ export type TestkitLintRuleName = "engineImports" | "uiSpecShape" | "configImports" | "testkitBoundary" | "unitTestBoundaries";
271
199
  export interface TestkitLintConfig {
272
200
  rules?: Partial<Record<Exclude<TestkitLintRuleName, "testkitBoundary">, boolean | TestkitLintRuleConfig>> & {
273
201
  testkitBoundary?: boolean | TestkitBoundaryLintRuleConfig;
@@ -313,9 +241,6 @@ export interface ServiceConfig {
313
241
  envFiles?: string[];
314
242
  local?: false | ServiceLocalConfig;
315
243
  runtime?: RuntimeConfig;
316
- runtimeIsolation?: RuntimeIsolationPolicy | RuntimeIsolationConfig;
317
- requirements?: ServiceRequirementConfig;
318
- skip?: SkipConfig;
319
244
  }
320
245
  export interface AppServiceConfig extends ServiceConfig {
321
246
  local: ServiceLocalConfig;
@@ -328,9 +253,6 @@ export interface PresetServiceOptions extends Record<string, unknown> {
328
253
  discovery?: DiscoveryConfig;
329
254
  envFile?: string;
330
255
  envFiles?: string[];
331
- runtimeIsolation?: RuntimeIsolationPolicy | RuntimeIsolationConfig;
332
- requirements?: ServiceRequirementConfig;
333
- skip?: SkipConfig;
334
256
  }
335
257
  export interface AppRuntimeOptions {
336
258
  instances?: number;
@@ -378,7 +300,7 @@ export interface NodeNextPresetOptions {
378
300
  node?: string;
379
301
  npm?: string;
380
302
  taskConcurrency?: number;
381
- /** @deprecated Use taskConcurrency. Removed in 0.3.0. */
303
+ /** @deprecated Use taskConcurrency. */
382
304
  workers?: number;
383
305
  }
384
306
  export interface AreaConfig {
@@ -408,15 +330,14 @@ export interface TestkitConfig {
408
330
  fingerprints?: FingerprintConfig;
409
331
  groups?: Record<string, GroupConfig>;
410
332
  lint?: TestkitLintConfig;
411
- profiles?: {
412
- http?: Record<string, HttpProfileConfig>;
413
- };
414
333
  redact?: string[];
415
334
  services?: Record<string, ServiceConfig>;
416
335
  toolchains?: Record<string, ToolchainConfig>;
417
336
  ui?: UiConfig;
418
337
  }
419
- export declare function defineConfig<const TConfig extends TestkitConfig>(config: TConfig): TConfig;
338
+ export declare function defineConfig<const TConfig extends TestkitConfig>(config: TConfig & {
339
+ readonly [Key in Exclude<keyof TConfig, keyof TestkitConfig>]: never;
340
+ }): TConfig;
420
341
  declare function commandStep(run: string, options?: ConfiguredStepBaseInput): ConfiguredCommandStepInput;
421
342
  declare function sqlFileStep(filePath: string, options?: ConfiguredStepBaseInput): ConfiguredSqlFileStepInput;
422
343
  declare function moduleStep(target: string, options?: ConfiguredStepBaseInput): ConfiguredModuleStepInput;
@@ -1,3 +1,8 @@
1
+ export type JsonPrimitive = boolean | null | number | string;
2
+ export type JsonValue = JsonPrimitive | readonly JsonValue[] | JsonObject;
3
+ export interface JsonObject {
4
+ readonly [key: string]: JsonValue;
5
+ }
1
6
  export interface CapturedRequest {
2
7
  readonly bodyBytes: number;
3
8
  readonly bodyText: string;
@@ -36,5 +41,6 @@ export declare class EnvironmentValueMissingError extends Error {
36
41
  export declare function endpoint(name: string): string;
37
42
  export declare function database(name: string): string;
38
43
  export declare function handle(name: string): EnvironmentHandle;
44
+ export declare function setupData(): JsonValue;
39
45
 
40
46
  export {};
@@ -1,78 +1,10 @@
1
- import { TestContext, expect } from 'vitest';
1
+ import { TestContext } from 'vitest';
2
2
 
3
- export type RuntimeMethod = "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
4
- export interface RuntimeHeaders {
5
- [key: string]: string;
6
- }
7
- export interface RuntimeCookie {
8
- value: string;
9
- }
10
- export interface RuntimeEnv {
11
- BASE: string;
12
- rawEnv?: Record<string, string | undefined>;
13
- }
14
- export interface HttpRequestParams {
15
- [key: string]: unknown;
16
- headers?: RuntimeHeaders;
17
- }
18
- export type HttpProfileEnvironment = Readonly<Record<string, string | undefined>>;
19
- export interface HttpProfileEnv {
20
- [key: string]: unknown;
21
- BASE?: string;
22
- rawEnv?: HttpProfileEnvironment;
23
- }
24
- export type HttpProfileResolvedEnv = HttpProfileEnv & RuntimeEnv;
25
- export interface HttpProfileHeaderContext {
26
- actor?: string | null;
27
- env?: HttpProfileEnv;
28
- }
29
- export type HttpProfileHeaderBuilder<TSetup = unknown> = (setupData: TSetup | null, context?: HttpProfileHeaderContext & {
30
- env: HttpProfileResolvedEnv;
31
- }) => RuntimeHeaders | undefined;
32
- /** Response shape the in-process profile setup client resolves to. */
33
- export interface HttpProfileResponse {
34
- body: string;
35
- cookies?: Record<string, RuntimeCookie[] | undefined>;
36
- headers?: Record<string, string>;
37
- status: number;
38
- }
39
- export type HttpProfileRequestMethod = "del" | "get" | "patch" | "post" | "put";
40
- /** HTTP verbs an execution engine hands to a profile's setup step. */
41
- export type HttpProfileRequestClient<TResult = Promise<HttpProfileResponse>> = {
42
- [Method in HttpProfileRequestMethod]: Method extends "get" ? (url: string, params?: HttpRequestParams) => TResult : (url: string, body?: unknown, params?: HttpRequestParams) => TResult;
43
- };
44
- export interface HttpProfileSetupContext {
45
- env: HttpProfileResolvedEnv;
46
- http: HttpProfileRequestClient;
47
- json(response: unknown): unknown;
48
- }
49
- /**
50
- * Explicit, test-owned authentication for a named HTTP profile. The data
51
- * profile runs `setup` or `setupAsync` once and passes the
52
- * result to `headers` for every request.
53
- */
54
- export interface HttpProfileAuth<TSetup = unknown> {
55
- headers?: HttpProfileHeaderBuilder<TSetup>;
56
- setup?(context: HttpProfileSetupContext): TSetup;
57
- setupAsync?(context: HttpProfileSetupContext): Promise<TSetup>;
58
- }
59
- export interface HttpMethods<Response, Extra extends unknown[]> {
60
- get: (path: string, ...extra: Extra) => Response;
61
- delete: (path: string, body?: unknown, ...extra: Extra) => Response;
62
- post: (path: string, body?: unknown, ...extra: Extra) => Response;
63
- put: (path: string, body?: unknown, ...extra: Extra) => Response;
64
- patch: (path: string, body?: unknown, ...extra: Extra) => Response;
65
- }
66
3
  declare const DATA_ARTIFACT_KIND = "testkit.data-flow";
67
4
  declare const DATA_SCHEMA_VERSION = 1;
68
5
  export type DataFindingSeverity = "error" | "info" | "waste" | "watch";
69
6
  export type DataMetricBudgetOperator = "<" | "<=" | "==" | ">" | ">=" | "exists";
70
7
  export type DataSequenceBudgetOperator = "exists" | "sequence==" | "sequenceOnly";
71
- export interface DataScenarioOptions {
72
- description?: string;
73
- timeout?: number;
74
- timeoutMs?: number;
75
- }
76
8
  export interface DataMetricOptions {
77
9
  description?: string;
78
10
  dimensions?: Record<string, unknown>;
@@ -102,136 +34,21 @@ export interface DataSequenceBudget {
102
34
  includesOnly(values: readonly unknown[], options?: DataBudgetOptions): this;
103
35
  required(options?: DataBudgetOptions): this;
104
36
  }
105
- export interface DataFixture {
106
- buffer(): Buffer;
107
- contentType: string;
108
- filename: string;
109
- json(): unknown;
110
- path: string;
111
- sha256: string;
112
- sizeBytes: number;
113
- text(encoding?: BufferEncoding): string;
114
- }
115
- export interface DataHttpResponse {
116
- body: string;
117
- cookies: Record<string, Array<{
118
- value: string;
119
- }>>;
120
- durationMs: number;
121
- headers: Record<string, string>;
122
- json(): unknown;
123
- method: string;
124
- path: string;
125
- status: number;
126
- url: string;
127
- }
128
- export interface DataHttpRequestOptions {
129
- contentTypeJson?: boolean;
130
- signal?: AbortSignal;
131
- }
132
- export interface DataActorSession {
133
- [key: string]: unknown;
134
- actorIndex?: number;
135
- email?: string | null;
136
- name?: string | null;
137
- organizationKey?: string | null;
138
- organizationName?: string | null;
139
- session?: Record<string, unknown> | null;
140
- }
141
- export interface DataSessionBundle {
142
- actors: Record<string, DataActorSession | undefined>;
143
- primaryActor: string | null;
144
- }
145
- export interface DataHttpHeaderContext {
146
- actor: DataActorSession | null;
147
- actorName: string | null;
148
- sessionBundle: DataSessionBundle | null;
149
- }
150
- export type DataHttpHeaderBuilder = (context: DataHttpHeaderContext) => Record<string, string>;
151
- export interface DataHttpClientOptions {
152
- baseUrl?: string;
153
- defaultActor?: string;
154
- defaultHeaders?: Record<string, string>;
155
- getHeaders?: DataHttpHeaderBuilder;
156
- getRawHeaders?: DataHttpHeaderBuilder;
157
- profile?: string;
158
- recorder?: DataHttpRecorder;
159
- sessionBundle?: DataSessionBundle;
160
- trace?: DataHttpRecorder;
161
- }
162
- export interface DataHttpRequest {
163
- (method: string, path: string, body?: unknown, headers?: Record<string, string>, options?: DataHttpRequestOptions): Promise<DataHttpResponse>;
164
- }
165
- export type DataActorRawRequest = DataHttpRequest & HttpMethods<Promise<DataHttpResponse>, [
166
- headers?: Record<string, string>,
167
- options?: DataHttpRequestOptions
168
- ]>;
169
- export interface DataRootRawRequest extends DataHttpRequest, Pick<HttpMethods<Promise<DataHttpResponse>, [
170
- headers?: Record<string, string>,
171
- options?: DataHttpRequestOptions
172
- ]>, "get" | "post"> {
173
- as(actorName: string): DataActorRawRequest;
174
- }
175
- export interface DataHttpMethods extends HttpMethods<Promise<DataHttpResponse>, [
176
- headers?: Record<string, string>,
177
- options?: DataHttpRequestOptions
178
- ]> {
179
- headers(extraHeaders?: Record<string, string>): Record<string, string>;
180
- rawHeaders(extraHeaders?: Record<string, string>): Record<string, string>;
181
- request(method: string, path: string, body?: unknown, headers?: Record<string, string>, options?: DataHttpRequestOptions): Promise<DataHttpResponse>;
182
- }
183
- export interface DataActorHttpClient extends DataHttpMethods {
184
- raw: DataActorRawRequest;
185
- rawReq: DataActorRawRequest;
186
- }
187
- export interface DataHttpActor {
188
- email: string | null;
189
- headers: Record<string, string>;
190
- index: number;
191
- key: string;
192
- name: string | null;
193
- organizationKey: string | null;
194
- organizationName: string | null;
195
- rawHeaders: Record<string, string>;
196
- rawReq: DataActorRawRequest;
197
- req: DataActorHttpClient;
198
- session: Record<string, unknown> | null;
199
- }
200
- export interface DataHttpActors {
201
- get(name: string): DataHttpActor;
202
- has(name: string): boolean;
203
- list(): DataHttpActor[];
204
- names: string[];
205
- primary: DataHttpActor | null;
206
- }
207
- export interface DataHttpClient extends DataHttpMethods {
208
- actor?: DataHttpActor | null;
209
- actors?: DataHttpActors;
210
- as(actorName: string): DataActorHttpClient;
211
- baseUrl: string;
212
- env?: HttpProfileEnv;
213
- raw: DataRootRawRequest;
214
- rawReq: DataRootRawRequest;
215
- }
216
37
  export interface DataHttpRequestRecord {
217
38
  bodyBytes?: number;
218
39
  durationMs?: number;
219
40
  method: string;
220
41
  path: string;
221
- requestHeaders?: Record<string, string>;
222
42
  responseBytes?: number;
223
43
  status?: number;
224
44
  }
225
- export interface DataHttpRecorder {
226
- recordHttpRequest(entry: DataHttpRequestRecord): unknown;
227
- }
228
45
  export interface DataExternalCallDetails extends DataEvidenceDetails {
229
46
  costMinor?: number;
230
47
  durationMs?: number;
231
48
  requestBytes?: number;
232
49
  responseBytes?: number;
233
50
  }
234
- export interface DataFlow extends DataHttpRecorder {
51
+ export interface DataFlow {
235
52
  addFinding(severity: string, message: string, details?: Record<string, unknown>): this;
236
53
  actor(name: string, details?: DataEvidenceDetails): this;
237
54
  budget(metricName: string): DataMetricBudget;
@@ -268,30 +85,6 @@ export interface DataFlow extends DataHttpRecorder {
268
85
  system(name: string, details?: DataEvidenceDetails): this;
269
86
  transition(name: string, details?: DataEvidenceDetails): this;
270
87
  }
271
- export interface DataScenarioContext extends DataFlow, DataRuntimeContext {
272
- fixture(name: string): DataFixture;
273
- http(options?: DataHttpProfileOptions): Promise<DataHttpClient>;
274
- }
275
- export interface DataRuntimeContext extends Record<string, unknown> {
276
- baseUrl?: string | null;
277
- engineId?: "node-vitest";
278
- readonly env: Readonly<Record<string, string>>;
279
- profileId?: "node-vitest-data";
280
- serviceName?: string;
281
- task?: {
282
- file?: string;
283
- id?: number | string;
284
- suiteName?: string;
285
- testType: "data";
286
- };
287
- }
288
- export type DataHttpProfileAuth = HttpProfileAuth<DataSessionBundle>;
289
- export interface DataHttpProfileOptions extends DataHttpClientOptions {
290
- auth?: DataHttpProfileAuth | null;
291
- env?: HttpProfileEnv;
292
- headers?: HttpProfileHeaderBuilder<DataSessionBundle>;
293
- rawHeaders?: HttpProfileHeaderBuilder<DataSessionBundle>;
294
- }
295
88
  export interface DataMetric {
296
89
  aggregation?: string;
297
90
  description: string | null;
@@ -358,7 +151,6 @@ export type DataBudgetResult = (Omit<DataMetricBudgetInput, "expected" | "messag
358
151
  export interface DataScenarioReport {
359
152
  budgetFailures: DataBudgetResult[];
360
153
  budgets: DataBudgetResult[];
361
- description: string | null;
362
154
  durationMs: number;
363
155
  error: SerializedDataError | null;
364
156
  events: DataEvent[];
@@ -391,17 +183,9 @@ export interface DataFlowReport {
391
183
  summaryText: string;
392
184
  taskId: string | null;
393
185
  }
394
- export declare function createHttpClient(options?: DataHttpClientOptions): DataHttpClient;
395
- export declare function readDataContext(): DataRuntimeContext;
396
186
  export declare function renderDataFlowMarkdown(report: DataFlowReport): string;
397
- export declare function dataScenario(name: string, run: (context: DataScenarioContext) => unknown): void;
398
- export declare function dataScenario(name: string, options: DataScenarioOptions, run: (context: DataScenarioContext) => unknown): void;
399
187
  export declare function dataFlow(context: TestContext): DataFlow;
400
188
  export declare function measureJsonBytes(value: unknown): number;
401
189
  export declare function stableHash(value: unknown): string;
402
190
 
403
- export {
404
- expect,
405
- };
406
-
407
191
  export {};
@@ -36,6 +36,27 @@ export interface PlaywrightConfigOptions {
36
36
  }
37
37
  export declare function defineTestkitConfig(): DefinedTestkitPlaywrightConfig;
38
38
  export declare function defineTestkitConfig<TestArgs = object, WorkerArgs = object>(config: PlaywrightTestConfig<TestArgs, WorkerArgs>, options?: PlaywrightConfigOptions): DefinedTestkitPlaywrightConfig<TestArgs, WorkerArgs>;
39
+ export type NetworkProfile = "3g" | "slow-4g" | "fast-4g";
40
+ export interface NetworkConditions {
41
+ latencyMs: number;
42
+ downloadKbps: number;
43
+ uploadKbps: number;
44
+ }
45
+ export declare function emulateNetwork(page: Page, conditions: NetworkProfile | NetworkConditions): Promise<void>;
46
+ export declare function emulateCpu(page: Page, slowdown: number): Promise<void>;
47
+ export interface BrowserRequest {
48
+ readonly service: string | null;
49
+ readonly method: string;
50
+ readonly url: string;
51
+ readonly path: string;
52
+ readonly resourceType: string;
53
+ readonly status: number | null;
54
+ readonly failure: string | null;
55
+ readonly requestBytes: number;
56
+ readonly responseBytes: number;
57
+ readonly durationMs: number | null;
58
+ }
59
+ export declare function browserRequests(): Promise<BrowserRequest[]>;
39
60
  export interface UiSandboxOptions {
40
61
  allowRemote?: boolean;
41
62
  backendBaseUrl?: string;
@@ -4,14 +4,10 @@ declare const ENGINE_IDS: readonly [
4
4
  ];
5
5
  export type EngineId = (typeof ENGINE_IDS)[number];
6
6
  declare const PUBLIC_TEST_TYPES: readonly [
7
- "ui",
8
- "contract",
9
- "data"
7
+ "ui"
10
8
  ];
11
9
  export type PublicTestType = (typeof PUBLIC_TEST_TYPES)[number];
12
10
  declare const RUNNER_PROFILE_IDS: readonly [
13
- "node-vitest-data",
14
- "node-vitest-contract",
15
11
  "node-vitest",
16
12
  "playwright-ui"
17
13
  ];
@@ -23,8 +19,7 @@ declare const RUNTIME_ISOLATION_POLICIES: readonly [
23
19
  export type RuntimeIsolationPolicy = (typeof RUNTIME_ISOLATION_POLICIES)[number];
24
20
  declare const RUN_TYPE_VALUES: readonly [
25
21
  "ui",
26
- "contract",
27
- "data",
22
+ "plain",
28
23
  "all"
29
24
  ];
30
25
  export type RunType = (typeof RUN_TYPE_VALUES)[number];
@@ -55,6 +50,28 @@ export interface SerializedError {
55
50
  diagnostics?: ErrorMetadataObject;
56
51
  stack?: string;
57
52
  }
53
+ declare const RETIRED_SUITE_IDENTITIES: readonly [
54
+ ...{
55
+ readonly engineId: "k6";
56
+ readonly profileId: "k6-http";
57
+ readonly testType: "e2e" | "int" | "load" | "scenario";
58
+ }[],
59
+ {
60
+ readonly engineId: "k6";
61
+ readonly profileId: "k6-dal";
62
+ readonly testType: "dal";
63
+ },
64
+ {
65
+ readonly engineId: "node-vitest";
66
+ readonly profileId: "node-vitest-contract";
67
+ readonly testType: "contract";
68
+ },
69
+ {
70
+ readonly engineId: "node-vitest";
71
+ readonly profileId: "node-vitest-data";
72
+ readonly testType: "data";
73
+ }
74
+ ];
58
75
  export type ReportingRecord = Record<string, unknown>;
59
76
  export interface ReportingFailureRequest extends ReportingRecord {
60
77
  method?: string;
@@ -131,9 +148,9 @@ export interface RunArtifactSuite extends ReportingRecord {
131
148
  files?: RunArtifactFile[];
132
149
  name: string;
133
150
  passedFileCount?: number;
134
- profileId: RunnerProfileId | "k6-dal" | "k6-http";
151
+ profileId: RunnerProfileId | (typeof RETIRED_SUITE_IDENTITIES)[number]["profileId"];
135
152
  skippedFileCount?: number;
136
- testType?: PublicTestType | "dal" | "e2e" | "int" | "load" | "scenario";
153
+ testType?: PublicTestType | (typeof RETIRED_SUITE_IDENTITIES)[number]["testType"];
137
154
  }
138
155
  export interface RunArtifactGroup extends ReportingRecord {
139
156
  name: string;
@@ -370,7 +387,6 @@ export type VitestSelection = Readonly<{
370
387
  project: null | string;
371
388
  runner: "auto" | "managed" | "repo";
372
389
  }>;
373
- export type TestGroupSource = "groups" | "implicit" | "services";
374
390
  export interface DiscoverySummary {
375
391
  activeFiles: number;
376
392
  byGroup: Record<string, number>;
@@ -393,6 +409,7 @@ export interface DiscoveryDiagnostic {
393
409
  path?: string;
394
410
  severity: "error" | "warning";
395
411
  }
412
+ export type TestGroupSource = "groups" | "implicit";
396
413
  export interface DiscoveryGroup {
397
414
  activeFileCount: number;
398
415
  fileCount: number;
@@ -461,6 +478,9 @@ export interface DiscoveryResult {
461
478
  suites: DiscoverySuite[];
462
479
  summary: DiscoverySummary;
463
480
  }
481
+ export declare function formatDisplayName(value: unknown): string;
482
+ export declare function testTypeContract(testType: DiscoveryTestType | undefined, engineId: EngineId, profileId: RunnerProfileId): DiscoveryTestContract;
483
+ export declare function fileDisplayName(filePath: string): string;
464
484
  export interface DiscoverTestsOptions {
465
485
  diagnostics?: "error" | "report";
466
486
  dir?: null | string;
@@ -472,9 +492,6 @@ export interface DiscoverTestsOptions {
472
492
  vitest?: VitestSelection;
473
493
  }
474
494
  export declare function discoverTests(options?: Readonly<DiscoverTestsOptions>): Promise<DiscoveryResult>;
475
- export declare function formatDisplayName(value: unknown): string;
476
- export declare function testTypeContract(testType: DiscoveryTestType | undefined, engineId: EngineId, profileId: RunnerProfileId): DiscoveryTestContract;
477
- export declare function fileDisplayName(filePath: string): string;
478
495
  export interface DesiredRuntimeGraphStatus {
479
496
  instanceCount: number;
480
497
  runtimeIds: string[];
@@ -608,7 +625,6 @@ export interface WorkspaceInspection {
608
625
  export interface InspectWorkspaceOptions {
609
626
  dir?: string;
610
627
  group?: null | string;
611
- notice?: (message: string) => void;
612
628
  status?: boolean;
613
629
  targetLimit?: number;
614
630
  }