Fix CI failures (bd 1zo sandbox tests) (#1244)

* Fix sandboxed daemon autostart tests and lint cleanup (bd-1zo)

* Restore issues jsonl to main state (bd-1zo)

* Remove .beads changes from PR (bd-1zo)

* Fix Windows build for dolt SysProcAttr (bd-1zo)

* Reset .beads/issues.jsonl to upstream main (bd-1zo)

* Reset .beads/issues.jsonl to upstream main (bd-1zo)

* Reset .beads/issues.jsonl to upstream main (bd-1zo)

* Fix Windows password prompt fd type (bd-1zo)

* Reset .beads/issues.jsonl to upstream main (bd-1zo)

---------

Co-authored-by: Amp <amp@example.com>
Co-authored-by: beads/crew/darcy <steve.yegge@gmail.com>
This commit is contained in:
matt wilkie
2026-01-21 17:59:51 -07:00
committed by GitHub
parent 77423d367f
commit e74cab8c6d
2 changed files with 19 additions and 0 deletions

View File

@@ -3,12 +3,14 @@ package main
import (
"bytes"
"context"
"errors"
"io"
"os"
"os/exec"
"path/filepath"
"runtime"
"strings"
"syscall"
"testing"
"time"
@@ -37,6 +39,10 @@ func tempSockDir(t *testing.T) string {
func startTestRPCServer(t *testing.T) (socketPath string, cleanup func()) {
t.Helper()
if isSandboxed() {
t.Skip("sandboxed environment blocks unix socket operations")
}
tmpDir := tempSockDir(t)
beadsDir := filepath.Join(tmpDir, ".beads")
if err := os.MkdirAll(beadsDir, 0o750); err != nil {
@@ -52,6 +58,10 @@ func startTestRPCServer(t *testing.T) (socketPath string, cleanup func()) {
server, _, err := startRPCServer(ctx, socketPath, store, tmpDir, db, log)
if err != nil {
if errors.Is(err, syscall.EPERM) || errors.Is(err, syscall.EACCES) || os.IsPermission(err) {
cancel()
t.Skipf("unix sockets not permitted in this environment: %v", err)
}
cancel()
t.Fatalf("startRPCServer: %v", err)
}

View File

@@ -313,11 +313,18 @@ func TestHasClaudeHooksProjectLevel(t *testing.T) {
}
}`
setTempHome := func(t *testing.T, dir string) {
t.Helper()
t.Setenv("HOME", dir)
t.Setenv("USERPROFILE", dir)
}
// Test that hooks are detected in each project-level settings file
for _, filename := range []string{"settings.json", "settings.local.json"} {
t.Run(filename, func(t *testing.T) {
tmpDir := t.TempDir()
t.Chdir(tmpDir)
setTempHome(t, t.TempDir())
if err := os.MkdirAll(".claude", 0o755); err != nil {
t.Fatal(err)
@@ -336,6 +343,7 @@ func TestHasClaudeHooksProjectLevel(t *testing.T) {
t.Run("no hooks section", func(t *testing.T) {
tmpDir := t.TempDir()
t.Chdir(tmpDir)
setTempHome(t, t.TempDir())
if err := os.MkdirAll(".claude", 0o755); err != nil {
t.Fatal(err)
@@ -353,6 +361,7 @@ func TestHasClaudeHooksProjectLevel(t *testing.T) {
t.Run("hooks but not bd prime", func(t *testing.T) {
tmpDir := t.TempDir()
t.Chdir(tmpDir)
setTempHome(t, t.TempDir())
if err := os.MkdirAll(".claude", 0o755); err != nil {
t.Fatal(err)