Skip to content

Commit

Permalink
Remove RefreshAiSummaries
Browse files Browse the repository at this point in the history
Even SyncNoChanges tests should not try to RefreshAiSummaries.
  • Loading branch information
coreyogburn committed Aug 8, 2024
1 parent 03c8817 commit 0ec0f98
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 24 deletions.
9 changes: 1 addition & 8 deletions server/modules/elastalert/elastalert_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1108,18 +1108,11 @@ func TestSyncIncrementalNoChanges(t *testing.T) {
IsRunning: true,
},
IOManager: iom,
showAiSummaries: true,
aiRepoUrl: "aiRepoUrl",
aiRepoBranch: "aiRepoBranch",
aiRepoPath: "aiRepoPath",
showAiSummaries: false,
}

logger := log.WithField("detectionEngine", "test-elastalert")

// RefreshAiSummaries
iom.EXPECT().ReadDir("aiRepoPath").Return([]fs.DirEntry{}, nil)
iom.EXPECT().CloneRepo(gomock.Any(), "aiRepoPath/aiRepoUrl", "aiRepoUrl", util.Ptr("aiRepoBranch")).Return(nil)
iom.EXPECT().ReadFile("aiRepoPath/aiRepoUrl/detections-ai/sigma_summaries.yaml").Return([]byte("{}"), nil)
// checkSigmaPipelines
iom.EXPECT().ReadFile("sigmaPipelineFinal").Return([]byte("data"), nil)
iom.EXPECT().ReadFile("sigmaPipelineSO").Return([]byte("data"), nil)
Expand Down
9 changes: 1 addition & 8 deletions server/modules/strelka/strelka_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1015,18 +1015,11 @@ func TestSyncIncrementalNoChanges(t *testing.T) {
IsRunning: true,
},
IOManager: iom,
showAiSummaries: true,
aiRepoUrl: "aiRepoUrl",
aiRepoBranch: "aiRepoBranch",
aiRepoPath: "aiRepoPath",
showAiSummaries: false,
}

logger := log.WithField("detectionEngine", "test-strelka")

// RefreshAiSummaries
iom.EXPECT().ReadDir("aiRepoPath").Return([]fs.DirEntry{}, nil)
iom.EXPECT().CloneRepo(gomock.Any(), "aiRepoPath/aiRepoUrl", "aiRepoUrl", util.Ptr("aiRepoBranch")).Return(nil)
iom.EXPECT().ReadFile("aiRepoPath/aiRepoUrl/detections-ai/yara_summaries.yaml").Return([]byte("{}"), nil)
// UpdateRepos
iom.EXPECT().ReadDir("repos").Return([]fs.DirEntry{
&handmock.MockDirEntry{
Expand Down
9 changes: 1 addition & 8 deletions server/modules/suricata/suricata_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2185,18 +2185,11 @@ func TestSyncIncrementalNoChanges(t *testing.T) {
IsRunning: true,
},
IOManager: iom,
showAiSummaries: true,
aiRepoUrl: "aiRepoUrl",
aiRepoBranch: "aiRepoBranch",
aiRepoPath: "aiRepoPath",
showAiSummaries: false,
}

logger := log.WithField("detectionEngine", "test-suricata")

// RefreshAiSummaries
iom.EXPECT().ReadDir("aiRepoPath").Return([]fs.DirEntry{}, nil)
iom.EXPECT().CloneRepo(gomock.Any(), "aiRepoPath/aiRepoUrl", "aiRepoUrl", util.Ptr("aiRepoBranch")).Return(nil)
iom.EXPECT().ReadFile("aiRepoPath/aiRepoUrl/detections-ai/suricata_summaries.yaml").Return([]byte("{}"), nil)
// readAndHash
iom.EXPECT().ReadFile("communityRulesFile").Return([]byte(SimpleRule), nil)
// readFingerprint
Expand Down

0 comments on commit 0ec0f98

Please sign in to comment.