@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.
Files changed (38) hide show
  1. package/README.md +24 -16
  2. package/dist/commands/agent.js +7 -2
  3. package/dist/commands/auth.js +7 -3
  4. package/dist/commands/ci.js +20 -18
  5. package/dist/commands/completion.js +2 -1
  6. package/dist/commands/doctor.js +2 -1
  7. package/dist/commands/init.js +8 -2
  8. package/dist/commands/project-env.js +39 -17
  9. package/dist/commands/project-sign-in.js +9 -4
  10. package/dist/commands/project.js +28 -21
  11. package/dist/commands/schedule.js +24 -15
  12. package/dist/commands/test.d.ts +32 -26
  13. package/dist/commands/test.js +949 -769
  14. package/dist/commands/testlist.js +13 -3
  15. package/dist/commands/tunnel.js +23 -25
  16. package/dist/commands/usage.js +1 -0
  17. package/dist/index.js +9 -6
  18. package/dist/lib/conflict-reason.d.ts +24 -3
  19. package/dist/lib/conflict-reason.js +33 -2
  20. package/dist/lib/deprecate.d.ts +22 -0
  21. package/dist/lib/deprecate.js +26 -0
  22. package/dist/lib/dry-run/samples.js +14 -4
  23. package/dist/lib/environment-tunnel.d.ts +2 -1
  24. package/dist/lib/environment-tunnel.js +1 -4
  25. package/dist/lib/http.js +20 -2
  26. package/dist/lib/junit-report.d.ts +3 -0
  27. package/dist/lib/junit-report.js +8 -1
  28. package/dist/lib/output.d.ts +11 -1
  29. package/dist/lib/output.js +17 -2
  30. package/dist/lib/response-schemas.js +3 -0
  31. package/dist/lib/runs.types.d.ts +16 -0
  32. package/dist/lib/telemetry.d.ts +1 -1
  33. package/dist/lib/telemetry.js +2 -0
  34. package/dist/version.d.ts +1 -1
  35. package/dist/version.js +1 -1
  36. package/package.json +3 -3
  37. package/skills/testsprite-verify.codex.md +7 -7
  38. package/skills/testsprite-verify.skill.md +24 -21
@@ -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 {
@@ -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
@@ -157,6 +157,8 @@ const ENUM_KEYS = {
157
157
  'mcp_view_only',
158
158
  'local_address',
159
159
  'tunnel-required',
160
+ 'no_producer',
161
+ 'producer_in_flight',
160
162
  'error',
161
163
  ]),
162
164
  platform: new Set(['github']),
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const VERSION = "0.15.0";
1
+ export declare const VERSION = "0.16.0";
package/dist/version.js CHANGED
@@ -1,4 +1,4 @@
1
1
  // AUTO-GENERATED by scripts/generate-version.mjs — do not edit by hand.
2
2
  // Run `npm run build` (or `npm run generate:version`) to regenerate.
3
- export const VERSION = '0.15.0';
3
+ export const VERSION = '0.16.0';
4
4
  //# sourceMappingURL=version.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@testsprite/testsprite-cli",
3
- "version": "0.15.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.16.0",
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.1",
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
- # Deployed replay (V3 FE: 0.5 credit)
49
- testsprite test rerun <test-id> --env staging --wait --output json
50
- # Dependency batch; optional --filter <substring>
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; V3 FE costs 0.5 credit. BE cannot use `--local`.
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; do not wrap it in a retry loop.
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 `test rerun` includes that closure and its side effects;
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-rerun) replay of a deployed test (V3 FE: 0.5 credit). Replays saved code (auto-heal on — more
386
- # lenient than a fresh run; for strict verification of a new change prefer `test run`).
387
- # BE: dispatches the WHOLE dependency closure — producers and teardowns run too, not just <test-id>,
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. NOTE: if you reach for `test rerun` here instead, a BE rerun
414
- # dispatches the full producer/teardown closure — use --skip-dependencies while iterating on one
415
- # script (producers already verified this round), then finish with a closure run before reporting.
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` 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.
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. `test rerun <be-id>` expands the producer/teardown closure by default —
485
- stderr summarizes `Reran N tests: 1 selected + P producer(s) + T teardown(s)`,
486
- and failed members surface as `closureFailures[]` without flipping the exit
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` needs `--expected-version <codeVersion>`; stale etag → exit 6,
490
- re-fetch via `test get <id>` and retry. `--force` bypasses but is audit-logged.
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 rerun or `run --all` expanded a dependency closure and a **producer**
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