@testsprite/testsprite-cli 0.11.0 → 0.13.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 +52 -44
- package/dist/commands/agent.js +16 -13
- package/dist/commands/auth.d.ts +19 -0
- package/dist/commands/auth.js +60 -24
- package/dist/commands/ci.d.ts +86 -1
- package/dist/commands/ci.js +470 -9
- package/dist/commands/doctor.d.ts +2 -0
- package/dist/commands/doctor.js +22 -9
- package/dist/commands/init.js +14 -11
- package/dist/commands/project-env.d.ts +90 -0
- package/dist/commands/project-env.js +486 -0
- package/dist/commands/project.d.ts +15 -5
- package/dist/commands/project.js +88 -92
- package/dist/commands/schedule.d.ts +2 -0
- package/dist/commands/schedule.js +18 -10
- package/dist/commands/test.d.ts +102 -30
- package/dist/commands/test.js +1949 -419
- package/dist/commands/testlist.js +77 -21
- package/dist/commands/tunnel.d.ts +26 -3
- package/dist/commands/tunnel.js +211 -14
- package/dist/commands/usage.d.ts +3 -0
- package/dist/commands/usage.js +12 -5
- package/dist/index.js +47 -23
- package/dist/lib/agent-targets.d.ts +3 -3
- package/dist/lib/agent-targets.js +2 -2
- package/dist/lib/billing-refusal.d.ts +43 -0
- package/dist/lib/billing-refusal.js +171 -0
- package/dist/lib/bundle.d.ts +5 -0
- package/dist/lib/bundle.js +43 -13
- package/dist/lib/ci-linkage.d.ts +90 -0
- package/dist/lib/ci-linkage.js +181 -0
- package/dist/lib/client-factory.d.ts +4 -1
- package/dist/lib/client-factory.js +25 -2
- package/dist/lib/client-tag.d.ts +13 -0
- package/dist/lib/client-tag.js +44 -0
- package/dist/lib/config.d.ts +17 -0
- package/dist/lib/config.js +20 -1
- package/dist/lib/conflict-reason.d.ts +67 -2
- package/dist/lib/conflict-reason.js +148 -13
- package/dist/lib/credentials.js +56 -14
- package/dist/lib/cron.js +8 -1
- package/dist/lib/dry-run/samples.d.ts +13 -1
- package/dist/lib/dry-run/samples.js +51 -7
- package/dist/lib/errors.d.ts +62 -12
- package/dist/lib/errors.js +180 -25
- package/dist/lib/failing-fe-resolver.d.ts +1 -1
- package/dist/lib/failing-fe-resolver.js +3 -3
- package/dist/lib/gh-output.d.ts +26 -11
- package/dist/lib/gh-output.js +47 -15
- package/dist/lib/history-retention.d.ts +8 -0
- package/dist/lib/history-retention.js +24 -0
- package/dist/lib/http.d.ts +44 -19
- package/dist/lib/http.js +53 -26
- package/dist/lib/interrupt.d.ts +21 -13
- package/dist/lib/interrupt.js +32 -21
- package/dist/lib/junit-report.d.ts +11 -1
- package/dist/lib/junit-report.js +15 -3
- package/dist/lib/local-target.d.ts +33 -1
- package/dist/lib/local-target.js +78 -1
- package/dist/lib/output.d.ts +27 -1
- package/dist/lib/output.js +22 -3
- package/dist/lib/plan-poll.d.ts +11 -11
- package/dist/lib/plan-poll.js +12 -12
- package/dist/lib/plans.types.d.ts +9 -9
- package/dist/lib/plans.types.js +3 -3
- package/dist/lib/poll.d.ts +2 -2
- package/dist/lib/poll.js +9 -3
- package/dist/lib/render-error.d.ts +2 -0
- package/dist/lib/render-error.js +13 -0
- package/dist/lib/response-schemas.d.ts +54 -12
- package/dist/lib/response-schemas.js +106 -7
- package/dist/lib/runs.types.d.ts +92 -6
- package/dist/lib/secret-file.js +72 -14
- package/dist/lib/skill-nudge.d.ts +6 -1
- package/dist/lib/skill-nudge.js +32 -5
- package/dist/lib/target-url-preflight.d.ts +6 -4
- package/dist/lib/target-url-preflight.js +64 -51
- package/dist/lib/target-url.js +31 -12
- package/dist/lib/telemetry.d.ts +172 -3
- package/dist/lib/telemetry.js +276 -15
- package/dist/lib/ticker.js +93 -4
- package/dist/lib/tunnel-session.d.ts +13 -0
- package/dist/lib/tunnel-session.js +4 -1
- package/dist/lib/tunnel.types.d.ts +12 -2
- package/dist/lib/tunnel.types.js +2 -2
- package/dist/lib/version-notice.d.ts +20 -1
- package/dist/lib/version-notice.js +59 -12
- package/dist/lib/wait-exit.d.ts +8 -0
- package/dist/lib/wait-exit.js +76 -4
- package/dist/lib/workspace-status.d.ts +23 -0
- package/dist/lib/workspace-status.js +15 -0
- package/dist/version-guard.d.ts +7 -1
- package/dist/version-guard.js +19 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +4 -4
- package/skills/testsprite-onboard.skill.md +4 -4
- package/skills/testsprite-verify.codex.md +59 -57
- package/skills/testsprite-verify.skill.md +53 -36
|
@@ -19,17 +19,19 @@ duplicating.
|
|
|
19
19
|
The CLI tests either a **deployed** URL or a frontend test running on this
|
|
20
20
|
machine — it doesn't build or host your environment either way. For a deployed
|
|
21
21
|
change, wait until it's live somewhere reachable (e.g. open the PR, let CI
|
|
22
|
-
deploy the preview/staging environment)
|
|
23
|
-
|
|
22
|
+
deploy the preview/staging environment). Create a named environment for its
|
|
23
|
+
public URL once, then select it with `--env <name>` on runs. Running earlier
|
|
24
|
+
verifies the previous build, not your change.
|
|
24
25
|
|
|
25
26
|
For a change that is only running locally, don't wait for a deployment: run
|
|
26
27
|
`testsprite test run <test-id> --local <port>` instead. It tunnels this
|
|
27
28
|
machine's own loopback address (`localhost` / `127.0.0.1` / `::1` — not a LAN
|
|
28
29
|
or RFC1918 address, and not a general local-network escape hatch) to the test
|
|
29
|
-
runner.
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
runner. It is for frontend tests only (a backend test's target is baked into
|
|
31
|
+
its generated code, so run it normally). Existing API keys work for local runs; no replacement key is
|
|
32
|
+
needed. `--local <port>` selects or creates the
|
|
33
|
+
project's `local-<port>` environment. With `--env <name> --local <port>`, that
|
|
34
|
+
named environment must also be local (`project env list <projectId>` shows names).
|
|
33
35
|
|
|
34
36
|
If the user explicitly named a tool (the CLI or the MCP), honor that choice
|
|
35
37
|
regardless of which one the change's reachability would otherwise suggest.
|
|
@@ -100,7 +102,7 @@ If no project exists for an app running only locally, bootstrap a frontend proje
|
|
|
100
102
|
```bash
|
|
101
103
|
testsprite project create --type frontend --name "<repo name>" --local <port> --local-host <host>
|
|
102
104
|
testsprite test create --plan-from plan.json --project <projectId>
|
|
103
|
-
testsprite test run <
|
|
105
|
+
testsprite test run <id> <id> --local <port> --local-host <host> --output json
|
|
104
106
|
```
|
|
105
107
|
|
|
106
108
|
Keep the app listening and use the same `--local-host` for creation and follow-up
|
|
@@ -110,8 +112,8 @@ The port probe fails with exit 5 if nothing listens (`--skip-preflight`
|
|
|
110
112
|
bypasses it). Local projects skip exploration: `test plan generate` is refused
|
|
111
113
|
before charge (exit 6), so use `test create --plan-from` without `--run`, then
|
|
112
114
|
`test run --local`. V2-only local-project creation is unsupported (exit 7).
|
|
113
|
-
Portal
|
|
114
|
-
|
|
115
|
+
The Portal shows local environments without a Run action. Create a public
|
|
116
|
+
environment for deployed apps and select it with `--env <name>`.
|
|
115
117
|
|
|
116
118
|
## 3. Decide what to test
|
|
117
119
|
|
|
@@ -366,73 +368,83 @@ Batch is **FE-only.** For 3 backend tests, run `test create --type backend
|
|
|
366
368
|
|
|
367
369
|
## 4. Run
|
|
368
370
|
|
|
369
|
-
For a deployed target,
|
|
370
|
-
that deployment contains the change.
|
|
371
|
+
For a deployed target, create its environment once, then use `--env <name>`
|
|
372
|
+
after that deployment contains the change. Omit `--env` for Default; an unknown
|
|
373
|
+
name fails with available names and never falls back. For a local change,
|
|
371
374
|
use `testsprite test run <test-id> --local <port>` (frontend only); it implies
|
|
372
375
|
waiting and defaults to 1200 seconds. Create a missing test from a plan first,
|
|
373
376
|
without `--run`, then run its id with `--local`.
|
|
374
377
|
|
|
375
378
|
```bash
|
|
379
|
+
# One-time setup for a deployed target
|
|
380
|
+
testsprite project env create <projectId> --name staging --url https://staging.example.com
|
|
381
|
+
|
|
376
382
|
# (a) existing test
|
|
377
|
-
testsprite test run <test-id> --
|
|
383
|
+
testsprite test run <test-id> --env staging --wait --timeout 600 --output json
|
|
378
384
|
|
|
379
385
|
# (a-rerun) replay of a deployed test (V3 FE: 0.5 credit). Replays saved code (auto-heal on — more
|
|
380
386
|
# lenient than a fresh run; for strict verification of a new change prefer `test run`).
|
|
381
387
|
# BE: dispatches the WHOLE dependency closure — producers and teardowns run too, not just <test-id>,
|
|
382
388
|
# so expect their side effects (fixtures re-created, teardown deletes) and extra runs in history.
|
|
383
|
-
testsprite test rerun <test-id> --wait --timeout 600 --output json
|
|
389
|
+
testsprite test rerun <test-id> --env staging --wait --timeout 600 --output json
|
|
384
390
|
testsprite test rerun <test-id> --skip-dependencies --wait --timeout 600 # BE: named test only
|
|
385
391
|
|
|
386
392
|
# (b-FE) new FE test from plan
|
|
387
|
-
testsprite test create --plan-from plan.json --run --wait --
|
|
393
|
+
testsprite test create --plan-from plan.json --run --wait --env staging --timeout 600
|
|
388
394
|
|
|
389
395
|
# (b-BE) new BE test from Python (backend create needs --project)
|
|
390
|
-
testsprite test create --type backend --name "..." --project <projectId> --code-file foo.py --run --wait --
|
|
396
|
+
testsprite test create --type backend --name "..." --project <projectId> --code-file foo.py --run --wait --timeout 600
|
|
391
397
|
|
|
392
398
|
# (b-BE coverage set with dependencies) create each test without --run, then one wave-ordered batch
|
|
393
|
-
testsprite test run --all --project <projectId> --wait --timeout 600 --output json
|
|
399
|
+
testsprite test run --all --project <projectId> --env staging --wait --timeout 600 --output json
|
|
394
400
|
testsprite test run --all --project <projectId> --filter <name-substr> --wait --timeout 600 # subset by name
|
|
395
401
|
|
|
396
402
|
# (c) FE coverage set — single-call create + run (FE-only)
|
|
397
403
|
testsprite test create-batch --plans plans.jsonl --run --wait \
|
|
398
|
-
--
|
|
404
|
+
--env staging --max-concurrency 3 --timeout 600 --output json
|
|
399
405
|
# Two-step alternative (inspect before running):
|
|
400
406
|
# testsprite test create-batch --plans plans.jsonl --output json
|
|
401
|
-
# then trigger each id: testsprite test run <test-id> --
|
|
407
|
+
# then trigger each id: testsprite test run <test-id> --env staging --wait --timeout 600
|
|
402
408
|
|
|
403
409
|
# (d-FE) refine + re-run
|
|
404
410
|
testsprite test plan put <test-id> --steps refined.json && \
|
|
405
|
-
testsprite test run <test-id> --
|
|
411
|
+
testsprite test run <test-id> --env staging --wait --timeout 600
|
|
406
412
|
|
|
407
413
|
# (d-BE) refine BE code + re-run. NOTE: if you reach for `test rerun` here instead, a BE rerun
|
|
408
414
|
# dispatches the full producer/teardown closure — use --skip-dependencies while iterating on one
|
|
409
415
|
# script (producers already verified this round), then finish with a closure run before reporting.
|
|
410
416
|
testsprite test code put <test-id> --code-file refined.py --expected-version <current-version> && \
|
|
411
|
-
testsprite test run <test-id> --
|
|
417
|
+
testsprite test run <test-id> --env staging --wait --timeout 600
|
|
412
418
|
```
|
|
413
419
|
|
|
414
420
|
Key behaviors:
|
|
415
421
|
|
|
416
|
-
- `--
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
422
|
+
- Environment `--url` must be public; the CLI rejects localhost, RFC1918 and
|
|
423
|
+
link-local addresses. For an app on this machine, use `--local <port>`
|
|
424
|
+
(frontend only). If the CLI can list the project's environments, a named
|
|
425
|
+
public environment plus `--local` fails before a tunnel opens; otherwise the
|
|
426
|
+
server refuses the same combination before dispatch. A local environment
|
|
427
|
+
without `--local` is refused before dispatch and costs nothing.
|
|
420
428
|
- `--wait` long-polls until terminal and handles its own backoff — don't wrap it
|
|
421
429
|
in a retry loop.
|
|
422
|
-
- `--local` implies `--wait`, with a default timeout of 1200 seconds (ordinary
|
|
423
|
-
waits default to 600). Run
|
|
424
|
-
invocations are fine, but `--all --local` is refused (exit 5). There are
|
|
430
|
+
- `--local` implies `--wait`, with a default timeout of 1200 seconds per run (ordinary
|
|
431
|
+
waits default to 600). Run several local frontend tests in ONE command (`test run <id> <id> … --local <port>`) instead of starting one process per test. `--all --project <id> --local <port>` runs frontend tests and reports backend tests as skipped. One tunnel serves the invocation; `--max-concurrency` defaults to 5 and caps at 10. There are
|
|
425
432
|
5 live tunnel bindings per user; `tunnel_binding_limit` is exit 11 and is not
|
|
426
433
|
auto-retried. Reuse a live tunnel with `--tunnel-client` or stop an unused one.
|
|
427
|
-
-
|
|
428
|
-
|
|
434
|
+
On a tunnel-limit error, run `testsprite tunnel list`, then `testsprite tunnel stop <id>`
|
|
435
|
+
or `testsprite tunnel stop --all --confirm` if every binding should be revoked.
|
|
436
|
+
- Keep the early **stderr** run-id receipts (`Run <runId>` for one test, `[i/N] <testId> → run <runId>` for a batch); `Dashboard: <url>` follows when supplied. Preserve each id even if
|
|
429
437
|
the wait later stops; stdout remains the normal JSON result channel.
|
|
430
|
-
- An **owned** local run
|
|
438
|
+
- An **owned** local run requests cancellation by default when waiting stops (timeout,
|
|
431
439
|
Ctrl-C, or a polling failure), then its tunnel closes. Read the reported
|
|
432
|
-
cancellation outcome.
|
|
440
|
+
cancellation outcome. For a V3 frontend run cancelled before a terminal verdict,
|
|
441
|
+
the backend attempts a refund. Inspect `refund.status`; cancellation does not
|
|
442
|
+
guarantee a refund.
|
|
433
443
|
`--no-cancel-on-interrupt` detaches instead, but the owned tunnel still closes.
|
|
434
|
-
|
|
435
|
-
|
|
444
|
+
An adopted run normally detaches without cancellation and never closes the
|
|
445
|
+
owner's tunnel. If the CLI confirms the owner has disappeared while the run is
|
|
446
|
+
active, it requests cancellation by default; `--no-cancel-on-interrupt` skips
|
|
447
|
+
that request.
|
|
436
448
|
A second `tunnel start` or process using the same credential takes over, and the first exits **10**.
|
|
437
449
|
- Exit codes: `0` = passed; `1` = failed / blocked / cancelled; `7` = timeout
|
|
438
450
|
or unsupported. An owned local timeout is inconclusive: start a **new**
|
|
@@ -440,9 +452,14 @@ Key behaviors:
|
|
|
440
452
|
`--local-host <host>` if used; do not suggest `test wait` for that closed tunnel. Resume **ordinary or adopted-tunnel**
|
|
441
453
|
waits with `testsprite test wait <run-id>` only while the target is reachable
|
|
442
454
|
(and the adopted tunnel's owner remains alive).
|
|
443
|
-
-
|
|
444
|
-
|
|
445
|
-
|
|
455
|
+
- Exit `13` (`FEATURE_GATED`) and exit `12` (`INSUFFICIENT_CREDITS`) are not retriable: show the user the server's message and the link from `nextAction` or JSON `links`, then stop.
|
|
456
|
+
- A local environment has a loopback URL and needs `--local <port>` from that
|
|
457
|
+
machine. A bare CLI run selecting it, explicitly or as Default, is refused
|
|
458
|
+
before dispatch without charge (`tunnel-required`, exit 6). The Portal shows
|
|
459
|
+
local environments but offers no Run; backend Portal requests are refused
|
|
460
|
+
without charge. Schedules and test lists targeting them get a free BLOCKED
|
|
461
|
+
result. A deployed environment selected with `--env <name>` or made Default
|
|
462
|
+
runs normally even if the test ran through a tunnel before. V3 local runs use
|
|
446
463
|
the agent path, never saved-code replay, and preserve the test's saved code.
|
|
447
464
|
- Batch: `create-batch --run --wait` creates the tests (FE-only) and fans
|
|
448
465
|
out triggers in one call (bounded by `--max-concurrency`), emitting
|