Fix tests (bd-6ss and sub-issues) (#626)

Test coverage improvements for bd-6ss. Fixing failing test assumption in follow-up commit.
This commit is contained in:
matt wilkie
2025-12-18 19:23:30 -07:00
committed by GitHub
parent 7f9ee3d1c4
commit fb16e504e6
14 changed files with 1656 additions and 10 deletions

View File

@@ -17,14 +17,23 @@ func TestDaemonAutoStart(t *testing.T) {
// Save original env
origAutoStart := os.Getenv("BEADS_AUTO_START_DAEMON")
origNoDaemon := os.Getenv("BEADS_NO_DAEMON")
defer func() {
if origAutoStart != "" {
os.Setenv("BEADS_AUTO_START_DAEMON", origAutoStart)
} else {
os.Unsetenv("BEADS_AUTO_START_DAEMON")
}
if origNoDaemon != "" {
os.Setenv("BEADS_NO_DAEMON", origNoDaemon)
} else {
os.Unsetenv("BEADS_NO_DAEMON")
}
}()
// Ensure BEADS_NO_DAEMON doesn't interfere with these tests
os.Unsetenv("BEADS_NO_DAEMON")
t.Run("shouldAutoStartDaemon defaults to true", func(t *testing.T) {
os.Unsetenv("BEADS_AUTO_START_DAEMON")
if !shouldAutoStartDaemon() {