Skip to content

test(orchestrate): run send-prompt.bats on a private tmux server, never the default socket (#312) - #316

Merged
choiyounggi merged 1 commit into
mainfrom
orch/issue-312
Oct 29, 2026
Merged

choiyounggi merged 1 commit into
mainfrom
orch/issue-312

Conversation

@choiyounggi

Copy link
Copy Markdown
Owner

Summary

tests/send-prompt.bats no longer starts or uses the default tmux server (#312).

  • setup() writes a per-test tmux wrapper first on PATH that adds -L sp-<pid>-<test#> to every call, so both this file's own tmux … lines and send-prompt.sh's command -v tmux reach a private server. -L wins over an inherited TMUX, so a run inside a tmux pane does not touch the pane's server either. The fake-tmux helpers still prepend their own bin and win.
  • teardown() kills only that private server and removes its socket file and the wrapper dir; bats runs it on failure too.
  • mk_session closes fd 3 for the server it may start, so bats does not wait on it.
  • Three new cases (tests: send-prompt.bats starts tmux on the default socket, so a run with LO_* exported can bake them into the server's global env (#302 class) #312 section) prove it against a stand-in for the ambient server: its sessions and show-environment -g stay unchanged, send-prompt.sh addresses the private server, and cleanup holds after a failing test.

Production code is unchanged.

Test plan

  • PATH=/opt/homebrew/bin:$PATH bats tests/ on 0aca143: 1..1738, 1738 ok, 0 not ok
  • tests/send-prompt.bats with TMUX pointed at a live stand-in server and LO_*/GROUNDWORK_* exported: 103 ok; 0 test sessions on the default or stand-in server across 204 samples; both servers' session lists and global env identical before/after; 0 leftover sockets or processes
  • Mutants: mk_session bypassing the wrapper turns both new normal cases red; a wrapper without -L turns the negative control red
  • The 100 existing cases keep their assertions; suite wall time +~46 s locally (CI main: 712 s ubuntu / 817 s macOS of the 1200 s limit)

Closes #312

🤖 Generated with Claude Code

https://claude.ai/code/session_01AANCMZc7YqHR1wmnMozoN6

…er the default socket (#312)

setup() puts a generated tmux wrapper first on PATH that adds -L sp-<pid>-<n>
to every call, so the file's own tmux lines and send-prompt.sh's
`command -v tmux` reach a per-test private server. teardown kills that server
and removes its socket. Three new cases prove the route (inside a pane, with no
default server) and the teardown, including that the server process dies.

Claude-Session: https://claude.ai/code/session_01AANCMYzYQXMX2Zb3NXn2kE
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@choiyounggi
choiyounggi merged commit bce5ec4 into main Oct 29, 2026
2 checks passed
@choiyounggi
choiyounggi deleted the orch/issue-312 branch October 29, 2026 08:53
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.

tests: send-prompt.bats starts tmux on the default socket, so a run with LO_* exported can bake them into the server's global env (#302 class)

1 participant