Skip to content

Add a live, read-only CLI smoke test - #25

Open
daveosterjr wants to merge 1 commit into
masterfrom
codex/live-smoke
Open

daveosterjr wants to merge 1 commit into
masterfrom
codex/live-smoke

Conversation

@daveosterjr

Copy link
Copy Markdown
Contributor

This adds npm run smoke:live, which runs the real built dm binary against a live API. Before this, every CLI test was mocked.

  • Inputs. DM_API_URL (for example https://api-staging.v2.dealmachine.com/v1) and DM_API_KEY. If either is missing, it exits 1 and names the variable. The key is never printed.
  • Isolation. The script writes an encrypted-file config into a temporary home. It never touches the Keychain or the developer's settings, and the child gets a minimal environment.
  • Commands run: --version, account, filters, fields, and a property search with --estimate-cost only. A local relay refuses any request outside that read-only list before it leaves the machine, and checks the X-DealMachine-Source: cli header, the User-Agent and the auth on every request.

Related: Factory https://github.com/DealMachine/dealmachine-factory/pull/139 registers cli:smoke:live as a scripted regression check against staging.

Validation:

  • npm run check passes after rebasing onto master.
  • npm run test:package passes.
  • Against a fake API: 5 of 5 pass. An empty result, a missing key and the API being down each fail with a clear line.

Not verified: a run against staging (no QA key yet), and Windows.

🤖 Generated with Claude Code

npm run smoke:live builds the CLI and runs the real dm binary against
DM_API_URL with DM_API_KEY in a temporary home directory. A local relay
refuses non-allowlisted requests and checks the CLI source header.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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