Description
The BATS test for detect_editor_cli assumes PATH=\"/usr/bin:/bin\" contains neither cursor nor code, but on some hosts /usr/bin/code exists. This makes the test fail for environment reasons rather than script logic.
Steps to Reproduce
- Check out branch
feature/70-remote-devc-orchestration.
- Run
just build no_cache.
- Run
just check.
- Observe failure in
tests/bats/devc-remote.bats for:
detect_editor_cli fails when neither cursor nor code in PATH
Expected Behavior
The test should deterministically validate the "neither editor CLI found" path, independent of host-installed binaries.
Actual Behavior
On environments where code exists in /usr/bin, detect_editor_cli selects code and execution proceeds to SSH checks. The assertion expecting Neither cursor nor code fails.
Environment
- OS: Linux 6.17.0-14-generic
- Container Runtime: N/A (failure occurs before remote runtime checks)
- Image Version/Tag: N/A
- Architecture: AMD64
Additional Context
Observed output snippet:
ℹ Detecting local editor CLI...
✓ Using code
ℹ Checking SSH connectivity to myserver...
✗ Cannot connect to myserver. Check your SSH config and network.
Likely fix: isolate PATH in the test with an empty temp directory and invoke /bin/bash "$DEVC_REMOTE" under env -i to keep shebang behavior deterministic.
Related:
Possible Solution
Update the failing test setup to avoid /usr/bin:/bin assumptions and use a controlled PATH with no cursor/code binaries.
Changelog Category
Fixed
Acceptance Criteria
Description
The BATS test for
detect_editor_cliassumesPATH=\"/usr/bin:/bin\"contains neithercursornorcode, but on some hosts/usr/bin/codeexists. This makes the test fail for environment reasons rather than script logic.Steps to Reproduce
feature/70-remote-devc-orchestration.just build no_cache.just check.tests/bats/devc-remote.batsfor:detect_editor_cli fails when neither cursor nor code in PATHExpected Behavior
The test should deterministically validate the "neither editor CLI found" path, independent of host-installed binaries.
Actual Behavior
On environments where
codeexists in/usr/bin,detect_editor_cliselectscodeand execution proceeds to SSH checks. The assertion expectingNeither cursor nor codefails.Environment
Additional Context
Observed output snippet:
ℹ Detecting local editor CLI...✓ Using codeℹ Checking SSH connectivity to myserver...✗ Cannot connect to myserver. Check your SSH config and network.Likely fix: isolate PATH in the test with an empty temp directory and invoke
/bin/bash "$DEVC_REMOTE"underenv -ito keep shebang behavior deterministic.Related:
Possible Solution
Update the failing test setup to avoid
/usr/bin:/binassumptions and use a controlled PATH with nocursor/codebinaries.Changelog Category
Fixed
Acceptance Criteria
/usr/bin/codetests/bats/devc-remote.batspasses locally and in CI