@testsprite/testsprite-cli 0.15.0 → 0.16.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 +24 -16
- package/dist/commands/agent.js +7 -2
- package/dist/commands/auth.js +7 -3
- package/dist/commands/ci.js +20 -18
- package/dist/commands/completion.js +2 -1
- package/dist/commands/doctor.js +2 -1
- package/dist/commands/init.js +8 -2
- package/dist/commands/project-env.js +39 -17
- package/dist/commands/project-sign-in.js +9 -4
- package/dist/commands/project.js +28 -21
- package/dist/commands/schedule.js +24 -15
- package/dist/commands/test.d.ts +32 -26
- package/dist/commands/test.js +949 -769
- package/dist/commands/testlist.js +13 -3
- package/dist/commands/tunnel.js +23 -25
- package/dist/commands/usage.js +1 -0
- package/dist/index.js +9 -6
- package/dist/lib/conflict-reason.d.ts +24 -3
- package/dist/lib/conflict-reason.js +33 -2
- package/dist/lib/deprecate.d.ts +22 -0
- package/dist/lib/deprecate.js +26 -0
- package/dist/lib/dry-run/samples.js +14 -4
- package/dist/lib/environment-tunnel.d.ts +2 -1
- package/dist/lib/environment-tunnel.js +1 -4
- package/dist/lib/http.js +20 -2
- package/dist/lib/junit-report.d.ts +3 -0
- package/dist/lib/junit-report.js +8 -1
- package/dist/lib/output.d.ts +11 -1
- package/dist/lib/output.js +17 -2
- package/dist/lib/response-schemas.js +3 -0
- package/dist/lib/runs.types.d.ts +16 -0
- package/dist/lib/telemetry.d.ts +1 -1
- package/dist/lib/telemetry.js +2 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +3 -3
- package/skills/testsprite-verify.codex.md +7 -7
- package/skills/testsprite-verify.skill.md +24 -21
package/dist/lib/runs.types.d.ts
CHANGED
|
@@ -45,6 +45,12 @@ export interface TriggerRunBody {
|
|
|
45
45
|
* this picks WHOSE credentials it logs in with.
|
|
46
46
|
*/
|
|
47
47
|
environment?: string;
|
|
48
|
+
/**
|
|
49
|
+
* BE only: run just the named test without expanding the producer/teardown
|
|
50
|
+
* closure. Sent only when the caller asked for it (never `false`); an older
|
|
51
|
+
* backend strips the field, so omitting it is the default on the wire.
|
|
52
|
+
*/
|
|
53
|
+
skipDependencies?: boolean;
|
|
48
54
|
}
|
|
49
55
|
/** The environment a run resolved to — its credentials, its config, its address. */
|
|
50
56
|
export interface RunEnvironmentRef {
|
|
@@ -242,6 +248,12 @@ export interface TriggerRunResponse {
|
|
|
242
248
|
* run has no execution page). Same present-or-absent contract.
|
|
243
249
|
*/
|
|
244
250
|
executionUrl?: string;
|
|
251
|
+
/**
|
|
252
|
+
* `true` exactly when the request carried `skipDependencies: true` and this
|
|
253
|
+
* backend handled it; otherwise OMITTED. A CLI that sent the flag and gets no
|
|
254
|
+
* echo was served by a backend that stripped it and ran the full closure.
|
|
255
|
+
*/
|
|
256
|
+
skipDependencies?: boolean;
|
|
245
257
|
}
|
|
246
258
|
/**
|
|
247
259
|
* Public run-status values.
|
|
@@ -512,6 +524,8 @@ export interface BatchRunFreshRequest {
|
|
|
512
524
|
autoHeal?: false;
|
|
513
525
|
/** See `TriggerRunBody.environment` — applied to every test in the batch. */
|
|
514
526
|
environment?: string;
|
|
527
|
+
/** See `TriggerRunBody.skipDependencies` — applies to every BE test in the batch. */
|
|
528
|
+
skipDependencies?: boolean;
|
|
515
529
|
/** Per-run URL override for the batch; echoed when the backend honors it. */
|
|
516
530
|
targetUrl?: string;
|
|
517
531
|
/**
|
|
@@ -607,6 +621,8 @@ export interface BatchRunFreshResponse {
|
|
|
607
621
|
/** Echoes, same contract as `targetUrl`: absent means this backend never read the field. */
|
|
608
622
|
admission?: 'budget' | 'all';
|
|
609
623
|
previewName?: string;
|
|
624
|
+
/** See `TriggerRunResponse.skipDependencies`; same present-or-omitted contract. */
|
|
625
|
+
skipDependencies?: boolean;
|
|
610
626
|
}
|
|
611
627
|
/** One row of an execution report — one `test_result` of that execution. */
|
|
612
628
|
export interface ExecutionReportTest {
|
package/dist/lib/telemetry.d.ts
CHANGED
|
@@ -100,7 +100,7 @@ export declare function buildCiContext(env: NodeJS.ProcessEnv): {
|
|
|
100
100
|
* `conflict-reason.ts`'s rendering type: `tunnel-required` is a server reason
|
|
101
101
|
* this CLI has no label for yet, and `not_found` is rendered but not counted.
|
|
102
102
|
*/
|
|
103
|
-
export type TelemetryConflictReason = 'in_flight' | 'insufficient_credits' | 'paused' | 'billing_hold' | 'mcp_view_only' | 'local_address' | 'tunnel-required' | 'error';
|
|
103
|
+
export type TelemetryConflictReason = 'in_flight' | 'insufficient_credits' | 'paused' | 'billing_hold' | 'mcp_view_only' | 'local_address' | 'tunnel-required' | 'no_producer' | 'producer_in_flight' | 'error';
|
|
104
104
|
/**
|
|
105
105
|
* Low-cardinality facts a command records about its own outcome before it
|
|
106
106
|
* returns, merged into the one event `index.ts` fires. Counts are non-negative
|
package/dist/lib/telemetry.js
CHANGED
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "0.
|
|
1
|
+
export declare const VERSION = "0.16.0";
|
package/dist/version.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@testsprite/testsprite-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.16.0",
|
|
4
4
|
"description": "Official TestSprite command-line interface",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"dependencies": {
|
|
62
62
|
"@llmcode/yamux-ts": "0.0.2",
|
|
63
63
|
"commander": "^12.1.0",
|
|
64
|
-
"undici": "^7.
|
|
64
|
+
"undici": "^7.30.1",
|
|
65
65
|
"valibot": "^1.4.1"
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
"ajv": "^8.20.0",
|
|
72
72
|
"eslint": "^10.7.0",
|
|
73
73
|
"eslint-config-prettier": "^9.1.0",
|
|
74
|
-
"eslint-plugin-security": "4.0
|
|
74
|
+
"eslint-plugin-security": "4.2.0",
|
|
75
75
|
"globals": "^17.7.0",
|
|
76
76
|
"msw": "^2.14.3",
|
|
77
77
|
"prettier": "^3.3.3",
|
|
@@ -45,17 +45,17 @@ testsprite test run <test-id> --env staging \
|
|
|
45
45
|
# Backend Python assertion
|
|
46
46
|
testsprite test create --type backend --name "Login rejects empty password" \
|
|
47
47
|
--project <id> --code-file /tmp/test.py --run --wait --timeout 600
|
|
48
|
-
#
|
|
49
|
-
testsprite test
|
|
50
|
-
# Dependency batch;
|
|
48
|
+
# Several tests, one batch (V3 FE: 0.5 credit each)
|
|
49
|
+
testsprite test run <test-id> <test-id> --env staging --wait --output json
|
|
50
|
+
# Dependency batch; --filter <substr>, --status failed,blocked
|
|
51
51
|
testsprite test run --all --project <id> --env staging --wait --output json
|
|
52
52
|
```
|
|
53
53
|
|
|
54
54
|
- Supported backends grant existing keys `run:tunnel`; a narrowed key without it
|
|
55
|
-
exits 3. Free-plan local runs work
|
|
55
|
+
exits 3. Free-plan local runs work. BE cannot use `--local`.
|
|
56
56
|
- `--local` implies `--wait` (1200 s per run; ordinary: 600). `--local-host`:
|
|
57
57
|
`localhost`, `127.0.0.1` (default), `::1`. A dead port exits 5 before charge;
|
|
58
|
-
`--skip-preflight` skips the probe. Environment `--url` rejects private hosts.
|
|
58
|
+
`--skip-preflight` skips the probe. Environment `--url` rejects private (non-loopback) hosts.
|
|
59
59
|
`--local` selects/creates `local-<port>`; a named `--env` must be local.
|
|
60
60
|
`--target-url` cannot combine with `--local`.
|
|
61
61
|
- Run local ids together (`test run <id> <id> … --local <port>`); `--all --project
|
|
@@ -82,14 +82,14 @@ testsprite test run --all --project <id> --env staging --wait --output json
|
|
|
82
82
|
free BLOCKED results. A public `--env` or Default works regardless of earlier
|
|
83
83
|
tunnel runs. V3 local runs use the agent path, never saved-code replay, and
|
|
84
84
|
preserve saved code.
|
|
85
|
-
- `--wait` handles polling/backoff;
|
|
85
|
+
- `--wait` handles polling/backoff; don't wrap it in a retry loop.
|
|
86
86
|
- Backend Python runs top-to-bottom, not via pytest: call `test_*` functions.
|
|
87
87
|
The sandbox has stdlib, `requests`, `pytest`, `numpy`, `scipy`; use HTTP,
|
|
88
88
|
not project imports or uninstalled packages.
|
|
89
89
|
- Backend `--produces`/`--needs` are repeatable; `--category teardown` marks cleanup.
|
|
90
90
|
Set dependencies with `test create` or edit with `test update`; do not delete
|
|
91
91
|
and recreate. Use `test run --all` for producer → consumer → teardown ordering
|
|
92
|
-
and variable passing. A BE
|
|
92
|
+
and variable passing. A BE run includes that closure and its side effects;
|
|
93
93
|
`--skip-dependencies` selects only the named test. Triage failed producers before
|
|
94
94
|
blaming consumers starved of their token/fixture.
|
|
95
95
|
|
|
@@ -127,6 +127,7 @@ existing test already covers.
|
|
|
127
127
|
```bash
|
|
128
128
|
testsprite test list --project <projectId> --output json
|
|
129
129
|
testsprite test list --project <projectId> --status failed --output json # what's already red
|
|
130
|
+
testsprite test run --all --project <projectId> --status failed,blocked --wait --timeout 600 --output json # re-run what did not pass
|
|
130
131
|
```
|
|
131
132
|
|
|
132
133
|
Heuristic: a change to `src/components/CheckoutForm.tsx` is more likely covered
|
|
@@ -382,12 +383,9 @@ testsprite project env create <projectId> --name staging --url https://staging.e
|
|
|
382
383
|
# (a) existing test
|
|
383
384
|
testsprite test run <test-id> --env staging --wait --timeout 600 --output json
|
|
384
385
|
|
|
385
|
-
# (a-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
# so expect their side effects (fixtures re-created, teardown deletes) and extra runs in history.
|
|
389
|
-
testsprite test rerun <test-id> --env staging --wait --timeout 600 --output json
|
|
390
|
-
testsprite test rerun <test-id> --skip-dependencies --wait --timeout 600 # BE: named test only
|
|
386
|
+
# (a-several) several tests in one batch; --skip-dependencies (BE) runs only the named tests
|
|
387
|
+
testsprite test run <test-id> <test-id> --env staging --wait --timeout 600 --output json
|
|
388
|
+
testsprite test run <test-id> --skip-dependencies --wait --timeout 600
|
|
391
389
|
|
|
392
390
|
# (b-FE) new FE test from plan
|
|
393
391
|
testsprite test create --plan-from plan.json --run --wait --env staging --timeout 600
|
|
@@ -398,6 +396,7 @@ testsprite test create --type backend --name "..." --project <projectId> --code-
|
|
|
398
396
|
# (b-BE coverage set with dependencies) create each test without --run, then one wave-ordered batch
|
|
399
397
|
testsprite test run --all --project <projectId> --env staging --wait --timeout 600 --output json
|
|
400
398
|
testsprite test run --all --project <projectId> --filter <name-substr> --wait --timeout 600 # subset by name
|
|
399
|
+
testsprite test run --all --project <projectId> --status failed,blocked --wait --timeout 600 # only what did not pass
|
|
401
400
|
|
|
402
401
|
# (c) FE coverage set — single-call create + run (FE-only)
|
|
403
402
|
testsprite test create-batch --plans plans.jsonl --run --wait \
|
|
@@ -410,21 +409,21 @@ testsprite test create-batch --plans plans.jsonl --run --wait \
|
|
|
410
409
|
testsprite test plan put <test-id> --steps refined.json && \
|
|
411
410
|
testsprite test run <test-id> --env staging --wait --timeout 600
|
|
412
411
|
|
|
413
|
-
# (d-BE) refine BE code + re-run.
|
|
414
|
-
#
|
|
415
|
-
#
|
|
412
|
+
# (d-BE) refine BE code + re-run. A BE run dispatches the producer/teardown closure by default —
|
|
413
|
+
# use --skip-dependencies while iterating on one script (producers already verified this round),
|
|
414
|
+
# then finish with a closure run before reporting.
|
|
416
415
|
testsprite test code put <test-id> --code-file refined.py --expected-version <current-version> && \
|
|
417
416
|
testsprite test run <test-id> --env staging --wait --timeout 600
|
|
418
417
|
```
|
|
419
418
|
|
|
420
419
|
Key behaviors:
|
|
421
420
|
|
|
422
|
-
- Environment `--url`
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
421
|
+
- Environment `--url` takes a public http/https URL or a loopback http origin
|
|
422
|
+
with an explicit port (frontend only); private and link-local addresses are
|
|
423
|
+
refused. Running against a loopback environment opens a tunnel automatically
|
|
424
|
+
and waits, like `--local <port>`. `--env <name> --local <port>` sends that
|
|
425
|
+
environment's sign-in to your local app; the server applies it or refuses
|
|
426
|
+
before dispatch.
|
|
428
427
|
- `--wait` long-polls until terminal and handles its own backoff — don't wrap it
|
|
429
428
|
in a retry loop.
|
|
430
429
|
- `--local` implies `--wait`, with a default timeout of 1200 seconds per run (ordinary
|
|
@@ -481,13 +480,17 @@ Key behaviors:
|
|
|
481
480
|
tests (producers → consumers → `teardown` last); FE tests in the project are
|
|
482
481
|
skipped with an advisory, and everything not dispatched is enumerated
|
|
483
482
|
(`conflicts` / `deferred` / `skippedFrontend`) so don't count `accepted[]`
|
|
484
|
-
alone.
|
|
485
|
-
|
|
486
|
-
and
|
|
483
|
+
alone. A big batch is accepted whole and its runs show `queued` until they
|
|
484
|
+
start; `deferred` is rare (a project's lock stayed busy, or a test went in
|
|
485
|
+
flight during dispatch) and is never resent (exit 7). A BE run expands the
|
|
486
|
+
producer/teardown closure by default; failed
|
|
487
|
+
members surface as `closureFailures[]` without flipping the exit
|
|
487
488
|
code. Pass `--skip-dependencies` only when this round already verified the
|
|
488
489
|
producers and you're iterating fast on one script.
|
|
489
|
-
- `test code put
|
|
490
|
-
|
|
490
|
+
- `test code put`: `--expected-version <codeVersion>` is optional (the CLI
|
|
491
|
+
fetches the current version, which races with concurrent edits); stale etag → exit 6,
|
|
492
|
+
re-fetch via
|
|
493
|
+
`test get <id>` and retry. `--force` bypasses but is audit-logged.
|
|
491
494
|
- Idempotency: the CLI auto-mints an `Idempotency-Key`; replays within 24h return
|
|
492
495
|
the original test/run.
|
|
493
496
|
|
|
@@ -525,7 +528,7 @@ and runtime output: if the runtime output references a literal you submitted
|
|
|
525
528
|
earlier in the plan, the action succeeded and the error is runtime-phase.
|
|
526
529
|
|
|
527
530
|
**BE closure runs: root-cause the earliest failed wave, not the selected test.**
|
|
528
|
-
When a
|
|
531
|
+
When a `run` or `run --all` expanded a dependency closure and a **producer**
|
|
529
532
|
failed, every consumer downstream of it fails or blocks by starvation (missing
|
|
530
533
|
token / missing fixture). The selected test's red verdict does not implicate
|
|
531
534
|
your feature — report it as failed-downstream, pull the producer's artifact
|