test(install-smoke): add clean-prefix npm and Bun install smoke tests#183
Closed
andrei-hasna wants to merge 1 commit into
Closed
Conversation
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>
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds clean-prefix install smoke tests that prove
codex-cli/bin/codex.jsresolves the platform package's native binary instead of the local../vendorfallback — 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:@hasna/codewithpackage and a synthetic platform package for the current host triple via the realbuild_npm_package.pygenerator (fake native binary = a tiny Node shim that printscodewith <version>and its own resolved path).file:deps +overrides+--offlineso the local tarballs — not the published registry copy — satisfy the optionalDependency).node_modules/@hasna/codewith-<triple>/vendorand not the main package'svendor. To prove precedence it drops a DIFFERENT-marker fallback binary into the main package's../vendorand re-checks that the platform package still wins.codewith --versionbin wrapper end to end.@hasna/codewith@latestregistry install is gated behindCODEWITH_SMOKE_REGISTRY=1and skipped by default so offline/sandbox validation passes. Missingnpm/bun, or an offline install that needs network, skip rather than fail..github/workflows/ci.yml: adds a Setup Bun step and a newpython3 -m unittest codex-cli/scripts/test_install_smoke.pystep 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 --testincodex-cli/→ 5/5 pass.pnpm run format(prettier) → clean.🤖 Generated with Claude Code