Skip to content

Commit d196752

Browse files
tae2089claude
andcommitted
fix: add error handling for db.Create calls in NoSymbolsWithoutIntent test
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 5dfa5fb commit d196752

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

internal/ragindex/builder_test.go

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -485,11 +485,17 @@ func TestBuilder_NoSymbolsWithoutIntent(t *testing.T) {
485485
tmpDir := t.TempDir()
486486

487487
comm := model.Community{Key: "core", Label: "Core"}
488-
db.Create(&comm)
488+
if err := db.Create(&comm).Error; err != nil {
489+
t.Fatalf("create community: %v", err)
490+
}
489491
node := model.Node{QualifiedName: "core/utils.go/helper", Kind: model.NodeKindFunction, Name: "helper",
490492
FilePath: "core/utils.go", StartLine: 1, EndLine: 5, Language: "go"}
491-
db.Create(&node)
492-
db.Create(&model.CommunityMembership{CommunityID: comm.ID, NodeID: node.ID})
493+
if err := db.Create(&node).Error; err != nil {
494+
t.Fatalf("create node: %v", err)
495+
}
496+
if err := db.Create(&model.CommunityMembership{CommunityID: comm.ID, NodeID: node.ID}).Error; err != nil {
497+
t.Fatalf("create membership: %v", err)
498+
}
493499
// annotation 없음 → @intent 없음
494500

495501
b := &ragindex.Builder{DB: db, OutDir: filepath.Join(tmpDir, "docs"), IndexDir: tmpDir}

0 commit comments

Comments
 (0)