[CLI 15] test: add focused development smoke coverage - #222
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3e0971ffcc
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| hostname.includes('dev') || | ||
| hostname.includes('staging') || | ||
| hostname.includes('preview') || |
There was a problem hiding this comment.
Match development markers as complete hostname labels
When a production API hostname merely contains one of these substrings—for example, device-api.example.com or developer.example.com—the safety check classifies it as a development host and permits the destructive smoke run. Since the script advertises that it refuses non-development targets, require recognizable hostname labels or an explicit allowlist rather than unrestricted substring matches.
Useful? React with 👍 / 👎.
| { onSuccess: () => (ledger.bucket = bucketName) }, | ||
| ); | ||
|
|
||
| const uploaded = json( |
There was a problem hiding this comment.
Record cleanup intent before invoking resource creation
If the server creates the bucket but the CLI times out, loses the response, or otherwise exits nonzero afterward, onSuccess never records the deterministic bucket name and the finally block skips remote cleanup. The same response-dependent bookkeeping affects the temporary credentials, so a failed smoke run can leave buckets or active credentials behind; record the bucket before invocation and recover uniquely named credentials during cleanup.
Useful? React with 👍 / 👎.
| const hostname = url.hostname.toLowerCase().replace(/\.$/, ''); | ||
| const developmentHost = | ||
| hostname === '127.0.0.1' || | ||
| hostname === '::1' || |
There was a problem hiding this comment.
Accept the bracketed IPv6 loopback hostname
When EDGESTORE_SMOKE_API_URL uses an IPv6 loopback URL such as http://[::1]:3000, Node's URL.hostname is [::1], not ::1, so this comparison rejects a documented loopback development environment. Normalize the brackets or compare against [::1] as well.
Useful? React with 👍 / 👎.
What changed
finallycleanupThe focused 18-check path covers authentication and account/project context, one protected bucket upload/list/path-lookup/download lifecycle, confirmation and non-empty deletion safeguards, asynchronous emptying, project-key and account-token one-time secret delivery, metadata-only listings, and revocation. The larger exploratory validation matrix remains deferred.
Why
The recovered exploratory suite covered 108 scenarios across four stateful scripts. That is useful as a reference, but too broad for a first maintainable smoke-test PR. This runner keeps the high-value cross-boundary behavior while remaining explicit about mutations and cleanup.
Validation
finallyemptied and deleted the created bucketNo changeset is included because this PR only adds test tooling and documentation; it does not change published behavior.