@gate-forge/cli 0.7.1 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +91 -704
- package/dist/adapter-audit.d.ts +208 -0
- package/dist/adapter-audit.d.ts.map +1 -0
- package/dist/adapter-audit.js +579 -0
- package/dist/adapter-audit.js.map +1 -0
- package/dist/adapter-scaffold.d.ts +91 -0
- package/dist/adapter-scaffold.d.ts.map +1 -0
- package/dist/adapter-scaffold.js +474 -0
- package/dist/adapter-scaffold.js.map +1 -0
- package/dist/adopted-baseline.d.ts +10 -0
- package/dist/adopted-baseline.d.ts.map +1 -1
- package/dist/adopted-baseline.js +18 -1
- package/dist/adopted-baseline.js.map +1 -1
- package/dist/args.d.ts +15 -0
- package/dist/args.d.ts.map +1 -1
- package/dist/args.js +61 -2
- package/dist/args.js.map +1 -1
- package/dist/behavior-setup.d.ts +239 -0
- package/dist/behavior-setup.d.ts.map +1 -0
- package/dist/behavior-setup.js +751 -0
- package/dist/behavior-setup.js.map +1 -0
- package/dist/broker.d.ts.map +1 -1
- package/dist/broker.js +28 -2
- package/dist/broker.js.map +1 -1
- package/dist/cache-exclusions.d.ts +45 -0
- package/dist/cache-exclusions.d.ts.map +1 -0
- package/dist/cache-exclusions.js +205 -0
- package/dist/cache-exclusions.js.map +1 -0
- package/dist/candidate-tree.d.ts +86 -14
- package/dist/candidate-tree.d.ts.map +1 -1
- package/dist/candidate-tree.js +236 -62
- package/dist/candidate-tree.js.map +1 -1
- package/dist/ci-witnessed-template.d.ts +43 -0
- package/dist/ci-witnessed-template.d.ts.map +1 -0
- package/dist/ci-witnessed-template.js +283 -0
- package/dist/ci-witnessed-template.js.map +1 -0
- package/dist/cli.d.ts +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +31 -4
- package/dist/cli.js.map +1 -1
- package/dist/commands/adapters.d.ts +15 -0
- package/dist/commands/adapters.d.ts.map +1 -0
- package/dist/commands/adapters.js +355 -0
- package/dist/commands/adapters.js.map +1 -0
- package/dist/commands/adopt.d.ts +7 -0
- package/dist/commands/adopt.d.ts.map +1 -1
- package/dist/commands/adopt.js +44 -2
- package/dist/commands/adopt.js.map +1 -1
- package/dist/commands/baseline.d.ts.map +1 -1
- package/dist/commands/baseline.js +42 -1
- package/dist/commands/baseline.js.map +1 -1
- package/dist/commands/blocking.d.ts +105 -2
- package/dist/commands/blocking.d.ts.map +1 -1
- package/dist/commands/blocking.js +395 -53
- package/dist/commands/blocking.js.map +1 -1
- package/dist/commands/check.d.ts +36 -0
- package/dist/commands/check.d.ts.map +1 -1
- package/dist/commands/check.js +1068 -64
- package/dist/commands/check.js.map +1 -1
- package/dist/commands/classify.d.ts +2 -1
- package/dist/commands/classify.d.ts.map +1 -1
- package/dist/commands/classify.js +188 -5
- package/dist/commands/classify.js.map +1 -1
- package/dist/commands/enforce.d.ts +4 -4
- package/dist/commands/enforce.d.ts.map +1 -1
- package/dist/commands/enforce.js +41 -9
- package/dist/commands/enforce.js.map +1 -1
- package/dist/commands/enforcement.d.ts +13 -1
- package/dist/commands/enforcement.d.ts.map +1 -1
- package/dist/commands/enforcement.js +880 -33
- package/dist/commands/enforcement.js.map +1 -1
- package/dist/commands/explain.d.ts +1 -1
- package/dist/commands/explain.d.ts.map +1 -1
- package/dist/commands/explain.js +162 -3
- package/dist/commands/explain.js.map +1 -1
- package/dist/commands/history.d.ts +12 -0
- package/dist/commands/history.d.ts.map +1 -0
- package/dist/commands/history.js +45 -0
- package/dist/commands/history.js.map +1 -0
- package/dist/commands/init-presets.d.ts +155 -0
- package/dist/commands/init-presets.d.ts.map +1 -0
- package/dist/commands/init-presets.js +203 -0
- package/dist/commands/init-presets.js.map +1 -0
- package/dist/commands/init.d.ts +7 -12
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +987 -99
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/keys.d.ts.map +1 -1
- package/dist/commands/keys.js +29 -13
- package/dist/commands/keys.js.map +1 -1
- package/dist/commands/next.d.ts.map +1 -1
- package/dist/commands/next.js +846 -19
- package/dist/commands/next.js.map +1 -1
- package/dist/commands/pre-commit.d.ts +25 -0
- package/dist/commands/pre-commit.d.ts.map +1 -1
- package/dist/commands/pre-commit.js +91 -6
- package/dist/commands/pre-commit.js.map +1 -1
- package/dist/commands/quarantine.d.ts +16 -0
- package/dist/commands/quarantine.d.ts.map +1 -0
- package/dist/commands/quarantine.js +213 -0
- package/dist/commands/quarantine.js.map +1 -0
- package/dist/commands/run.d.ts +39 -0
- package/dist/commands/run.d.ts.map +1 -0
- package/dist/commands/run.js +196 -0
- package/dist/commands/run.js.map +1 -0
- package/dist/commands/test-gates.d.ts +284 -2
- package/dist/commands/test-gates.d.ts.map +1 -1
- package/dist/commands/test-gates.js +3620 -187
- package/dist/commands/test-gates.js.map +1 -1
- package/dist/commands/tests.d.ts +1 -1
- package/dist/commands/tests.d.ts.map +1 -1
- package/dist/commands/tests.js +264 -29
- package/dist/commands/tests.js.map +1 -1
- package/dist/docs-exclusions.d.ts.map +1 -1
- package/dist/docs-exclusions.js +18 -3
- package/dist/docs-exclusions.js.map +1 -1
- package/dist/endpoint-compiler.d.ts.map +1 -1
- package/dist/endpoint-compiler.js +78 -9
- package/dist/endpoint-compiler.js.map +1 -1
- package/dist/engine-browser.d.ts +183 -0
- package/dist/engine-browser.d.ts.map +1 -0
- package/dist/engine-browser.js +381 -0
- package/dist/engine-browser.js.map +1 -0
- package/dist/engine-identity.d.ts +100 -0
- package/dist/engine-identity.d.ts.map +1 -0
- package/dist/engine-identity.js +182 -0
- package/dist/engine-identity.js.map +1 -0
- package/dist/evaluate.d.ts +105 -1
- package/dist/evaluate.d.ts.map +1 -1
- package/dist/evaluate.js +149 -18
- package/dist/evaluate.js.map +1 -1
- package/dist/execution.d.ts +253 -9
- package/dist/execution.d.ts.map +1 -1
- package/dist/execution.js +309 -12
- package/dist/execution.js.map +1 -1
- package/dist/gateforge-owned.d.ts +78 -0
- package/dist/gateforge-owned.d.ts.map +1 -0
- package/dist/gateforge-owned.js +254 -0
- package/dist/gateforge-owned.js.map +1 -0
- package/dist/git-hooks.d.ts +35 -0
- package/dist/git-hooks.d.ts.map +1 -1
- package/dist/git-hooks.js +140 -1
- package/dist/git-hooks.js.map +1 -1
- package/dist/git-ignored.d.ts +27 -0
- package/dist/git-ignored.d.ts.map +1 -0
- package/dist/git-ignored.js +102 -0
- package/dist/git-ignored.js.map +1 -0
- package/dist/git-objects.d.ts +60 -0
- package/dist/git-objects.d.ts.map +1 -0
- package/dist/git-objects.js +152 -0
- package/dist/git-objects.js.map +1 -0
- package/dist/glob.d.ts +33 -14
- package/dist/glob.d.ts.map +1 -1
- package/dist/glob.js +96 -5
- package/dist/glob.js.map +1 -1
- package/dist/history.d.ts +52 -0
- package/dist/history.d.ts.map +1 -0
- package/dist/history.js +116 -0
- package/dist/history.js.map +1 -0
- package/dist/host-load.d.ts +49 -0
- package/dist/host-load.d.ts.map +1 -0
- package/dist/host-load.js +78 -0
- package/dist/host-load.js.map +1 -0
- package/dist/index.d.ts +4 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/input-snapshot.d.ts +63 -9
- package/dist/input-snapshot.d.ts.map +1 -1
- package/dist/input-snapshot.js +195 -17
- package/dist/input-snapshot.js.map +1 -1
- package/dist/io.d.ts +49 -0
- package/dist/io.d.ts.map +1 -1
- package/dist/io.js +22 -0
- package/dist/io.js.map +1 -1
- package/dist/mapping.d.ts +84 -1
- package/dist/mapping.d.ts.map +1 -1
- package/dist/mapping.js +276 -5
- package/dist/mapping.js.map +1 -1
- package/dist/native-freeze.d.ts +217 -0
- package/dist/native-freeze.d.ts.map +1 -0
- package/dist/native-freeze.js +332 -0
- package/dist/native-freeze.js.map +1 -0
- package/dist/pipeline.d.ts +67 -1
- package/dist/pipeline.d.ts.map +1 -1
- package/dist/pipeline.js +164 -6
- package/dist/pipeline.js.map +1 -1
- package/dist/planes-inference.d.ts +12 -5
- package/dist/planes-inference.d.ts.map +1 -1
- package/dist/planes-inference.js +13 -15
- package/dist/planes-inference.js.map +1 -1
- package/dist/playwright-browsers.d.ts +210 -0
- package/dist/playwright-browsers.d.ts.map +1 -0
- package/dist/playwright-browsers.js +364 -0
- package/dist/playwright-browsers.js.map +1 -0
- package/dist/plugins.d.ts +15 -5
- package/dist/plugins.d.ts.map +1 -1
- package/dist/plugins.js +59 -9
- package/dist/plugins.js.map +1 -1
- package/dist/progress.d.ts +148 -0
- package/dist/progress.d.ts.map +1 -0
- package/dist/progress.js +263 -0
- package/dist/progress.js.map +1 -0
- package/dist/providers.d.ts +26 -1
- package/dist/providers.d.ts.map +1 -1
- package/dist/providers.js +39 -0
- package/dist/providers.js.map +1 -1
- package/dist/receipts.d.ts +1 -0
- package/dist/receipts.d.ts.map +1 -1
- package/dist/receipts.js +35 -7
- package/dist/receipts.js.map +1 -1
- package/dist/repo-scan.d.ts +15 -1
- package/dist/repo-scan.d.ts.map +1 -1
- package/dist/repo-scan.js +329 -34
- package/dist/repo-scan.js.map +1 -1
- package/dist/reseal-chain.d.ts +184 -0
- package/dist/reseal-chain.d.ts.map +1 -0
- package/dist/reseal-chain.js +735 -0
- package/dist/reseal-chain.js.map +1 -0
- package/dist/reseal-evidence.d.ts +241 -0
- package/dist/reseal-evidence.d.ts.map +1 -0
- package/dist/reseal-evidence.js +319 -0
- package/dist/reseal-evidence.js.map +1 -0
- package/dist/reseal.d.ts +181 -0
- package/dist/reseal.d.ts.map +1 -0
- package/dist/reseal.js +1620 -0
- package/dist/reseal.js.map +1 -0
- package/dist/response-field-guidance.d.ts +82 -0
- package/dist/response-field-guidance.d.ts.map +1 -0
- package/dist/response-field-guidance.js +184 -0
- package/dist/response-field-guidance.js.map +1 -0
- package/dist/route-plane-proposals.d.ts +100 -0
- package/dist/route-plane-proposals.d.ts.map +1 -0
- package/dist/route-plane-proposals.js +213 -0
- package/dist/route-plane-proposals.js.map +1 -0
- package/dist/run-cache.d.ts +260 -0
- package/dist/run-cache.d.ts.map +1 -0
- package/dist/run-cache.js +771 -0
- package/dist/run-cache.js.map +1 -0
- package/dist/run-preflight.d.ts +77 -0
- package/dist/run-preflight.d.ts.map +1 -0
- package/dist/run-preflight.js +774 -0
- package/dist/run-preflight.js.map +1 -0
- package/dist/run-recipe.d.ts +107 -0
- package/dist/run-recipe.d.ts.map +1 -0
- package/dist/run-recipe.js +295 -0
- package/dist/run-recipe.js.map +1 -0
- package/dist/run-reliability.d.ts +126 -0
- package/dist/run-reliability.d.ts.map +1 -0
- package/dist/run-reliability.js +221 -0
- package/dist/run-reliability.js.map +1 -0
- package/dist/runtime.d.ts +15 -0
- package/dist/runtime.d.ts.map +1 -1
- package/dist/runtime.js +11 -1
- package/dist/runtime.js.map +1 -1
- package/dist/scope.d.ts +20 -0
- package/dist/scope.d.ts.map +1 -1
- package/dist/scope.js +26 -5
- package/dist/scope.js.map +1 -1
- package/dist/secret-guard.d.ts +36 -0
- package/dist/secret-guard.d.ts.map +1 -0
- package/dist/secret-guard.js +63 -0
- package/dist/secret-guard.js.map +1 -0
- package/dist/singleton-guidance.d.ts +82 -0
- package/dist/singleton-guidance.d.ts.map +1 -0
- package/dist/singleton-guidance.js +138 -0
- package/dist/singleton-guidance.js.map +1 -0
- package/dist/staged-candidate.d.ts +17 -0
- package/dist/staged-candidate.d.ts.map +1 -1
- package/dist/staged-candidate.js +50 -0
- package/dist/staged-candidate.js.map +1 -1
- package/dist/state-artifacts.d.ts +70 -0
- package/dist/state-artifacts.d.ts.map +1 -0
- package/dist/state-artifacts.js +215 -0
- package/dist/state-artifacts.js.map +1 -0
- package/dist/state.d.ts +170 -2
- package/dist/state.d.ts.map +1 -1
- package/dist/state.js +248 -8
- package/dist/state.js.map +1 -1
- package/dist/unmatched-routes.d.ts +60 -0
- package/dist/unmatched-routes.d.ts.map +1 -0
- package/dist/unmatched-routes.js +131 -0
- package/dist/unmatched-routes.js.map +1 -0
- package/dist/verifier-keys.d.ts +33 -2
- package/dist/verifier-keys.d.ts.map +1 -1
- package/dist/verifier-keys.js +95 -9
- package/dist/verifier-keys.js.map +1 -1
- package/guides/CONNECT-YOUR-PROJECT.md +425 -0
- package/guides/QUICKSTART.md +306 -26
- package/guides/REFERENCE.md +1710 -0
- package/guides/RUNNER-NEUTRAL-EVIDENCE.md +199 -0
- package/guides/TEST-ENVIRONMENT.md +1044 -6
- package/guides/UPGRADE-0.6-to-0.7.md +3 -3
- package/guides/UPGRADE-0.7-to-0.8.md +114 -0
- package/guides/UPGRADE-0.8-to-0.9.md +104 -0
- package/package.json +10 -9
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
# Runners other than Playwright
|
|
2
|
+
|
|
3
|
+
The witness is an HTTP proxy plus a DB/queue reader. It does not care who
|
|
4
|
+
sends the traffic, so the only runner-specific work is three jobs:
|
|
5
|
+
|
|
6
|
+
1. **List** the tests before the run (the expected set is fixed first).
|
|
7
|
+
2. **Tag** every request with the test identity (a per-test session proxy
|
|
8
|
+
origin, or a signed session header).
|
|
9
|
+
3. **Read results** from a structured report (native JSON or JUnit XML) —
|
|
10
|
+
never from terminal colors.
|
|
11
|
+
|
|
12
|
+
Each runner below is a `RunnerAdapter` behind the same contract
|
|
13
|
+
(`@gate-forge/witness/adapter`) and is graded by the same conformance
|
|
14
|
+
suite: every planned test passes on the first attempt, a failure blocks, a
|
|
15
|
+
skip blocks, a runner-assisted retry blocks, an unplanned test blocks, a
|
|
16
|
+
zero-test run blocks, and a report row with no runner identity is
|
|
17
|
+
attributed to nothing. A runner's own "passed" is never authority.
|
|
18
|
+
|
|
19
|
+
Additions only: JSON keys, cause codes, exit codes, config keys and receipts
|
|
20
|
+
are frozen, and an existing Playwright project sees no change at all.
|
|
21
|
+
|
|
22
|
+
## In-process test clients are refused
|
|
23
|
+
|
|
24
|
+
The rule behind all of it: a request that never crosses the session proxy
|
|
25
|
+
can never be witnessed. supertest handed the app instance, FastAPI
|
|
26
|
+
`TestClient`, or an in-process fetch therefore fails the run with a typed
|
|
27
|
+
message instead of passing quietly. Point the client at the app's base URL
|
|
28
|
+
under the supervised run and the same test becomes real evidence.
|
|
29
|
+
|
|
30
|
+
## pytest + httpx
|
|
31
|
+
|
|
32
|
+
- **Where**: `@gate-forge/pack-playwright` — `discovery/pytest-runner-adapter.ts`
|
|
33
|
+
plus the pack's pytest plugin (`python/gateforge_pytest_plugin.py`).
|
|
34
|
+
- **Enumerate**: the configured suite argv with `--collect-only -q`. The
|
|
35
|
+
expected set is the collection result, before anything runs.
|
|
36
|
+
- **Tag**: the plugin opens a witness session per test and routes the
|
|
37
|
+
test's `httpx` client through that test's session proxy origin.
|
|
38
|
+
- **Read**: strict JUnit XML. A case without its file attribute is never
|
|
39
|
+
attributed to a test, and a duplicated case (a rerun) is reported as a
|
|
40
|
+
runner-assisted retry.
|
|
41
|
+
- **Use it**: configure the suite with `witnessed: true` and load the
|
|
42
|
+
plugin through `PYTHONPATH` (the adapter does this for you). Drive the
|
|
43
|
+
app over HTTP (`await client.post(f"{base_url}/...")`) — a
|
|
44
|
+
`TestClient(app)` call is refused.
|
|
45
|
+
|
|
46
|
+
## Jest/Vitest + supertest
|
|
47
|
+
|
|
48
|
+
- **Where**: `@gate-forge/pack-playwright` — `discovery/vitest-runner-adapter.ts`,
|
|
49
|
+
the reporter at `src/vitest/reporter.ts`, the in-test helper exported as
|
|
50
|
+
`@gate-forge/pack-playwright/vitest`.
|
|
51
|
+
- **Enumerate**: the project's own `vitest list --run --json`, so the
|
|
52
|
+
expected set comes from the runner that will execute it.
|
|
53
|
+
- **Tag**: the pack's reporter spools the same lifecycle events the
|
|
54
|
+
Playwright reporter writes, and the in-test helper resolves the
|
|
55
|
+
supervisor session for the RUNNING test and rewrites supertest traffic
|
|
56
|
+
onto that session's proxy origin.
|
|
57
|
+
- **Read**: the jest-compatible JSON report, strictly. A row with no
|
|
58
|
+
file/title identity is never attributed, and the reporter's flags
|
|
59
|
+
document surfaces `test.retry` attempts (required retries are zero).
|
|
60
|
+
- **Use it**:
|
|
61
|
+
```js
|
|
62
|
+
import request from 'supertest';
|
|
63
|
+
import { gateforgeSupertest } from '@gate-forge/pack-playwright/vitest';
|
|
64
|
+
const gate = gateforgeSupertest(request);
|
|
65
|
+
|
|
66
|
+
test('creates an account', async () => {
|
|
67
|
+
const api = await gate(process.env.GATEFORGE_APP_BASE_URL);
|
|
68
|
+
const response = await api.post('/api/accounts').send({ first_name: 'Grace' });
|
|
69
|
+
expect(response.status).toBe(201);
|
|
70
|
+
});
|
|
71
|
+
```
|
|
72
|
+
`gate(app)` with the app itself (in-process supertest) is REFUSED with
|
|
73
|
+
`IN_PROCESS_CLIENT_REFUSED` — it would be a counterfeit green.
|
|
74
|
+
|
|
75
|
+
## Cypress
|
|
76
|
+
|
|
77
|
+
- **Where**: `@gate-forge/pack-playwright` — `discovery/cypress-runner-adapter.ts`,
|
|
78
|
+
the plugin at `src/cypress/plugin.ts`, plus the support file the adapter
|
|
79
|
+
generates per run.
|
|
80
|
+
- **Enumerate**: Cypress cannot list tests without running them, so the
|
|
81
|
+
expected set is read from the spec SOURCES. A spec whose titles are not
|
|
82
|
+
static string literals enumerates as unavailable — the adapter refuses to
|
|
83
|
+
guess a half-set rather than run against an incomplete expectation.
|
|
84
|
+
- **Tag**: the adapter runs the project's own Cypress CLI with a generated
|
|
85
|
+
config that chains your config (`setupNodeEvents` included). The pack's
|
|
86
|
+
plugin registers lifecycle tasks; the generated support file resolves the
|
|
87
|
+
session for the running test and rewrites `cy.request` traffic at the app
|
|
88
|
+
origin onto that session's proxy. Traffic that does not go through it — a
|
|
89
|
+
raw browser `fetch`, a third-party origin — stays unattributed and is
|
|
90
|
+
credited to nothing.
|
|
91
|
+
- **Read**: mocha's own `after:run` results, sealed into a per-run report.
|
|
92
|
+
More than one attempt for a test is a runner-assisted retry and blocks.
|
|
93
|
+
- **Use it**: nothing to import. Run your specs as usual with
|
|
94
|
+
`cy.request` for app traffic; `cy.request` at the app origin is tagged
|
|
95
|
+
automatically under the supervised run. A CommonJS project config
|
|
96
|
+
(`cypress.config.js`/`.cjs`) is chained; an ESM/TypeScript config is
|
|
97
|
+
refused rather than silently replaced.
|
|
98
|
+
|
|
99
|
+
## Running a non-Playwright runner
|
|
100
|
+
|
|
101
|
+
Set the runner in `.gateforge.yml` and the ordinary commands drive it:
|
|
102
|
+
|
|
103
|
+
```yaml
|
|
104
|
+
runner: vitest # playwright (the default) | pytest | vitest | cypress
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
- `gateforge init` — scans the repository and writes `runner:` into a NEW
|
|
108
|
+
config when it sees exactly one non-Playwright runner. An ambiguous
|
|
109
|
+
repository (Playwright plus something else, or several others) keeps the
|
|
110
|
+
default and tells you to set the key yourself. An existing config is never
|
|
111
|
+
rewritten.
|
|
112
|
+
- `gateforge enforcement doctor` — reports runner readiness without
|
|
113
|
+
launching anything: its `runner` check looks for the `vitest`/`cypress`
|
|
114
|
+
config file at the repository root and an installed package, for an
|
|
115
|
+
installed `playwright`, and for `pytest` a configured
|
|
116
|
+
`diagnostics.suites` entry plus a `pytest` executable on `PATH`. It is
|
|
117
|
+
diagnostic only: it exits 0 either way, and its `runner` line is the one
|
|
118
|
+
to read. (There is no `gateforge doctor` command — that name exits 2 with
|
|
119
|
+
`unknown command 'doctor'`.)
|
|
120
|
+
- `gateforge test-gates --changed` — runs the mapped selection under the
|
|
121
|
+
configured runner and seals the receipt.
|
|
122
|
+
- `gateforge check --changed --require-e2e` — the gate; `receipt-verified`
|
|
123
|
+
means the obligation was witnessed, not that the runner went green.
|
|
124
|
+
|
|
125
|
+
### Per-runner setup
|
|
126
|
+
|
|
127
|
+
**pytest** — one suite under `diagnostics.suites`, and HTTP over the plugin's
|
|
128
|
+
client:
|
|
129
|
+
|
|
130
|
+
```yaml
|
|
131
|
+
diagnostics:
|
|
132
|
+
suites:
|
|
133
|
+
- name: accounts
|
|
134
|
+
runner: pytest
|
|
135
|
+
cwd: .
|
|
136
|
+
argv: ['python', '-m', 'pytest']
|
|
137
|
+
testPaths: ['tests']
|
|
138
|
+
witnessed: true
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
`witnessed: true` keeps the suite out of the advisory diagnostic window: the
|
|
142
|
+
adapter's supervised execution IS that suite, so a second pass would run it
|
|
143
|
+
twice. The plugin (loaded automatically through `PYTHONPATH`) provides the
|
|
144
|
+
`gateforge_http` fixture — an `httpx.Client` routed through the running
|
|
145
|
+
test's session proxy:
|
|
146
|
+
|
|
147
|
+
```python
|
|
148
|
+
def test_creates_account(gateforge_http):
|
|
149
|
+
response = gateforge_http.post('/api/accounts', json={'first_name': 'Grace'})
|
|
150
|
+
assert response.status_code == 201
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
`TestClient(app)` never reaches the witness and is refused.
|
|
154
|
+
|
|
155
|
+
**vitest** — route supertest through the helper:
|
|
156
|
+
|
|
157
|
+
```js
|
|
158
|
+
import request from 'supertest';
|
|
159
|
+
import { gateforgeSupertest } from '@gate-forge/pack-playwright/vitest';
|
|
160
|
+
const gate = gateforgeSupertest(request);
|
|
161
|
+
|
|
162
|
+
test('creates an account', async () => {
|
|
163
|
+
const api = await gate(process.env.GATEFORGE_APP_BASE_URL);
|
|
164
|
+
expect((await api.post('/api/accounts').send({ first_name: 'Grace' })).status).toBe(201);
|
|
165
|
+
});
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
`request(app)` — in-process supertest — is refused with
|
|
169
|
+
`IN_PROCESS_CLIENT_REFUSED`.
|
|
170
|
+
|
|
171
|
+
**cypress** — nothing to import. Keep a CommonJS project config
|
|
172
|
+
(`cypress.config.js`/`.cjs`); an ESM/TypeScript config is refused rather than
|
|
173
|
+
silently replaced. Send app traffic with `cy.request` at the app origin and it
|
|
174
|
+
is tagged for the running test. A raw browser `fetch` is not credited, because
|
|
175
|
+
it never crosses the session proxy. The adapter pins the run's screenshot,
|
|
176
|
+
video and download folders into the run state directory, so a failing test
|
|
177
|
+
cannot drop artifacts into your tree.
|
|
178
|
+
|
|
179
|
+
### Mapping keys
|
|
180
|
+
|
|
181
|
+
In `.gateforge/test-map.yml` a non-Playwright test's `key` is
|
|
182
|
+
`<file>#<titlePath joined by '>'>` — the same identity the adapter reports:
|
|
183
|
+
|
|
184
|
+
```yaml
|
|
185
|
+
tests:
|
|
186
|
+
- key: tests/accounts.test.ts#accounts>creates an account
|
|
187
|
+
selector:
|
|
188
|
+
runner: vitest
|
|
189
|
+
file: tests/accounts.test.ts
|
|
190
|
+
titlePath: [accounts, creates an account]
|
|
191
|
+
kind: observed-e2e
|
|
192
|
+
claims: [tenant.accounts:persistence:create]
|
|
193
|
+
reason: The test creates an account over HTTP and the witness confirms persistence.
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
Selection granularity follows the runner: the FILE for vitest and Cypress
|
|
197
|
+
(one spec file executes, so a partial selection is a whole file), the pytest
|
|
198
|
+
NODE id for pytest. The verdict always comes from supervision over the
|
|
199
|
+
enumerated plan, never from the runner's exit code.
|