Fix test compilation errors: add context.Background() to sqlite.New() calls
Updated all test files to pass context.Background() as the first parameter to sqlite.New() calls to match the updated function signature. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -142,7 +142,7 @@ func TestMultiRepoEndToEnd(t *testing.T) {
|
|||||||
|
|
||||||
// Initialize database
|
// Initialize database
|
||||||
dbPath := filepath.Join(beadsDir, "beads.db")
|
dbPath := filepath.Join(beadsDir, "beads.db")
|
||||||
store, err := sqlite.New(dbPath)
|
store, err := sqlite.New(context.Background(), dbPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("failed to create storage: %v", err)
|
t.Fatalf("failed to create storage: %v", err)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ func setupTestStorage(t *testing.T) *sqlite.SQLiteStorage {
|
|||||||
t.Helper()
|
t.Helper()
|
||||||
|
|
||||||
tmpDB := t.TempDir() + "/test.db"
|
tmpDB := t.TempDir() + "/test.db"
|
||||||
store, err := sqlite.New(tmpDB)
|
store, err := sqlite.New(context.Background(), tmpDB)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("failed to create storage: %v", err)
|
t.Fatalf("failed to create storage: %v", err)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ func TestDiscoverDaemon(t *testing.T) {
|
|||||||
// Start daemon
|
// Start daemon
|
||||||
dbPath := filepath.Join(workspace, "test.db")
|
dbPath := filepath.Join(workspace, "test.db")
|
||||||
socketPath := filepath.Join(workspace, "bd.sock")
|
socketPath := filepath.Join(workspace, "bd.sock")
|
||||||
store, err := sqlite.New(dbPath)
|
store, err := sqlite.New(context.Background(), dbPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("failed to create storage: %v", err)
|
t.Fatalf("failed to create storage: %v", err)
|
||||||
}
|
}
|
||||||
@@ -59,7 +59,7 @@ func TestFindDaemonByWorkspace(t *testing.T) {
|
|||||||
// Start daemon
|
// Start daemon
|
||||||
dbPath := filepath.Join(workspace, "test.db")
|
dbPath := filepath.Join(workspace, "test.db")
|
||||||
socketPath := filepath.Join(workspace, "bd.sock")
|
socketPath := filepath.Join(workspace, "bd.sock")
|
||||||
store, err := sqlite.New(dbPath)
|
store, err := sqlite.New(context.Background(), dbPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("failed to create storage: %v", err)
|
t.Fatalf("failed to create storage: %v", err)
|
||||||
}
|
}
|
||||||
@@ -232,7 +232,7 @@ func TestDiscoverDaemons_Legacy(t *testing.T) {
|
|||||||
// Start a test daemon
|
// Start a test daemon
|
||||||
dbPath := filepath.Join(beadsDir, "test.db")
|
dbPath := filepath.Join(beadsDir, "test.db")
|
||||||
socketPath := filepath.Join(beadsDir, "bd.sock")
|
socketPath := filepath.Join(beadsDir, "bd.sock")
|
||||||
store, err := sqlite.New(dbPath)
|
store, err := sqlite.New(context.Background(), dbPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("failed to create storage: %v", err)
|
t.Fatalf("failed to create storage: %v", err)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ import (
|
|||||||
// TestConcurrentExternalRefUpdates tests concurrent updates to same external_ref with different timestamps
|
// TestConcurrentExternalRefUpdates tests concurrent updates to same external_ref with different timestamps
|
||||||
// This is a slow integration test that verifies no deadlocks occur
|
// This is a slow integration test that verifies no deadlocks occur
|
||||||
func TestConcurrentExternalRefUpdates(t *testing.T) {
|
func TestConcurrentExternalRefUpdates(t *testing.T) {
|
||||||
store, err := sqlite.New(":memory:")
|
store, err := sqlite.New(context.Background(), ":memory:")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("Failed to create store: %v", err)
|
t.Fatalf("Failed to create store: %v", err)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ func BenchmarkDirectCreate(b *testing.B) {
|
|||||||
defer os.RemoveAll(tmpDir)
|
defer os.RemoveAll(tmpDir)
|
||||||
|
|
||||||
dbPath := filepath.Join(tmpDir, "test.db")
|
dbPath := filepath.Join(tmpDir, "test.db")
|
||||||
store, err := sqlitestorage.New(dbPath)
|
store, err := sqlitestorage.New(context.Background(), dbPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
b.Fatalf("Failed to create store: %v", err)
|
b.Fatalf("Failed to create store: %v", err)
|
||||||
}
|
}
|
||||||
@@ -75,7 +75,7 @@ func BenchmarkDirectUpdate(b *testing.B) {
|
|||||||
defer os.RemoveAll(tmpDir)
|
defer os.RemoveAll(tmpDir)
|
||||||
|
|
||||||
dbPath := filepath.Join(tmpDir, "test.db")
|
dbPath := filepath.Join(tmpDir, "test.db")
|
||||||
store, err := sqlitestorage.New(dbPath)
|
store, err := sqlitestorage.New(context.Background(), dbPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
b.Fatalf("Failed to create store: %v", err)
|
b.Fatalf("Failed to create store: %v", err)
|
||||||
}
|
}
|
||||||
@@ -149,7 +149,7 @@ func BenchmarkDirectList(b *testing.B) {
|
|||||||
defer os.RemoveAll(tmpDir)
|
defer os.RemoveAll(tmpDir)
|
||||||
|
|
||||||
dbPath := filepath.Join(tmpDir, "test.db")
|
dbPath := filepath.Join(tmpDir, "test.db")
|
||||||
store, err := sqlitestorage.New(dbPath)
|
store, err := sqlitestorage.New(context.Background(), dbPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
b.Fatalf("Failed to create store: %v", err)
|
b.Fatalf("Failed to create store: %v", err)
|
||||||
}
|
}
|
||||||
@@ -279,7 +279,7 @@ func setupBenchServer(b *testing.B) (*Server, *Client, func(), string) {
|
|||||||
dbPath := filepath.Join(beadsDir, "test.db")
|
dbPath := filepath.Join(beadsDir, "test.db")
|
||||||
socketPath := filepath.Join(beadsDir, "bd.sock")
|
socketPath := filepath.Join(beadsDir, "bd.sock")
|
||||||
|
|
||||||
store, err := sqlitestorage.New(dbPath)
|
store, err := sqlitestorage.New(context.Background(), dbPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
os.RemoveAll(tmpDir)
|
os.RemoveAll(tmpDir)
|
||||||
b.Fatalf("Failed to create store: %v", err)
|
b.Fatalf("Failed to create store: %v", err)
|
||||||
|
|||||||
@@ -180,7 +180,7 @@ func TestHealthCheckIncludesVersionInfo(t *testing.T) {
|
|||||||
tmpDir, _, dbPath, socketPath, cleanup := setupTestServerIsolated(t)
|
tmpDir, _, dbPath, socketPath, cleanup := setupTestServerIsolated(t)
|
||||||
defer cleanup()
|
defer cleanup()
|
||||||
|
|
||||||
store, err := sqlitestorage.New(dbPath)
|
store, err := sqlitestorage.New(context.Background(), dbPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("Failed to create store: %v", err)
|
t.Fatalf("Failed to create store: %v", err)
|
||||||
}
|
}
|
||||||
@@ -244,7 +244,7 @@ func TestIncompatibleVersionInHealth(t *testing.T) {
|
|||||||
tmpDir, _, dbPath, socketPath, cleanup := setupTestServerIsolated(t)
|
tmpDir, _, dbPath, socketPath, cleanup := setupTestServerIsolated(t)
|
||||||
defer cleanup()
|
defer cleanup()
|
||||||
|
|
||||||
store, err := sqlitestorage.New(dbPath)
|
store, err := sqlitestorage.New(context.Background(), dbPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("Failed to create store: %v", err)
|
t.Fatalf("Failed to create store: %v", err)
|
||||||
}
|
}
|
||||||
@@ -364,7 +364,7 @@ func TestPingAndHealthBypassVersionCheck(t *testing.T) {
|
|||||||
tmpDir, _, dbPath, socketPath, cleanup := setupTestServerIsolated(t)
|
tmpDir, _, dbPath, socketPath, cleanup := setupTestServerIsolated(t)
|
||||||
defer cleanup()
|
defer cleanup()
|
||||||
|
|
||||||
store, err := sqlitestorage.New(dbPath)
|
store, err := sqlitestorage.New(context.Background(), dbPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("Failed to create store: %v", err)
|
t.Fatalf("Failed to create store: %v", err)
|
||||||
}
|
}
|
||||||
@@ -439,7 +439,7 @@ func TestMetricsOperation(t *testing.T) {
|
|||||||
tmpDir, _, dbPath, socketPath, cleanup := setupTestServerIsolated(t)
|
tmpDir, _, dbPath, socketPath, cleanup := setupTestServerIsolated(t)
|
||||||
defer cleanup()
|
defer cleanup()
|
||||||
|
|
||||||
store, err := sqlitestorage.New(dbPath)
|
store, err := sqlitestorage.New(context.Background(), dbPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("Failed to create store: %v", err)
|
t.Fatalf("Failed to create store: %v", err)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import (
|
|||||||
|
|
||||||
func TestLargeSQLite(t *testing.T) {
|
func TestLargeSQLite(t *testing.T) {
|
||||||
tmpDB := t.TempDir() + "/test.db"
|
tmpDB := t.TempDir() + "/test.db"
|
||||||
store, err := sqlite.New(tmpDB)
|
store, err := sqlite.New(context.Background(), tmpDB)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("Failed to create storage: %v", err)
|
t.Fatalf("Failed to create storage: %v", err)
|
||||||
}
|
}
|
||||||
@@ -66,7 +66,7 @@ func TestXLargeSQLite(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
tmpDB := t.TempDir() + "/test.db"
|
tmpDB := t.TempDir() + "/test.db"
|
||||||
store, err := sqlite.New(tmpDB)
|
store, err := sqlite.New(context.Background(), tmpDB)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("Failed to create storage: %v", err)
|
t.Fatalf("Failed to create storage: %v", err)
|
||||||
}
|
}
|
||||||
@@ -100,7 +100,7 @@ func TestLargeFromJSONL(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
tmpDB := t.TempDir() + "/test.db"
|
tmpDB := t.TempDir() + "/test.db"
|
||||||
store, err := sqlite.New(tmpDB)
|
store, err := sqlite.New(context.Background(), tmpDB)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("Failed to create storage: %v", err)
|
t.Fatalf("Failed to create storage: %v", err)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user