@testsprite/testsprite-cli 0.14.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 (61) hide show
  1. package/README.md +27 -17
  2. package/dist/commands/agent.js +7 -2
  3. package/dist/commands/auth.js +7 -3
  4. package/dist/commands/ci.d.ts +66 -17
  5. package/dist/commands/ci.js +486 -122
  6. package/dist/commands/completion.js +2 -1
  7. package/dist/commands/doctor.d.ts +3 -0
  8. package/dist/commands/doctor.js +52 -10
  9. package/dist/commands/init.js +25 -5
  10. package/dist/commands/project-env.js +39 -17
  11. package/dist/commands/project-sign-in.js +9 -4
  12. package/dist/commands/project.js +43 -22
  13. package/dist/commands/schedule.js +24 -15
  14. package/dist/commands/test.d.ts +105 -36
  15. package/dist/commands/test.js +1494 -847
  16. package/dist/commands/testlist.js +13 -3
  17. package/dist/commands/tunnel.js +23 -25
  18. package/dist/commands/usage.js +1 -0
  19. package/dist/index.js +14 -7
  20. package/dist/lib/agent-targets.d.ts +8 -3
  21. package/dist/lib/agent-targets.js +15 -4
  22. package/dist/lib/ci-run.d.ts +11 -0
  23. package/dist/lib/ci-run.js +34 -0
  24. package/dist/lib/client-factory.d.ts +23 -0
  25. package/dist/lib/client-factory.js +7 -6
  26. package/dist/lib/config.d.ts +1 -0
  27. package/dist/lib/config.js +1 -1
  28. package/dist/lib/conflict-reason.d.ts +24 -3
  29. package/dist/lib/conflict-reason.js +33 -2
  30. package/dist/lib/credentials.d.ts +0 -1
  31. package/dist/lib/credentials.js +51 -14
  32. package/dist/lib/deprecate.d.ts +22 -0
  33. package/dist/lib/deprecate.js +26 -0
  34. package/dist/lib/dry-run/samples.js +56 -5
  35. package/dist/lib/environment-tunnel.d.ts +2 -1
  36. package/dist/lib/environment-tunnel.js +1 -4
  37. package/dist/lib/first-suite-hint.d.ts +55 -0
  38. package/dist/lib/first-suite-hint.js +101 -0
  39. package/dist/lib/gh-output.d.ts +62 -4
  40. package/dist/lib/gh-output.js +149 -7
  41. package/dist/lib/github-context.d.ts +21 -0
  42. package/dist/lib/github-context.js +153 -0
  43. package/dist/lib/http.d.ts +10 -1
  44. package/dist/lib/http.js +29 -3
  45. package/dist/lib/junit-report.d.ts +3 -0
  46. package/dist/lib/junit-report.js +8 -1
  47. package/dist/lib/output.d.ts +11 -1
  48. package/dist/lib/output.js +17 -2
  49. package/dist/lib/plans.types.d.ts +1 -1
  50. package/dist/lib/response-schemas.d.ts +5 -1
  51. package/dist/lib/response-schemas.js +57 -0
  52. package/dist/lib/runs.types.d.ts +122 -0
  53. package/dist/lib/telemetry.d.ts +26 -2
  54. package/dist/lib/telemetry.js +47 -4
  55. package/dist/version.d.ts +1 -1
  56. package/dist/version.js +1 -1
  57. package/package.json +3 -3
  58. package/schemas/plan.schema.json +2 -2
  59. package/skills/testsprite-ci.skill.md +154 -0
  60. package/skills/testsprite-verify.codex.md +7 -7
  61. package/skills/testsprite-verify.skill.md +24 -21
@@ -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