Skip to content

fix: make detect_editor_cli no-editor case deterministic - #203

Merged
gerchowl merged 2 commits into
feature/70-remote-devc-orchestrationfrom
bugfix/202-deterministic-detect-editor-cli-test
Feb 25, 2026
Merged

gerchowl merged 2 commits into
feature/70-remote-devc-orchestrationfrom
bugfix/202-deterministic-detect-editor-cli-test

Conversation

@c-vigo

@c-vigo c-vigo commented Feb 25, 2026

Copy link
Copy Markdown
Contributor

Description

Make the detect_editor_cli negative-path BATS test deterministic across host environments where /usr/bin/code may be present.

Type of Change

  • feat -- New feature
  • fix -- Bug fix
  • docs -- Documentation only
  • chore -- Maintenance task (deps, config, etc.)
  • refactor -- Code restructuring (no behavior change)
  • test -- Adding or updating tests
  • ci -- CI/CD pipeline changes
  • build -- Build system or dependency changes
  • revert -- Reverts a previous commit
  • style -- Code style (formatting, whitespace)

Modifiers

  • Breaking change (!) -- This change breaks backward compatibility

Changes Made

  • tests/bats/devc-remote.bats
    • Replace PATH="/usr/bin:/bin" assumption with a temp empty PATH directory.
    • Execute via /bin/bash "$DEVC_REMOTE" under env -i to avoid shebang/PATH lookup side effects.
    • Clean up temporary directory at test end.

Changelog Entry

No changelog needed: this is an internal test determinism fix with no user-facing behavior change.

Testing

  • Tests pass locally (just test)
  • Manual testing performed (describe below)

Manual Testing Details

N/A

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have updated the documentation accordingly (edit docs/templates/, then run just docs)
  • I have updated CHANGELOG.md in the [Unreleased] section (and pasted the entry above)
  • My changes generate no new warnings or errors
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published

Additional Notes

Validated with:

  • npx bats tests/bats/devc-remote.bats -f "detect_editor_cli fails when neither cursor nor code in PATH"
  • npx bats tests/bats/devc-remote.bats

Refs: #202

@c-vigo c-vigo self-assigned this Feb 25, 2026
@c-vigo
c-vigo requested a review from gerchowl February 25, 2026 12:05
@c-vigo

c-vigo commented Feb 25, 2026

Copy link
Copy Markdown
Contributor Author

@gerchowl verify the tests still pass for you, if so you can merge and close issue #202

@c-vigo c-vigo removed their assignment Feb 25, 2026
@c-vigo c-vigo closed this Feb 25, 2026
@c-vigo
c-vigo deleted the bugfix/202-deterministic-detect-editor-cli-test branch February 25, 2026 12:08
@c-vigo
c-vigo restored the bugfix/202-deterministic-detect-editor-cli-test branch February 25, 2026 12:10
@c-vigo c-vigo reopened this Feb 25, 2026
@c-vigo c-vigo linked an issue Feb 25, 2026 that may be closed by this pull request
4 tasks
@c-vigo c-vigo linked an issue Feb 25, 2026 that may be closed by this pull request
4 tasks
…tion' into bugfix/202-deterministic-detect-editor-cli-test
@gerchowl
gerchowl merged commit a253baf into feature/70-remote-devc-orchestration Feb 25, 2026
1 check passed
@gerchowl
gerchowl deleted the bugfix/202-deterministic-detect-editor-cli-test branch February 25, 2026 17:47
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.

[BUG] BATS detect_editor_cli 'neither cursor nor code' test is host-dependent

2 participants