Repository navigation
docs(readme): shorten the local-testing tunnel notes #556
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -154,11 +154,11 @@ Hit the tunnel limit? Run `testsprite tunnel list`, then `testsprite tunnel stop | |
| A second `tunnel start` or process using the same credential takes over, and the first exits **10**. | ||
| An environment is one origin (scheme, host and port) plus its sign-in configuration. Frontend runs automatically open a tunnel for a saved `localhost`, `127.0.0.1` or `[::1]` URL: `test run`, `test rerun`, `test create --run`, `test create-batch --run` and `testlist run` use this behavior. `--env <name>` selects the environment; omit it for the project default. `--no-wait` disables automatic tunnels; drop it to run through one. If environment reads are unavailable, the command keeps the previous server behavior. Several fresh-run IDs require a tunnel; public targets retain the exit-5 refusal. A named public environment used against a local origin prints a sign-in advisory on stderr. Reruns and test-list runs share one timeout including capacity waits and require the server to confirm tunnel support; an older server triggers a cancellation attempt and a clear error. | ||
|
|
||
| `--local <port>` remains a shorthand and defaults new project/environment URLs to `http://localhost:<port>`. On a test run it preserves the host of a selected loopback environment, or the one host agreed by saved non-temporary loopback environments on that port; otherwise it uses `localhost`. If environment reads fail, it retains the legacy `127.0.0.1` host. Saved URLs retain their exact spelling, and aliases are not merged. `--local-host` remains accepted but is deprecated and hidden from project/environment help; prefer `--url http://127.0.0.1:<port>` or `--url http://[::1]:<port>` when the host matters. Dev servers can take a minute per page through a tunnel; test a built server with `npm run build` and your framework's preview/start command for heavy apps. | ||
| The control plane is WebSocket over TLS (`wss://control.tun.testsprite.com/ws`). The data plane, which carries the tunnel secret and proxied traffic, uses TLS at `data.tun.testsprite.com:443` and verifies the certificate with Node's default trust store: its bundled Mozilla roots, plus certificates supplied through `NODE_EXTRA_CA_CERTS` and the system CAs when Node is started with `--use-system-ca`. Node 20 is supported without losing `NODE_EXTRA_CA_CERTS`. Verification cannot be disabled, and the CLI never falls back from TLS to plaintext. On a network that re-signs TLS, export your organisation's root CA to a PEM file and set `NODE_EXTRA_CA_CERTS=/path/to/ca.pem` before running `testsprite`. Plaintext connects and TLS handshakes each time out after 10 seconds. The first failed attempt starts a **60-second** retry episode; writing `TunnelHello` is not enough to reset it. The episode ends only after the first inbound tunnel stream or after the socket remains open for 5 seconds following the hello. A real deadline timer stays armed across retries and destroys an in-flight socket when it expires. After that, an owned `test run --local` run is cancelled and refunded and the command exits **10**; `tunnel start` exits **10**. If a self-hosted or older TestSprite server does not advertise a TLS endpoint, the CLI prints a one-time warning and uses legacy plaintext port **7400** under the same timeout and retry rules. `tunnel start` prints `transport: tls` or `transport: plaintext`. | ||
| An owned tunnel's timeout or Ctrl-C cancels unfinished runs by default. A borrowed run still detaches without cancellation on Ctrl-C/SIGTERM because its owner keeps the tunnel alive; if that owner disappears while a run is active, the borrower cancels its own run and reports `cancelled`, `already finished`, or `skipped`. A run cancelled before it finishes is refunded. `--no-cancel-on-interrupt` also skips this owner-gone cancellation. Keep the early stderr run-id receipts (`Run <runId>` for one test, `[i/N] <testId> β run <runId>` for a batch) and read the reported runs before re-running. | ||
| Local projects skip exploration/plan generation; author plans with `test create --plan-from`. Portal runs are blocked for free until you set a public project URL. | ||
| See [the full local-testing reference](./DOCUMENTATION.md#local-frontend-testing-and-tunnels) for flags, login, billing/refunds, timeouts, and retargeting. | ||
| `--local <port>` saves new project and environment URLs as `http://localhost:<port>`. Use `--url http://127.0.0.1:<port>` or `--url http://[::1]:<port>` when the host matters (`--local-host` is deprecated). Dev servers can be slow through a tunnel, so for heavy apps test a production build (`npm run build` plus your framework's preview or start command). | ||
|
|
||
| The tunnel uses verified TLS. On a network that re-signs TLS, set `NODE_EXTRA_CA_CERTS=/path/to/ca.pem` to your organisation's root CA. If the tunnel keeps failing to connect for 60 seconds, the command exits **10**, and an owned run is cancelled and refunded. | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. π Security & Privacy | π‘ Minor | β‘ Quick win π Supported by static analysisπ Script executed: printf '%s\n' '--- complete README diff against PR base ---'
git diff --no-ext-diff --unified=8 a8f8cca244b4daf1b5d37ec3fe7c2c4fff2492a3 50f4c0bfdbcc5d6e24a1f7e0c7201e2651320488 -- README.md
printf '\n--- DOCUMENTATION TLS contract ---\n'
nl -ba DOCUMENTATION.md | sed -n '786,814p'
printf '\n--- TLS capability negotiation and legacy data-port references ---\n'
rg -n -C 4 --glob '!node_modules/**' --glob '!vendor/**' 'legacy plaintext|plaintext data|data port|TLS endpoint|advertise.*TLS|tls.*(port|endpoint)|tlsPort' .Repository: TestSprite/testsprite-cli Length of output: 27777 π Script executed: set -o pipefail
printf '%s\n' '--- negotiation symbols and callers ---'
rg -n -F --glob '*.ts' -e 'advertises' -e 'tlsEndpoint' -e 'tlsPort' -e 'transport' -e 'plaintext' -e 'dataPlane' -e 'legacy' src lib 2>/dev/null || true
printf '%s\n' '--- tunnel-session outline ---'
if [ -f src/lib/tunnel-session.ts ]; then
ast-grep outline src/lib/tunnel-session.ts --view expanded
nl -ba src/lib/tunnel-session.ts | sed -n '1,280p'
fi
printf '%s\n' '--- tunnel client entrypoints and types ---'
rg -n -F --glob '*.ts' -e 'TunnelClient' -e 'tlsEndpoint' -e 'dataPlanePort' -e 'legacy' src/vendor/tunnel-client src/lib src/commands 2>/dev/null || trueRepository: TestSprite/testsprite-cli Length of output: 42017 π Script executed: set -o pipefail
printf '%s\n' '--- tunnel-session transport selection ---'
nl -ba src/lib/tunnel-session.ts | sed -n '300,370p'
nl -ba src/lib/tunnel-session.ts | sed -n '425,447p'
printf '%s\n' '--- TunnelClient transport selection and socket branch ---'
nl -ba src/vendor/tunnel-client/client.ts | sed -n '100,190p'
nl -ba src/vendor/tunnel-client/client.ts | sed -n '742,795p'
printf '%s\n' '--- exact documentation and README wording ---'
nl -ba DOCUMENTATION.md | sed -n '799,803p'
nl -ba README.md | sed -n '155,163p'Repository: TestSprite/testsprite-cli Length of output: 15748 Qualify the TLS guarantee. Older or self-hosted servers that do not advertise a TLS endpoint use the legacy plaintext data port. Update this sentence so it does not imply that every supported tunnel connection is encrypted. Suggested wording-The tunnel uses verified TLS.
+The tunnel uses verified TLS when the server advertises a TLS endpoint. Older or self-hosted servers without one use the legacy plaintext data port.π€ Prompt for AI Agents |
||
|
|
||
| On an owned tunnel, Ctrl-C or a timeout cancels unfinished runs by default, and a run cancelled before it finishes is refunded. A run on a borrowed `--tunnel-client` detaches on Ctrl-C instead. Local projects skip plan generation, so write plans with `test create --plan-from`. Portal runs stay blocked, at no charge, until the project has a public URL. See [the local-testing reference](./DOCUMENTATION.md#local-frontend-testing-and-tunnels) for the details. | ||
|
|
||
| ## Commands | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
π― Functional Correctness | π‘ Minor | β‘ Quick win
π Supported by static analysis
π Script executed:
Repository: TestSprite/testsprite-cli
Length of output: 42520
π Script executed:
Repository: TestSprite/testsprite-cli
Length of output: 11133
State that
localhostis the default.--local-hostremains accepted and overrides the host saved by--local <port>. Describelocalhostas the default, or state that--local-hostremains an override.Suggested wording
π€ Prompt for AI Agents