@elench/testkit 0.1.42 → 0.1.44

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.
package/README.md CHANGED
@@ -68,6 +68,14 @@ export default defineTestkitSetup({
68
68
  workers: 8,
69
69
  fileTimeoutSeconds: 60,
70
70
  },
71
+ reporting: {
72
+ knownFailuresFile: "testkit.known-failures.json",
73
+ issueValidation: {
74
+ provider: "github",
75
+ mode: "warn",
76
+ cacheTtlSeconds: 900,
77
+ },
78
+ },
71
79
  services: {
72
80
  api: service({
73
81
  ...tsxService({
@@ -141,9 +149,24 @@ for:
141
149
  - migrate / seed commands
142
150
  - test-local migrate / seed overrides
143
151
  - named HTTP suite profiles
152
+ - known-failure annotation merge for enriched status/run artifacts
153
+ - optional GitHub-backed known-failure issue validation
144
154
  - repo-declared suite/file skip policies with explicit reasons
145
155
  - telemetry upload configuration
146
156
 
157
+ If `reporting.knownFailuresFile` is configured, `testkit` enriches
158
+ `.testkit/results/latest.json` and `testkit.status.json` with:
159
+
160
+ - per-file `failureDetails`
161
+ - per-file `triage` metadata (issue, classification, description)
162
+ - top-level `triageSummary` counts for known vs untriaged failures
163
+
164
+ If `reporting.issueValidation` is also configured, `testkit` validates known-failure
165
+ issue references against GitHub and adds top-level `knownFailuresIssueValidation`
166
+ data to the run/status artifacts. The most important stale-triage signal is:
167
+
168
+ - a known-failure test still fails, but the linked GitHub issue is closed
169
+
147
170
  ## Authoring
148
171
 
149
172
  HTTP suites:
@@ -15,6 +15,7 @@ import {
15
15
  normalizeRuntimeMaxConcurrentTasks,
16
16
  normalizeRuntimeInstances,
17
17
  } from "../runner/execution-config.mjs";
18
+ import { normalizeKnownFailureIssueValidationConfig } from "../known-failures/github.mjs";
18
19
 
19
20
  const TESTKIT_K6_BIN = "TESTKIT_K6_BIN";
20
21
  const DEFAULT_LOCAL_IMAGE = "pgvector/pgvector:pg16";
@@ -30,6 +31,7 @@ export async function loadConfigs(opts = {}) {
30
31
  const productDir = resolveProductDir(process.cwd(), opts.dir);
31
32
  const { setup, setupFile } = await loadTestkitSetup(productDir);
32
33
  const execution = normalizeRepoExecution(setup.execution);
34
+ const reporting = normalizeReportingConfig(setup.reporting);
33
35
  const explicitServices = setup.services || {};
34
36
  const discovery = discoverProject(productDir, explicitServices);
35
37
  const serviceNames = new Set([
@@ -46,6 +48,7 @@ export async function loadConfigs(opts = {}) {
46
48
  setup,
47
49
  setupFile,
48
50
  execution,
51
+ reporting,
49
52
  explicitService: explicitServices[name] || {},
50
53
  discoveredService: discovery.services[name] || null,
51
54
  suites: discovery.suitesByService[name] || {},
@@ -105,6 +108,7 @@ function normalizeServiceConfig({
105
108
  setup,
106
109
  setupFile,
107
110
  execution,
111
+ reporting,
108
112
  explicitService,
109
113
  discoveredService,
110
114
  suites,
@@ -157,6 +161,7 @@ function normalizeServiceConfig({
157
161
  suites,
158
162
  testkit: {
159
163
  execution,
164
+ reporting,
160
165
  dependsOn: explicitService.dependsOn || [],
161
166
  database,
162
167
  databaseFrom: explicitService.databaseFrom,
@@ -172,6 +177,22 @@ function normalizeServiceConfig({
172
177
  };
173
178
  }
174
179
 
180
+ function normalizeReportingConfig(value) {
181
+ if (!value) return null;
182
+
183
+ const knownFailuresFile = normalizeOptionalString(value.knownFailuresFile);
184
+ if (!knownFailuresFile) {
185
+ throw new Error('testkit.setup.ts reporting.knownFailuresFile must be a non-empty string');
186
+ }
187
+
188
+ const issueValidation = normalizeKnownFailureIssueValidationConfig(value.issueValidation);
189
+
190
+ return {
191
+ knownFailuresFile,
192
+ issueValidation,
193
+ };
194
+ }
195
+
175
196
  function normalizeLocalConfig(name, explicitService, discoveredService, productDir) {
176
197
  if (Object.prototype.hasOwnProperty.call(explicitService, "local")) {
177
198
  if (explicitService.local === false) {
@@ -282,6 +303,12 @@ function normalizeRuntimeConfig(value, serviceName) {
282
303
  };
283
304
  }
284
305
 
306
+ function normalizeOptionalString(value) {
307
+ if (typeof value !== "string") return null;
308
+ const normalized = value.trim();
309
+ return normalized.length > 0 ? normalized : null;
310
+ }
311
+
285
312
  function normalizeLifecycle(value) {
286
313
  if (!value) return undefined;
287
314
  if (!value.cmd && !value.testkitCmd) {