Skip to content

test(install-smoke): add clean-prefix npm and Bun install smoke tests#183

Closed
andrei-hasna wants to merge 1 commit into
mainfrom
openloops/open-codewith/e0c1b67b-0253-4cd8-bbac-ca26dca7c321-c8bd08a3
Closed

test(install-smoke): add clean-prefix npm and Bun install smoke tests#183
andrei-hasna wants to merge 1 commit into
mainfrom
openloops/open-codewith/e0c1b67b-0253-4cd8-bbac-ca26dca7c321-c8bd08a3

Conversation

@andrei-hasna

Copy link
Copy Markdown
Contributor

Summary

Adds clean-prefix install smoke tests that prove codex-cli/bin/codex.js resolves the platform package's native binary instead of the local ../vendor fallback — the exact resolve-vs-fallback branch (codex.js:133-141) that broke when native platform packages failed to publish for 0.1.51.

codex-cli/scripts/test_install_smoke.py:

  • Stages the main @hasna/codewith package and a synthetic platform package for the current host triple via the real build_npm_package.py generator (fake native binary = a tiny Node shim that prints codewith <version> and its own resolved path).
  • Installs both local tarballs into a throwaway consumer project with isolated HOME/npm/Bun caches, offline, via both npm and Bun (file: deps + overrides + --offline so the local tarballs — not the published registry copy — satisfy the optionalDependency).
  • Asserts the resolved binary lives under node_modules/@hasna/codewith-<triple>/vendor and not the main package's vendor. To prove precedence it drops a DIFFERENT-marker fallback binary into the main package's ../vendor and re-checks that the platform package still wins.
  • Smokes the installed codewith --version bin wrapper end to end.
  • A real @hasna/codewith@latest registry install is gated behind CODEWITH_SMOKE_REGISTRY=1 and skipped by default so offline/sandbox validation passes. Missing npm/bun, or an offline install that needs network, skip rather than fail.

.github/workflows/ci.yml: adds a Setup Bun step and a new python3 -m unittest codex-cli/scripts/test_install_smoke.py step so both the npm and Bun paths run in CI.

Validation

  • python3 -m unittest codex-cli/scripts/test_install_smoke.py → OK (npm + Bun pass, registry skipped) on linux/arm64.
  • CODEWITH_SMOKE_REGISTRY=1 …test_published_registry_install_runs → OK (published package installs and runs).
  • python3 -m unittest codex-cli/scripts/test_build_npm_package.py → OK (regression, unaffected).
  • node --test in codex-cli/ → 5/5 pass.
  • pnpm run format (prettier) → clean.

🤖 Generated with Claude Code

Stage the main @hasna/codewith package plus a synthetic platform package for
the current host triple with build_npm_package.py, install both into a
throwaway consumer project (isolated HOME/cache) via npm and Bun offline, and
assert bin/codex.js resolves the platform package's native binary instead of
the local ../vendor fallback -- the branch that broke when native platform
packages failed to publish. A DIFFERENT-marker fallback binary is dropped into
the main package's vendor to prove the platform package still wins.

The default path is fully offline (local tarballs, --offline, isolated caches)
so it runs without registry access; a real @hasna/codewith@latest registry
install is gated behind CODEWITH_SMOKE_REGISTRY=1 and skipped by default. Wired
into ci.yml with a Setup Bun step and a new unittest step.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
andrei-hasna added a commit that referenced this pull request Jul 9, 2026
Combine the workflow action pin bumps from PRs #188-#192 with the install-smoke coverage from #183 on current main.

Fix stale v8-canary version comments and add CI coverage for clean-prefix npm/Bun install smoke validation.
andrei-hasna added a commit that referenced this pull request Jul 9, 2026
Combine the workflow action pin bumps from PRs #188-#192 with the install-smoke coverage from #183 on current main.

Fix stale v8-canary version comments and add CI coverage for clean-prefix npm/Bun install smoke validation.
@andrei-hasna

Copy link
Copy Markdown
Contributor Author

Closing as superseded by #206. Replacement #206 combines the current GitHub Actions/install-smoke train and explicitly supersedes this PR. Please continue review on #206.

andrei-hasna added a commit that referenced this pull request Jul 9, 2026
Combine the workflow action pin bumps from PRs #188-#192 with the install-smoke coverage from #183 on current main.

Fix stale v8-canary version comments and add CI coverage for clean-prefix npm/Bun install smoke validation.
andrei-hasna added a commit that referenced this pull request Jul 15, 2026
Combine the workflow action pin bumps from PRs #188-#192 with the install-smoke coverage from #183 on current main.

Fix stale v8-canary version comments and add CI coverage for clean-prefix npm/Bun install smoke validation.
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