fix: Add context.Background() to sqlite.New() calls in test files
Multiple test files were still using the old sqlite.New(path) signature instead of the new sqlite.New(ctx, path) signature. This was causing compilation failures in the test suite. Fixed files: - internal/importer/importer_test.go - internal/importer/external_ref_test.go - internal/importer/timestamp_test.go - internal/rpc/limits_test.go - internal/rpc/list_filters_test.go - internal/rpc/rpc_test.go - internal/rpc/status_test.go - internal/syncbranch/syncbranch_test.go
This commit is contained in:
@@ -30,7 +30,7 @@ func TestConnectionLimits(t *testing.T) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
store, err := sqlite.New(dbPath)
|
||||
store, err := sqlite.New(context.Background(), dbPath)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@@ -152,7 +152,7 @@ func TestRequestTimeout(t *testing.T) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
store, err := sqlite.New(dbPath)
|
||||
store, err := sqlite.New(context.Background(), dbPath)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@@ -208,7 +208,7 @@ func TestHealthResponseIncludesLimits(t *testing.T) {
|
||||
dbPath := filepath.Join(tmpDir, "test.db")
|
||||
socketPath := filepath.Join(tmpDir, "test.sock")
|
||||
|
||||
store, err := sqlite.New(dbPath)
|
||||
store, err := sqlite.New(context.Background(), dbPath)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ func setupTestServerWithStore(t *testing.T) (*Server, *Client, *sqlitestorage.SQ
|
||||
|
||||
os.Remove(socketPath)
|
||||
|
||||
store, err := sqlitestorage.New(dbPath)
|
||||
store, err := sqlitestorage.New(context.Background(), dbPath)
|
||||
if err != nil {
|
||||
os.RemoveAll(tmpDir)
|
||||
t.Fatalf("Failed to create store: %v", err)
|
||||
|
||||
@@ -37,7 +37,7 @@ func setupTestServer(t *testing.T) (*Server, *Client, func()) {
|
||||
// Ensure socket doesn't exist from previous failed test
|
||||
os.Remove(socketPath)
|
||||
|
||||
store, err := sqlitestorage.New(dbPath)
|
||||
store, err := sqlitestorage.New(context.Background(), dbPath)
|
||||
if err != nil {
|
||||
os.RemoveAll(tmpDir)
|
||||
t.Fatalf("Failed to create store: %v", err)
|
||||
@@ -354,7 +354,7 @@ func TestSocketCleanup(t *testing.T) {
|
||||
dbPath := filepath.Join(tmpDir, "test.db")
|
||||
socketPath := filepath.Join(tmpDir, "bd.sock")
|
||||
|
||||
store, err := sqlitestorage.New(dbPath)
|
||||
store, err := sqlitestorage.New(context.Background(), dbPath)
|
||||
if err != nil {
|
||||
t.Fatalf("Failed to create store: %v", err)
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ func TestStatusEndpoint(t *testing.T) {
|
||||
dbPath := filepath.Join(tmpDir, "test.db")
|
||||
socketPath := filepath.Join(tmpDir, "test.sock")
|
||||
|
||||
store, err := sqlite.New(dbPath)
|
||||
store, err := sqlite.New(context.Background(), dbPath)
|
||||
if err != nil {
|
||||
t.Fatalf("failed to create storage: %v", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user