From b0c08e9bad173da953cd657f8074e58a121dcce3 Mon Sep 17 00:00:00 2001 From: Carmine Di Monaco Date: Fri, 23 Sep 2022 16:29:54 +0200 Subject: [PATCH] Fix integration tests --- integration_test/factsengine_integration_test.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/integration_test/factsengine_integration_test.go b/integration_test/factsengine_integration_test.go index 431cc8ca..0725c07b 100644 --- a/integration_test/factsengine_integration_test.go +++ b/integration_test/factsengine_integration_test.go @@ -14,6 +14,7 @@ import ( "github.com/trento-project/agent/internal/factsengine" "github.com/trento-project/agent/internal/factsengine/adapters" "github.com/trento-project/agent/internal/factsengine/entities" + "github.com/trento-project/agent/internal/factsengine/gatherers" "github.com/trento-project/contracts/pkg/events" ) @@ -80,8 +81,12 @@ func (s *FactsEngineIntegrationTestGatherer) Gather(requests []entities.FactRequ func (suite *FactsEngineIntegrationTestSuite) TestFactsEngineIntegration() { agentID := "some-agent" - engine := factsengine.NewFactsEngine(agentID, suite.factsEngineService) - engine.AddGatherer("integration", NewFactsEngineIntegrationTestGatherer()) + gathererManager := gatherers.NewManager(map[string]gatherers.FactGatherer{ + gatherers.CorosyncFactKey: gatherers.NewDefaultCorosyncConfGatherer(), + "integration": NewFactsEngineIntegrationTestGatherer(), + }) + + engine := factsengine.NewFactsEngine(agentID, suite.factsEngineService, *gathererManager) err := engine.Subscribe() if err != nil {