@testsprite/testsprite-cli 0.7.0 → 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 +62 -45
- package/dist/commands/agent.d.ts +3 -0
- package/dist/commands/agent.js +79 -10
- package/dist/commands/ci.d.ts +88 -0
- package/dist/commands/ci.js +432 -0
- package/dist/commands/doctor.js +100 -1
- package/dist/commands/init.d.ts +45 -2
- package/dist/commands/init.js +198 -29
- package/dist/commands/project.d.ts +78 -0
- package/dist/commands/project.js +439 -5
- package/dist/commands/test.d.ts +193 -4
- package/dist/commands/test.js +1948 -398
- package/dist/commands/testlist.js +15 -9
- package/dist/commands/tunnel.d.ts +72 -0
- package/dist/commands/tunnel.js +367 -0
- package/dist/index.js +107 -38
- package/dist/lib/agent-detect.d.ts +53 -0
- package/dist/lib/agent-detect.js +198 -0
- package/dist/lib/dry-run/samples.d.ts +9 -0
- package/dist/lib/dry-run/samples.js +116 -0
- package/dist/lib/gh-output.d.ts +7 -0
- package/dist/lib/gh-output.js +50 -7
- package/dist/lib/http.d.ts +104 -0
- package/dist/lib/http.js +126 -7
- package/dist/lib/interrupt.d.ts +38 -13
- package/dist/lib/interrupt.js +130 -15
- package/dist/lib/local-target.d.ts +95 -0
- package/dist/lib/local-target.js +184 -0
- package/dist/lib/plan-poll.d.ts +171 -0
- package/dist/lib/plan-poll.js +442 -0
- package/dist/lib/plans.types.d.ts +130 -0
- package/dist/lib/plans.types.js +31 -0
- package/dist/lib/poll-support.d.ts +26 -0
- package/dist/lib/poll-support.js +65 -0
- package/dist/lib/poll.d.ts +1 -0
- package/dist/lib/poll.js +2 -40
- package/dist/lib/response-schemas.d.ts +13 -0
- package/dist/lib/response-schemas.js +46 -0
- package/dist/lib/run-progress.d.ts +41 -0
- package/dist/lib/run-progress.js +56 -0
- package/dist/lib/runs.types.d.ts +50 -0
- package/dist/lib/skill-nudge.d.ts +13 -5
- package/dist/lib/skill-nudge.js +40 -14
- package/dist/lib/target-url-preflight.js +3 -3
- package/dist/lib/target-url.d.ts +54 -8
- package/dist/lib/target-url.js +274 -68
- package/dist/lib/telemetry.d.ts +11 -0
- package/dist/lib/telemetry.js +1 -0
- package/dist/lib/ticker.d.ts +8 -0
- package/dist/lib/ticker.js +3 -0
- package/dist/lib/tunnel-session.d.ts +138 -0
- package/dist/lib/tunnel-session.js +249 -0
- package/dist/lib/tunnel.types.d.ts +54 -0
- package/dist/lib/tunnel.types.js +8 -0
- package/dist/vendor/tunnel-client/client.d.ts +82 -0
- package/dist/vendor/tunnel-client/client.js +924 -0
- package/dist/vendor/tunnel-client/config.d.ts +49 -0
- package/dist/vendor/tunnel-client/config.js +50 -0
- package/dist/vendor/tunnel-client/index.d.ts +9 -0
- package/dist/vendor/tunnel-client/index.js +9 -0
- package/dist/vendor/tunnel-client/lodash-lite.d.ts +14 -0
- package/dist/vendor/tunnel-client/lodash-lite.js +24 -0
- package/dist/vendor/tunnel-client/protocol.d.ts +60 -0
- package/dist/vendor/tunnel-client/protocol.js +143 -0
- package/dist/vendor/tunnel-client/types.d.ts +101 -0
- package/dist/vendor/tunnel-client/types.js +10 -0
- package/dist/vendor/tunnel-client/ws-compat.d.ts +206 -0
- package/dist/vendor/tunnel-client/ws-compat.js +316 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +2 -1
- package/skills/testsprite-onboard.skill.md +60 -4
- package/skills/testsprite-verify.codex.md +22 -16
- package/skills/testsprite-verify.skill.md +27 -18
|
@@ -10,11 +10,11 @@ docs/config and is about to be reported complete.
|
|
|
10
10
|
Run after a feature or fix lands. Skip only for: docs-only edits, pure
|
|
11
11
|
build/config changes, or when the repo has no TestSprite project linked.
|
|
12
12
|
|
|
13
|
-
The CLI
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
(the CLI or the MCP), honor that
|
|
13
|
+
The CLI tests a deployed URL via `--target-url`, or a frontend test on this
|
|
14
|
+
machine via `--local <port>` (tunnels `localhost`/`127.0.0.1`/`::1` only; needs
|
|
15
|
+
a key with the `run:tunnel` scope — 403 there means mint a new key; a backend
|
|
16
|
+
test's target is baked into its code, so it can't use `--local`). If the user
|
|
17
|
+
named a tool (the CLI or the MCP), honor that even when both could apply.
|
|
18
18
|
|
|
19
19
|
## Core loop
|
|
20
20
|
|
|
@@ -67,23 +67,25 @@ testsprite test run --all --project <id> [--filter <substr>] \
|
|
|
67
67
|
**Key behaviors:**
|
|
68
68
|
|
|
69
69
|
- `--target-url` must be publicly reachable (no localhost / RFC1918) and must
|
|
70
|
-
already have the change deployed (e.g. a CI preview deploy) —
|
|
71
|
-
|
|
72
|
-
|
|
70
|
+
already have the change deployed (e.g. a CI preview deploy) — running earlier
|
|
71
|
+
verifies the previous build, not your change. For a local-only change use
|
|
72
|
+
`--local <port>` instead (frontend tests only).
|
|
73
73
|
- Backend `--code-file`: the runner executes the file top-to-bottom (not `pytest`), so **call your `test_*` function(s) at the end of the file** — a defined-but-uncalled test silently passes.
|
|
74
74
|
- Backend sandbox has only stdlib + `requests` + `pytest` + `numpy` + `scipy`. Test the API over HTTP with `requests`; do **not** `import` the project's own source modules or other packages (e.g. `torch`) — they aren't installed and the test won't run.
|
|
75
|
-
- `--wait` long-polls until terminal
|
|
75
|
+
- `--wait` long-polls until terminal; don't wrap it in a retry loop. A
|
|
76
|
+
`--local` timeout has nothing to resume — re-run with `--local`.
|
|
76
77
|
- Exit `0` = passed; `1` = failed/blocked; `7` = timeout (resume with `test wait <run-id>`).
|
|
77
|
-
- BE dependency flags (`--produces`/`--needs`/`--category`) are backend-only
|
|
78
|
-
**
|
|
79
|
-
change the graph
|
|
80
|
-
`test run --all` so the engine passes captured variables
|
|
78
|
+
- BE dependency flags (`--produces`/`--needs`/`--category`) are backend-only,
|
|
79
|
+
repeatable, and **editable** — `test update` amends them, so never delete and
|
|
80
|
+
recreate a test to change the graph. Don't hand-sequence `test run` calls to
|
|
81
|
+
fake ordering; use `test run --all` so the engine passes captured variables
|
|
82
|
+
between waves.
|
|
81
83
|
- A BE `test rerun` dispatches the whole producer/teardown closure, side effects
|
|
82
84
|
included; `--skip-dependencies` reruns only the named test. If a producer failed
|
|
83
85
|
in the same closure, the consumer's failure is starvation (missing token/fixture)
|
|
84
86
|
— triage the producer first; it does not implicate your change.
|
|
85
|
-
- `create` and `--wait` output
|
|
86
|
-
inspect a test or run
|
|
87
|
+
- `create` and `--wait` output a `dashboardUrl` — point the user there to
|
|
88
|
+
inspect a test or run.
|
|
87
89
|
|
|
88
90
|
### 4. On failure — download the artifact
|
|
89
91
|
|
|
@@ -94,7 +96,7 @@ testsprite test artifact get <run-id> --out ./.testsprite/runs/<run-id>/
|
|
|
94
96
|
Inspect the bundle (failing step, screenshots, root-cause hypothesis) before
|
|
95
97
|
deciding whether your change caused the failure.
|
|
96
98
|
|
|
97
|
-
### 5.
|
|
99
|
+
### 5. Dry-run for learning
|
|
98
100
|
|
|
99
101
|
Every command works without credentials under `--dry-run`:
|
|
100
102
|
|
|
@@ -125,3 +127,7 @@ testsprite setup # configure + verify + install agent skill in one shot
|
|
|
125
127
|
```
|
|
126
128
|
|
|
127
129
|
Verify your setup anytime: `testsprite auth status`.
|
|
130
|
+
|
|
131
|
+
Project with **no tests at all**? Seed a suite first — that's setup, not verification.
|
|
132
|
+
`testsprite test plan generate --project <id>` proposes cases and `test plan accept`
|
|
133
|
+
promotes them; or author plans by hand.
|
|
@@ -16,21 +16,22 @@ project's TestSprite suite; before writing a new one, check `testsprite test lis
|
|
|
16
16
|
for an existing test that already covers the behavior and extend it instead of
|
|
17
17
|
duplicating.
|
|
18
18
|
|
|
19
|
-
The CLI tests a **deployed** URL
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
change is only running locally
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
19
|
+
The CLI tests either a **deployed** URL or a frontend test running on this
|
|
20
|
+
machine — it doesn't build or host your environment either way. For a deployed
|
|
21
|
+
change, wait until it's live somewhere reachable (e.g. open the PR, let CI
|
|
22
|
+
deploy the preview/staging environment) and pass that URL as `--target-url`.
|
|
23
|
+
Running earlier verifies the previous build, not your change.
|
|
24
|
+
|
|
25
|
+
For a change that is only running locally, don't wait for a deployment: run
|
|
26
|
+
`testsprite test run <test-id> --local <port>` instead. It tunnels this
|
|
27
|
+
machine's own loopback address (`localhost` / `127.0.0.1` / `::1` — not a LAN
|
|
28
|
+
or RFC1918 address, and not a general local-network escape hatch) to the test
|
|
29
|
+
runner. Two constraints: frontend tests only (a backend test's target is baked
|
|
30
|
+
into its generated code, so run it normally), and it needs an API key with the
|
|
31
|
+
`run:tunnel` scope — a 403 there means mint a new key.
|
|
32
|
+
|
|
33
|
+
If the user explicitly named a tool (the CLI or the MCP), honor that choice
|
|
34
|
+
regardless of which one the change's reachability would otherwise suggest.
|
|
34
35
|
|
|
35
36
|
## When to skip
|
|
36
37
|
|
|
@@ -59,6 +60,11 @@ counts:
|
|
|
59
60
|
What does **not** count: unit tests / typecheck / lint; drafting a plan without
|
|
60
61
|
`--run`; asking the user to run it for you.
|
|
61
62
|
|
|
63
|
+
If the project has **no tests at all**, that's the `testsprite-onboard` skill's
|
|
64
|
+
job, not this one — seed a suite first (it can generate the proposals for you
|
|
65
|
+
with `testsprite test plan generate` / `test plan accept`, or author them by
|
|
66
|
+
hand). Seeding is a deliberate setup pass, not part of the verify loop.
|
|
67
|
+
|
|
62
68
|
If you can't satisfy this — no creds, no valid target URL, repo not linked —
|
|
63
69
|
**say so explicitly**: "Feature shipped but I could not run any TestSprite test
|
|
64
70
|
because <X>. Treat this as unverified until that's resolved." Don't claim done.
|
|
@@ -380,13 +386,16 @@ testsprite test run <test-id> --target-url <env-url> --wait --timeout 600
|
|
|
380
386
|
Key behaviors:
|
|
381
387
|
|
|
382
388
|
- `--target-url` must be an allowed project/environment URL. The CLI rejects
|
|
383
|
-
`localhost` / RFC1918 / link-local
|
|
384
|
-
|
|
389
|
+
`localhost` / RFC1918 / link-local there. If the feature is only running
|
|
390
|
+
locally, use `--local <port>` instead of `--target-url` (frontend tests
|
|
391
|
+
only, see "When to run" above) — don't skip the run over this.
|
|
385
392
|
- `--wait` long-polls until terminal and handles its own backoff — don't wrap it
|
|
386
393
|
in a retry loop.
|
|
387
394
|
- Exit codes: `0` = passed; `1` = failed / blocked / cancelled; `7` = timeout.
|
|
388
395
|
Treat `7` as inconclusive (resume with `testsprite test wait <run-id>`), not a
|
|
389
|
-
regression
|
|
396
|
+
regression — except a `--local` run: its exit 7 already cancelled the run
|
|
397
|
+
(the tunnel closes with the process, so there is nothing to resume), so
|
|
398
|
+
don't suggest `test wait` there; re-run with `--local` again instead.
|
|
390
399
|
- Batch: `create-batch --run --wait` creates the tests (FE-only) and fans
|
|
391
400
|
out triggers in one call (bounded by `--max-concurrency`), emitting
|
|
392
401
|
`{ results: [...] }` that mirrors the single-test `test run --wait`
|