@testsprite/testsprite-cli 0.6.0 → 0.8.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 (96) hide show
  1. package/README.md +52 -31
  2. package/dist/commands/agent.js +91 -45
  3. package/dist/commands/ci.d.ts +88 -0
  4. package/dist/commands/ci.js +429 -0
  5. package/dist/commands/doctor.d.ts +1 -1
  6. package/dist/commands/doctor.js +104 -8
  7. package/dist/commands/init.js +8 -0
  8. package/dist/commands/project.d.ts +78 -0
  9. package/dist/commands/project.js +429 -5
  10. package/dist/commands/schedule.d.ts +120 -0
  11. package/dist/commands/schedule.js +487 -0
  12. package/dist/commands/test.d.ts +176 -2
  13. package/dist/commands/test.js +2235 -609
  14. package/dist/commands/testlist.d.ts +88 -0
  15. package/dist/commands/testlist.js +753 -0
  16. package/dist/commands/tunnel.d.ts +72 -0
  17. package/dist/commands/tunnel.js +367 -0
  18. package/dist/index.js +113 -40
  19. package/dist/lib/agent-targets.d.ts +13 -4
  20. package/dist/lib/agent-targets.js +11 -2
  21. package/dist/lib/conflict-reason.d.ts +30 -0
  22. package/dist/lib/conflict-reason.js +45 -0
  23. package/dist/lib/credentials.js +42 -1
  24. package/dist/lib/cron.d.ts +40 -0
  25. package/dist/lib/cron.js +190 -0
  26. package/dist/lib/dry-run/samples.d.ts +9 -0
  27. package/dist/lib/dry-run/samples.js +293 -55
  28. package/dist/lib/errors.d.ts +9 -0
  29. package/dist/lib/errors.js +11 -0
  30. package/dist/lib/gh-output.d.ts +33 -1
  31. package/dist/lib/gh-output.js +97 -27
  32. package/dist/lib/http.d.ts +119 -0
  33. package/dist/lib/http.js +243 -2
  34. package/dist/lib/interrupt.d.ts +38 -13
  35. package/dist/lib/interrupt.js +130 -15
  36. package/dist/lib/junit-report.d.ts +20 -2
  37. package/dist/lib/junit-report.js +38 -5
  38. package/dist/lib/local-target.d.ts +95 -0
  39. package/dist/lib/local-target.js +184 -0
  40. package/dist/lib/plan-poll.d.ts +171 -0
  41. package/dist/lib/plan-poll.js +442 -0
  42. package/dist/lib/plans.types.d.ts +130 -0
  43. package/dist/lib/plans.types.js +31 -0
  44. package/dist/lib/poll-support.d.ts +26 -0
  45. package/dist/lib/poll-support.js +65 -0
  46. package/dist/lib/poll.d.ts +1 -0
  47. package/dist/lib/poll.js +2 -40
  48. package/dist/lib/proxy.d.ts +16 -0
  49. package/dist/lib/proxy.js +19 -1
  50. package/dist/lib/response-schemas.d.ts +20 -0
  51. package/dist/lib/response-schemas.js +55 -1
  52. package/dist/lib/run-progress.d.ts +41 -0
  53. package/dist/lib/run-progress.js +56 -0
  54. package/dist/lib/runs.types.d.ts +32 -3
  55. package/dist/lib/secret-file.d.ts +15 -0
  56. package/dist/lib/secret-file.js +82 -0
  57. package/dist/lib/target-url-preflight.d.ts +91 -0
  58. package/dist/lib/target-url-preflight.js +259 -0
  59. package/dist/lib/target-url.d.ts +63 -9
  60. package/dist/lib/target-url.js +283 -62
  61. package/dist/lib/telemetry.d.ts +11 -0
  62. package/dist/lib/telemetry.js +1 -0
  63. package/dist/lib/testlist.types.d.ts +77 -0
  64. package/dist/lib/testlist.types.js +9 -0
  65. package/dist/lib/ticker.d.ts +8 -0
  66. package/dist/lib/ticker.js +3 -0
  67. package/dist/lib/tunnel-session.d.ts +129 -0
  68. package/dist/lib/tunnel-session.js +232 -0
  69. package/dist/lib/tunnel.types.d.ts +54 -0
  70. package/dist/lib/tunnel.types.js +8 -0
  71. package/dist/lib/v3-advisory.d.ts +35 -22
  72. package/dist/lib/v3-advisory.js +44 -24
  73. package/dist/lib/wait-exit.d.ts +29 -0
  74. package/dist/lib/wait-exit.js +103 -0
  75. package/dist/vendor/tunnel-client/client.d.ts +83 -0
  76. package/dist/vendor/tunnel-client/client.js +871 -0
  77. package/dist/vendor/tunnel-client/config.d.ts +41 -0
  78. package/dist/vendor/tunnel-client/config.js +42 -0
  79. package/dist/vendor/tunnel-client/index.d.ts +9 -0
  80. package/dist/vendor/tunnel-client/index.js +9 -0
  81. package/dist/vendor/tunnel-client/lodash-lite.d.ts +14 -0
  82. package/dist/vendor/tunnel-client/lodash-lite.js +24 -0
  83. package/dist/vendor/tunnel-client/protocol.d.ts +60 -0
  84. package/dist/vendor/tunnel-client/protocol.js +143 -0
  85. package/dist/vendor/tunnel-client/types.d.ts +96 -0
  86. package/dist/vendor/tunnel-client/types.js +10 -0
  87. package/dist/vendor/tunnel-client/ws-compat.d.ts +206 -0
  88. package/dist/vendor/tunnel-client/ws-compat.js +316 -0
  89. package/dist/version-guard.d.ts +10 -7
  90. package/dist/version-guard.js +37 -9
  91. package/dist/version.d.ts +1 -1
  92. package/dist/version.js +1 -1
  93. package/package.json +2 -1
  94. package/skills/testsprite-onboard.skill.md +60 -4
  95. package/skills/testsprite-verify.codex.md +22 -16
  96. package/skills/testsprite-verify.skill.md +27 -18
@@ -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 — it doesn't build or host your environment.
20
- Run the loop only once the change is live somewhere reachable (e.g. open the PR,
21
- let CI deploy the preview/staging environment) and pass that URL as
22
- `--target-url`. Running earlier verifies the previous build, not your change.
23
-
24
- This CLI only tests a reachable deployed URL (it rejects localhost). If the
25
- change is only running locally and isn't deployed anywhere reachable yet:
26
-
27
- - if the TestSprite MCP is available in this environment, hand off to it — it
28
- tunnels your local server and tests the running app;
29
- - otherwise report the change as unverified-because-undeployed and stop — don't
30
- run against a stale deployment to manufacture a verdict.
31
-
32
- If the user explicitly named a tool (the CLI or the MCP), honor that over this
33
- reachability heuristic.
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 — local-only changes can't be run here. If
384
- the feature is deployed only locally, say so and skip the run.
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`