From 0df2e8dc78ee186db195eecc96cbdb75a150a71e Mon Sep 17 00:00:00 2001 From: Corey Ogburn Date: Fri, 9 Aug 2024 15:40:11 -0600 Subject: [PATCH] Only Test Ai Summaries in TestRefreshAiSummaries Because `showAiSummaries` defaults to true when the config value is missing, each of these tests was calling `RefreshAiSummaries` and thus setting `lastSuccessfulAiUpdate` and causing other tests to fail. --- server/modules/elastalert/elastalert_test.go | 2 ++ server/modules/strelka/strelka_test.go | 2 ++ server/modules/suricata/suricata_test.go | 2 ++ 3 files changed, 6 insertions(+) diff --git a/server/modules/elastalert/elastalert_test.go b/server/modules/elastalert/elastalert_test.go index 37e47c68..4f852609 100644 --- a/server/modules/elastalert/elastalert_test.go +++ b/server/modules/elastalert/elastalert_test.go @@ -83,6 +83,8 @@ func TestElastAlertModule(t *testing.T) { err := mod.Init(nil) assert.NoError(t, err) + mod.showAiSummaries = false + err = mod.Start() assert.NoError(t, err) diff --git a/server/modules/strelka/strelka_test.go b/server/modules/strelka/strelka_test.go index 9fcc1343..30668426 100644 --- a/server/modules/strelka/strelka_test.go +++ b/server/modules/strelka/strelka_test.go @@ -236,6 +236,8 @@ func TestStrelkaModule(t *testing.T) { err := mod.Init(nil) assert.NoError(t, err) + mod.showAiSummaries = false + err = mod.Start() assert.NoError(t, err) diff --git a/server/modules/suricata/suricata_test.go b/server/modules/suricata/suricata_test.go index 36d31ca5..f3136e89 100644 --- a/server/modules/suricata/suricata_test.go +++ b/server/modules/suricata/suricata_test.go @@ -64,6 +64,8 @@ func TestSuricataModule(t *testing.T) { err := mod.Init(nil) assert.NoError(t, err) + mod.showAiSummaries = false + err = mod.Start() assert.NoError(t, err)