isolateState redirects docker-agent's data and config directories to a temp dir for the duration of the test so the TUI's persistent state (tab store, user settings) never touches the real home directory.
(t *testing.T)
| 88 | // dir for the duration of the test so the TUI's persistent state (tab store, |
| 89 | // user settings) never touches the real home directory. |
| 90 | func isolateState(t *testing.T) { |
| 91 | t.Helper() |
| 92 | dir := t.TempDir() |
| 93 | paths.SetDataDir(filepath.Join(dir, "data")) |
| 94 | paths.SetConfigDir(filepath.Join(dir, "config")) |
| 95 | t.Cleanup(func() { |
| 96 | paths.SetDataDir("") |
| 97 | paths.SetConfigDir("") |
| 98 | }) |
| 99 | } |
| 100 | |
| 101 | // startReplayProxy starts a VCR proxy in replay-only mode against the cassette |
| 102 | // named after the current test, and returns a RuntimeConfig pointed at it. |
no test coverage detected