@gate-forge/cli 0.13.5 → 0.13.6
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/CHANGELOG.md +59 -0
- package/README.md +1 -0
- package/dist/commands/test-gates.d.ts +7 -0
- package/dist/commands/test-gates.d.ts.map +1 -1
- package/dist/commands/test-gates.js +40 -1
- package/dist/commands/test-gates.js.map +1 -1
- package/dist/endpoint-compiler.d.ts +5 -0
- package/dist/endpoint-compiler.d.ts.map +1 -1
- package/dist/endpoint-compiler.js +37 -0
- package/dist/endpoint-compiler.js.map +1 -1
- package/dist/failure-artifacts.d.ts +19 -0
- package/dist/failure-artifacts.d.ts.map +1 -0
- package/dist/failure-artifacts.js +37 -0
- package/dist/failure-artifacts.js.map +1 -0
- package/dist/state.d.ts +7 -0
- package/dist/state.d.ts.map +1 -1
- package/dist/state.js +29 -0
- package/dist/state.js.map +1 -1
- package/guides/QUICKSTART.md +7 -7
- package/guides/REFERENCE.md +9 -1
- package/package.json +11 -11
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,64 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.13.6
|
|
4
|
+
|
|
5
|
+
- **A literal-vs-parameter route overlap resolves by the framework's own
|
|
6
|
+
registration order.** `resolveHttpRoute` marked an observed exchange
|
|
7
|
+
`ambiguous` whenever more than one inventoried route matched
|
|
8
|
+
method+path, so `GET /x/actions` — matching both the literal
|
|
9
|
+
`GET /x/actions` and a `GET /x/{event_id}` parameter route — could
|
|
10
|
+
never satisfy its claim even when the app really serves the literal
|
|
11
|
+
route: Starlette, and therefore FastAPI, matches routes in
|
|
12
|
+
REGISTRATION order (each router's routes copy at its `include_router`
|
|
13
|
+
call, depth-first in call order, decorator source order within a
|
|
14
|
+
router; the first full match — path AND method — serves). The FastAPI
|
|
15
|
+
detector now proves that order statically: every endpoint it can place
|
|
16
|
+
carries `registration: {scope, order}` (`scope` is the serving app's
|
|
17
|
+
uvicorn-style `module:var` identity, `order` the 0-based position in
|
|
18
|
+
the app's flattened registration sequence) plus `typedPathParams: true`
|
|
19
|
+
when the path string carries a typed convertor (`{n:int}`, `{p:path}` —
|
|
20
|
+
a convertor matches narrower than the canonical single-slot shape; a
|
|
21
|
+
function annotation such as `event_id: UUID` never affects routing and
|
|
22
|
+
is correctly ignored). The compiled inventory carries both through to
|
|
23
|
+
the resolver, which resolves a multi-match overlap ONLY when every
|
|
24
|
+
matched route carries a registration in the SAME app with distinct
|
|
25
|
+
orders and no route ordered ahead of the winner is typed — the
|
|
26
|
+
smallest order then grades like any unique match (match for its own
|
|
27
|
+
obligation, mismatch for every other endpoint's). Routes whose
|
|
28
|
+
position is not statically provable — appended to a router after it
|
|
29
|
+
was included, declared inside a function body, reachable from more
|
|
30
|
+
than one app, mounted through a call-time (registry-function)
|
|
31
|
+
include — carry no registration, and other packs emit none, so every
|
|
32
|
+
overlap they produce stays `ambiguous` exactly as before.
|
|
33
|
+
|
|
34
|
+
- **Supervised runs honour an owner-declared assertion timeout.** The
|
|
35
|
+
generated config a supervised Playwright run executes under set no
|
|
36
|
+
`expect.timeout`, so an assertion without an explicit timeout got
|
|
37
|
+
Playwright's 5-second default even when the consumer's own config
|
|
38
|
+
raised it — and the consumer config itself is never loaded, so the
|
|
39
|
+
value was unreachable. `runtime.yml expectTimeoutSeconds` (integer,
|
|
40
|
+
1–600) is now carried into the generated config as `expect.timeout`
|
|
41
|
+
(`test-gates` and the commit hook alike). When the key is absent,
|
|
42
|
+
nothing is emitted and Playwright's default stands.
|
|
43
|
+
|
|
44
|
+
- **A red selected run keeps its Playwright failure artifacts.**
|
|
45
|
+
`test-gates --result-only` without `--witness-url` ran in a temporary
|
|
46
|
+
state directory and deleted it with everything Playwright wrote for a
|
|
47
|
+
failed test (error context, screenshots), so a test that failed only
|
|
48
|
+
under the supervisor could not be diagnosed. The artifacts are now
|
|
49
|
+
copied to `<state dir>/last-failures/` (replaced every run, removed
|
|
50
|
+
after a run without failures) and the path is printed on stderr.
|
|
51
|
+
|
|
52
|
+
- **A blocked transport claim names the call that blocked it.** When a
|
|
53
|
+
test's witnessed session held an exchange of another endpoint (a login
|
|
54
|
+
before the real call) and the obligation's own call was blocked (a
|
|
55
|
+
literal-vs-parameter route overlap, or a non-2xx status), the verdict
|
|
56
|
+
reason named the unrelated exchange ("uniquely matches route POST
|
|
57
|
+
/auth/login") instead of the real cause. Reasons about the obligation's
|
|
58
|
+
own route now outrank exchanges of other endpoints, inside one observed
|
|
59
|
+
session and across sessions. Verdicts are unchanged; only the reason
|
|
60
|
+
text differs.
|
|
61
|
+
|
|
3
62
|
## 0.13.5
|
|
4
63
|
|
|
5
64
|
- **Supervised runs honour a project's declared test timeout.** The
|
package/README.md
CHANGED
|
@@ -4,6 +4,7 @@ The gateforge command-line interface: initialize a project, discover
|
|
|
4
4
|
resources and classification signals, inspect automatic decisions, reuse a
|
|
5
5
|
repository's existing tests, evaluate obligations, run the supervised E2E
|
|
6
6
|
gate, enforce the exact staged candidate, and maintain baselines.
|
|
7
|
+
**0.13.6:** A FastAPI literal-vs-parameter route overlap (`/items/export` vs `/items/{item_id}`) is attributed by registration order, as Starlette dispatches it, whenever pack-fastapi can place every matching route statically (otherwise it stays ambiguous). `runtime.yml expectTimeoutSeconds` sets the supervised run's `expect` timeout. A red `--result-only` run keeps Playwright's failure artifacts in `<state dir>/last-failures/`. A blocked transport claim names its own blocked call instead of an unrelated exchange from the same test.
|
|
7
8
|
**0.13.5:** Supervised runs honour a project's declared test timeout: the timeout Playwright resolves for each project (read from `playwright test --list` JSON, never by loading the config) becomes that project's timeout in the generated config, with 60 s as the floor.
|
|
8
9
|
**0.13.4:** A suite that mixes the fixture's `test` with Playwright's own runs in file order again when page observation is off: the fixture replaces Playwright's worker-scoped `browser` only for page observation, so the two runners no longer land in separate worker groups.
|
|
9
10
|
**0.13.3:** Hooks registered on the Gateforge fixture's `test` receive their fixtures again: 0.13.2 handed `test.beforeEach(async ({ page }) => …)` an undefined `page`. Titled hooks (`test.beforeEach('title', fn)`) work too, and a runner built with `test.extend(...)` keeps hook setup traffic uncredited like the base runner.
|
|
@@ -59,6 +59,13 @@ export interface SupervisedOptions {
|
|
|
59
59
|
* then the engine default (15 min) inside the supervised path.
|
|
60
60
|
*/
|
|
61
61
|
stallTimeoutMs?: number;
|
|
62
|
+
/**
|
|
63
|
+
* Assertion timeout ms, written as `expect.timeout` in the generated
|
|
64
|
+
* config the supervised run executes under. Undefined resolves from
|
|
65
|
+
* `runtime.yml expectTimeoutSeconds`; when neither declares a value no
|
|
66
|
+
* `expect` key is emitted and Playwright's own 5-second default stands.
|
|
67
|
+
*/
|
|
68
|
+
expectTimeoutMs?: number;
|
|
62
69
|
/**
|
|
63
70
|
* `--progress` target (additive): `stderr`, `file:<path>`, `off`, or
|
|
64
71
|
* undefined for the `run.progress` config key and then the CI-aware
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test-gates.d.ts","sourceRoot":"","sources":["../../src/commands/test-gates.ts"],"names":[],"mappings":"AA6DA,OAAO,EA4BL,KAAK,eAAe,EAEpB,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,KAAK,eAAe,EAEpB,KAAK,WAAW,EAGhB,KAAK,iBAAiB,EAKtB,KAAK,SAAS,EAcd,KAAK,gBAAgB,EACrB,KAAK,UAAU,EAGf,KAAK,WAAW,EAKhB,KAAK,QAAQ,EAEd,MAAM,kBAAkB,CAAC;AAsD1B,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,UAAU,CAAC;AA2CnC,OAAO,EAOL,KAAK,0BAA0B,EAChC,MAAM,cAAc,CAAC;AAyBtB,OAAO,EAQL,KAAK,yBAAyB,EAE/B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAwC7D,OAAO,EAA0B,KAAK,eAAe,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"test-gates.d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AK,EAAE,MAAM,EACb,eAAe,EAAE,eAAe,GAAG,IAAI,EACvC,QAAQ,EAAE,SAAS,iBAAiB,EAAE,GACrC,MAAM,CAgDR"}
|
|
@@ -98,6 +98,7 @@ import { captureServiceLogs, runHarnessSetup, runHarnessTeardown, } from '../run
|
|
|
98
98
|
import { pruneRunHistory, recordRunHistory } from '../history.js';
|
|
99
99
|
import { ProgressStream, resolveProgressTarget } from '../progress.js';
|
|
100
100
|
import { writeRunScopeView, writeStateFile, writeTestFailures } from '../state.js';
|
|
101
|
+
import { keepFailureArtifacts } from '../failure-artifacts.js';
|
|
101
102
|
export const TEST_GATES_USAGE = 'usage: gateforge test-gates [--changed] [--scope full|changed] [--suite <command>] [--out <dir>] ' +
|
|
102
103
|
'[--result-only] [--test <selector>] [--format text|json|sarif] [--witness-url <url>] [--run-token <token>] ' +
|
|
103
104
|
'[--run-timeout-min <minutes>] [--progress stderr|file:<path>|off|auto] ' +
|
|
@@ -229,6 +230,7 @@ export async function testGatesCommand(io, argv) {
|
|
|
229
230
|
runToken: stringFlag(options, 'run-token'),
|
|
230
231
|
runTimeoutMs: parseRunTimeoutMin(stringFlag(options, 'run-timeout-min')) ?? runtimeRunTimeoutMs(io.cwd),
|
|
231
232
|
stallTimeoutMs: runtimeStallTimeoutMs(io.cwd),
|
|
233
|
+
expectTimeoutMs: runtimeExpectTimeoutMs(io.cwd),
|
|
232
234
|
progress: progressFlag,
|
|
233
235
|
scope,
|
|
234
236
|
resultOnly,
|
|
@@ -238,8 +240,14 @@ export async function testGatesCommand(io, argv) {
|
|
|
238
240
|
});
|
|
239
241
|
}
|
|
240
242
|
finally {
|
|
241
|
-
if (isolatedStateDir !== undefined)
|
|
243
|
+
if (isolatedStateDir !== undefined) {
|
|
244
|
+
// The temporary run directory goes; a failed test's Playwright
|
|
245
|
+
// artifacts (error context, screenshots) stay diagnosable.
|
|
246
|
+
const kept = keepFailureArtifacts(isolatedStateDir, resolveStateDir(io.cwd));
|
|
247
|
+
if (kept !== null)
|
|
248
|
+
io.stderr.write(`test-gates: Playwright failure artifacts of this run: ${kept}\n`);
|
|
242
249
|
rmSync(isolatedStateDir, { recursive: true, force: true });
|
|
250
|
+
}
|
|
243
251
|
}
|
|
244
252
|
}
|
|
245
253
|
return legacyTestGates(io, {
|
|
@@ -357,6 +365,32 @@ function runtimeStallTimeoutMs(cwd) {
|
|
|
357
365
|
return undefined;
|
|
358
366
|
}
|
|
359
367
|
}
|
|
368
|
+
/**
|
|
369
|
+
* The assertion timeout the OWNER declared in the staged runtime
|
|
370
|
+
* document, in milliseconds, or undefined when the document declares
|
|
371
|
+
* none.
|
|
372
|
+
*
|
|
373
|
+
* `runtime.yml`'s `expectTimeoutSeconds` is the owner's answer to "how
|
|
374
|
+
* long may an assertion wait": the consumer config is never loaded, so
|
|
375
|
+
* this declaration is the only way a raised `expect.timeout` reaches
|
|
376
|
+
* the supervised run's generated config. A document that cannot be read
|
|
377
|
+
* declares nothing, and Playwright's 5-second default stands.
|
|
378
|
+
*
|
|
379
|
+
* Args:
|
|
380
|
+
* cwd: absolute repository root.
|
|
381
|
+
*
|
|
382
|
+
* Returns:
|
|
383
|
+
* number | undefined: milliseconds, or undefined for the engine default.
|
|
384
|
+
*/
|
|
385
|
+
function runtimeExpectTimeoutMs(cwd) {
|
|
386
|
+
try {
|
|
387
|
+
const seconds = loadRuntimeConfigAt(cwd, loadConfigAt(cwd).runtime)?.expectTimeoutSeconds;
|
|
388
|
+
return seconds === undefined ? undefined : seconds * 1_000;
|
|
389
|
+
}
|
|
390
|
+
catch {
|
|
391
|
+
return undefined;
|
|
392
|
+
}
|
|
393
|
+
}
|
|
360
394
|
/**
|
|
361
395
|
* The legacy `--suite` orchestration (unchanged behavior): materialize
|
|
362
396
|
* run state, run the user's suite command, evaluate, report.
|
|
@@ -1770,6 +1804,10 @@ async function runSupervisedTestGatesInner(io, options, declaredRunnerEnvNames)
|
|
|
1770
1804
|
// caller that has no value of its own (the commit hook), and the
|
|
1771
1805
|
// engine default stands when neither declares one.
|
|
1772
1806
|
const stallTimeoutMs = options.stallTimeoutMs ?? runtimeStallTimeoutMs(io.cwd);
|
|
1807
|
+
// The assertion timeout: same rule as the stall bound — the caller's
|
|
1808
|
+
// value wins, the document is re-read for an in-process caller, and
|
|
1809
|
+
// neither declaring one means no `expect` key in the generated config.
|
|
1810
|
+
const expectTimeoutMs = options.expectTimeoutMs ?? runtimeExpectTimeoutMs(io.cwd);
|
|
1773
1811
|
// The reuse digest is the IDENTITY of the dependency bytes this run
|
|
1774
1812
|
// executes against, and it must be the same value whoever computes it.
|
|
1775
1813
|
// ONE resolver owns that value: the commit hook hands over the digest
|
|
@@ -3645,6 +3683,7 @@ async function runSupervisedTestGatesInner(io, options, declaredRunnerEnvNames)
|
|
|
3645
3683
|
// the kill timer moves). The stall bound is the default backstop.
|
|
3646
3684
|
...(runTimeoutMs !== undefined ? { timeoutMs: runTimeoutMs } : {}),
|
|
3647
3685
|
...(stallTimeoutMs !== undefined ? { stallTimeoutMs } : {}),
|
|
3686
|
+
...(expectTimeoutMs !== undefined ? { expectTimeoutMs } : {}),
|
|
3648
3687
|
activity: runActivity,
|
|
3649
3688
|
},
|
|
3650
3689
|
})
|