Repository navigation
test(deploy): setup-vm and build-snapshot tests run on macOS's bash 3.2 - #815
Merged
Merged
Conversation
Two deploy shell suites stopped under /bin/bash 3.2:
- deploy/vm/tests/setup-vm.test.sh used `mapfile`, which bash 3.2 lacks.
It now fills both arrays with a read loop. Three require_cmds cases ran
as `PATH=/nonexistent require_cmds ...`. With that prefix assignment to
a function call, bash 3.2 keeps its command hash, so `command -v` still
found a hashed command and the "missing tool" checks failed. They now
set PATH in a subshell.
- deploy/microvm/tests/build-snapshot.test.sh had comments with an
apostrophe ("scenario 1's comment", "preflight's own") inside
`$( ... )`. bash 3.2 reads that apostrophe as an open quote, so
`vfs_out` was never assigned and the script failed to parse past it.
The comments are reworded.
Both suites now pass under /bin/bash 3.2 and bash 5. make
test-deploy-bash32 runs them, and the Makefile comment says how each
suite meets the interpreter.
Closes rossoctl#720
Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Rong Chang <[email protected]>
ingpaolodettori-dev
approved these changes
Nov 16, 2026
ingpaolodettori-dev
left a comment
There was a problem hiding this comment.
Makes setup-vm.test.sh and build-snapshot.test.sh bash 3.2-clean and adds both to make test-deploy-bash32. Checked: the read loops keep mapfile's semantics, the subshell assignments don't leak PATH/SH_CMD_HINT_DIRS (and require_cmds reads the latter as a shell var, so SC2034 is right), the Makefile's "two" bash-4 suites matches a scan of every test-deploy suite at this head, and build-snapshot.test.sh does run the script under test with PATH's bash. deploy-scripts-bash32 is green and now covers both suites. LGTM.
Assisted-By: Claude Code
webchang
added a commit
to webchang/moca
that referenced
this pull request
Nov 16, 2026
Brings rossoctl#815 (setup-vm and build-snapshot tests on macOS's bash 3.2; both join test-deploy-bash32). No conflicts. Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Rong Chang <[email protected]>
10 tasks
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.
Closes #720.
Two deploy shell suites stopped under macOS's
/bin/bash3.2. The BSDsedpart of #720 was fixed earlier (#717's merge); this PR makes both suites 3.2-clean and adds them tomake test-deploy-bash32, which thedeploy-scripts-bash32CI job runs on macOS.deploy/vm/tests/setup-vm.test.shmapfile(bash 4) is replaced by read loops for the two arrays checked againstmain.ts.require_cmdscases ran asPATH=/nonexistent require_cmds …. With a prefix assignment to a function call, bash 3.2 keeps its command hash, socommand -vstill found a hashed command and the "missing tool" checks failed under 3.2. They now setPATHin a subshell (withshellcheck disable=SC2123on purpose).deploy/microvm/tests/build-snapshot.test.shscenario 1's comment,preflight's own) sat inside$( … ). bash 3.2 reads the apostrophe as an open quote, so the command substitution never closed:vfs_outwas unassigned at the first use and the rest of the file did not parse. The comments are reworded./bin/bash -nnow passes.Makefiletest-deploy-bash32lists both suites. Its comment no longer namessetup-vm.test.shas a bash-4 suite, and it says how each suite meets the interpreter (build-snapshot.test.shruns its own checks on/bin/bash;build-snapshot.sh, a Linux-only tool, runs withPATH's bash, and its tests pass with either).Tested on macOS: both suites under
/bin/bash3.2.57 and bash 5 (every check passes in both),make test-deploy-bash32(all six suites pass), shellcheck through pre-commit.Signed-off-by is on the commit (DCO).
Assisted-By: Claude Code