tmuxtest

package
v0.3.30 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 11, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package tmuxtest keeps tests off the live tmux server.

Pointing TMUX_TMPDIR at a scratch directory is not enough on its own: when $TMUX is set, tmux talks to that socket and ignores TMUX_TMPDIR. Every TaskYou agent runs inside tmux, so a test that only moved TMUX_TMPDIR created its sessions on the live server when an agent ran the suite, and a cleanup that ran "kill-server" took down every agent on the machine. Both variables have to go, which is what this package does.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Isolate

func Isolate(t testing.TB)

Isolate gives one test its own tmux server, torn down when the test ends. The test's own tmux calls and those of the code under test (plain exec.Command, inheriting the environment) all land on it.

func Main

func Main(m *testing.M) int

Main runs a package's tests against a throwaway tmux server, so no test in it can reach the live one even if it forgets to call Isolate. Use it as

func TestMain(m *testing.M) { os.Exit(tmuxtest.Main(m)) }

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL