Skip to content

Add CLI smoke test against fixture scaffold#63

Open
advancedresearcharray wants to merge 10 commits into
mex-memory:mainfrom
advancedresearcharray:feat/cli-smoke-test-57
Open

Add CLI smoke test against fixture scaffold#63
advancedresearcharray wants to merge 10 commits into
mex-memory:mainfrom
advancedresearcharray:feat/cli-smoke-test-57

Conversation

@advancedresearcharray

@advancedresearcharray advancedresearcharray commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add test/fixtures/smoke-project/ minimal .mex scaffold
  • Add test/cli-smoke.test.ts running top-level commands (--version, commands, check, doctor, log, timeline, heartbeat, sync, setup, init, watch) with exit-code and output assertions
  • --version is asserted against package.json so a hard-coded version drift would fail CI

Closes #57

Test plan

  • npm test -- test/cli-smoke.test.ts
  • npm run typecheck

@advancedresearcharray

Copy link
Copy Markdown
Contributor Author

Ready for review — CI is green on Node 20/22 and the suite covers all non-interactive top-level commands against the fixture scaffold (issue #57 acceptance criteria).

Latest push:

  • Removed Cursor co-author trailers from prior commits
  • Added expectSuccess helper so failed CLI invocations surface stdout/stderr in assertion output
  • Guarded afterAll cleanup when fixture setup fails before projectRoot is set

tui is intentionally excluded (interactive; covered in test/tui.test.ts).

@advancedresearcharray advancedresearcharray force-pushed the feat/cli-smoke-test-57 branch 2 times, most recently from ff919f9 to a4271ba Compare June 6, 2026 04:55
@advancedresearcharray

Copy link
Copy Markdown
Contributor Author

@theDakshJaitly — ready for review when you have a moment.

Latest push adds explicit coverage for default mex check output (not just --quiet), matching issue #57’s acceptance criteria for the check command path.

CI was green on the prior push (Node 20/22); this is a one-test addition only.

@advancedresearcharray advancedresearcharray force-pushed the feat/cli-smoke-test-57 branch 3 times, most recently from 961a47b to 0861f74 Compare June 9, 2026 10:23
root and others added 5 commits June 9, 2026 10:26
Run top-level CLI commands in a git-backed smoke project and assert exit
codes and key output, including --version matching package.json.
Add pattern add to the CLI smoke suite, clean up unused imports,
and remove the temp project directory after tests finish.
Surface CLI stdout/stderr in assertion messages on non-zero exits and
guard fixture teardown when setup fails before projectRoot is assigned.
Cover the non-quiet check path explicitly so regressions in the
standard drift report are caught alongside --quiet.
Ensure dist/cli.js exists before each smoke invocation so parallel
vitest files (e.g. cli.test.ts beforeAll build) cannot delete the
binary mid-suite and cause flaky MODULE_NOT_FOUND failures.
@advancedresearcharray advancedresearcharray force-pushed the feat/cli-smoke-test-57 branch 2 times, most recently from a01da7b to 781e9a6 Compare June 9, 2026 10:32
Assert check --json returns a clean drift report on the fixture scaffold
(context/ and patterns/ frontmatter included) and cover zsh/fish completion
scripts alongside bash.
Assert dist/cli.js exists after npm run build in beforeAll and ensureCliBuilt
so smoke tests fail fast with a clear error instead of opaque spawn failures.
Removes accidental corrupted internal/exporter/mkdocs.go from a prior commit.
@advancedresearcharray

Copy link
Copy Markdown
Contributor Author

Addressed peer-review feedback:

  1. Corrupted files — Removed accidental internal/exporter/mkdocs.go (binary garbage from an errant local commit; the test/fixtures/smoke-project scaffold only contains valid markdown/JSON/TS).
  2. CLI executable guardensureCliBuilt, runMex, and beforeAll now throw a clear error if dist/cli.js is missing after npm run build.
  3. Build verificationbeforeAll still runs npm run build and now asserts the CLI artifact exists before any smoke tests run.

Local test run: npm test — 17 files, 243 tests passed.

Run npm run build and assert the CLI artifact exists in a global setup hook
so smoke and integration tests fail fast when the build step is skipped or
broken, addressing peer-review feedback on build verification.
@advancedresearcharray advancedresearcharray force-pushed the feat/cli-smoke-test-57 branch 2 times, most recently from 2f8b2d6 to 068b315 Compare June 9, 2026 19:58
Run --version after build so smoke tests fail fast with a clear error when
runtime dependencies are missing, not only when dist/cli.js is absent.
Set MEX_TELEMETRY=0 when spawning the CLI in smoke tests so temp-dir
runs never emit telemetry even if vitest env inheritance changes.

Co-authored-by: Cursor <cursoragent@cursor.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.

Add a CLI smoke test against a fixture scaffold

1 participant