Skip to content

[CLI 15] test: add focused development smoke coverage - #222

Open
raviships wants to merge 2 commits into
nextfrom
test/cli-dev-smoke
Open

[CLI 15] test: add focused development smoke coverage#222
raviships wants to merge 2 commits into
nextfrom
test/cli-dev-smoke

Conversation

@raviships

Copy link
Copy Markdown
Collaborator

What changed

  • add one configurable development smoke runner for a built or installed CLI
  • require an explicit pre-provisioned project, API URL, and mutation opt-in
  • reject production and hosts that do not clearly identify as non-production
  • create uniquely named resources and track them for finally cleanup
  • document local and CI credential setup

The 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

  • live dev run: 18/18 checks passed
  • forced upload failure: finally emptied and deleted the created bucket
  • final dev audit: zero smoke buckets and zero active temporary credentials
  • missing mutation opt-in exits 2 before invoking the CLI
  • production API URL exits 2 before invoking the CLI
  • CLI unit suite: 218 tests passed
  • CLI typecheck, standard lint, build, Node syntax check, and Prettier passed

No changeset is included because this PR only adds test tooling and documentation; it does not change published behavior.

@vercel

vercel Bot commented Aug 11, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
edgestore-docs Ready Ready Preview Aug 23, 2026 1:32pm
example-access-control Ready Ready Preview Aug 23, 2026 1:32pm
example-components Ready Ready Preview Aug 23, 2026 1:32pm

Request Review

@raviships
raviships marked this pull request as ready for review August 11, 2026 07:51

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +451 to +453
hostname.includes('dev') ||
hostname.includes('staging') ||
hostname.includes('preview') ||

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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(

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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' ||

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant