fix(cli): run smoke tests under Bun and Node - #348
Draft
M-DGayle wants to merge 1 commit into
Draft
Conversation
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
Make the CLI smoke-test launcher select the correct preload arguments for the runtime executing Vitest.
Motivation
When the CLI suite runs directly on Bun 1.3.10,
process.execPathpoints to Bun, but the smoke helper passes Node's--import tsx --import ...arguments to that executable. The real CLI process exits before rendering version or help output, causing three black-box smoke tests to fail.The harness now uses Bun's supported
--preloadpath whenprocess.versions.bunis present and preserves the existingtsxloader path under Node.Related issue
None.
Changes
apps/cli: detect the active runtime in the E2E smoke helper.--preloadfor Bun and retain--import tsx --importfor Node.Verification
Before the change in a Bun-only Linux environment:
After the change:
I also ran the root test command in Linux Docker. The CLI suite passed, but the root command is not green in a container because existing
@repo/adaptersand@repo/dbtests assume/.dockerenvis absent and/etc/machine-idis stable. Root lint also stops in the existingapps/emailscript because its nested server package has nolintscript.prettier --check apps/cli/test/e2e/smoke.test.tsreports an existing formatting mismatch on both untouchedmainand this branch.git diff --checkpasses, and I left the unrelated formatting untouched.Checklist
bun run test,bun run --cwd <workspace> lint, andbun formatall pass locally — targeted lint/tests/build pass; root/container and pre-existing formatting limitations are documented above