From 4d75d35f4c73645e8cbeadb082eb9951c46d6960 Mon Sep 17 00:00:00 2001 From: Oleksandr Saulyak Date: Tue, 17 Dec 2024 13:29:37 +0200 Subject: [PATCH] event-reporter: fixed unit tests (#360) --- event_reporter/reporter/app_revision_test.go | 3 +++ event_reporter/reporter/application_event_reporter_test.go | 1 + event_reporter/reporter/event_payload_test.go | 6 +++--- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/event_reporter/reporter/app_revision_test.go b/event_reporter/reporter/app_revision_test.go index 3dfc78127813b..3f27de3c4533e 100644 --- a/event_reporter/reporter/app_revision_test.go +++ b/event_reporter/reporter/app_revision_test.go @@ -55,6 +55,7 @@ func TestGetRevisionsDetails(t *testing.T) { appServiceClient, &metrics.MetricsServer{}, fakeArgoDb(), + "0.0.1", } result, _ := reporter.getRevisionsDetails(context.Background(), &app, []string{expectedRevision}) @@ -120,6 +121,7 @@ func TestGetRevisionsDetails(t *testing.T) { appServiceClient, &metrics.MetricsServer{}, fakeArgoDb(), + "0.0.1", } result, _ := reporter.getRevisionsDetails(context.Background(), &app, []string{expectedRevision1, expectedRevision2}) @@ -162,6 +164,7 @@ func TestGetRevisionsDetails(t *testing.T) { appServiceClient, &metrics.MetricsServer{}, fakeArgoDb(), + "0.0.1", } result, _ := reporter.getRevisionsDetails(context.Background(), &app, []string{expectedRevision}) diff --git a/event_reporter/reporter/application_event_reporter_test.go b/event_reporter/reporter/application_event_reporter_test.go index 650b455094492..ebf1db15b720e 100644 --- a/event_reporter/reporter/application_event_reporter_test.go +++ b/event_reporter/reporter/application_event_reporter_test.go @@ -172,6 +172,7 @@ func fakeReporter(customAppServiceClient appclient.ApplicationClient) *applicati customAppServiceClient, metricsServ, fakeArgoDb(), + "0.0.1", } } diff --git a/event_reporter/reporter/event_payload_test.go b/event_reporter/reporter/event_payload_test.go index b0cf4c9afe916..87e22e7a2cb36 100644 --- a/event_reporter/reporter/event_payload_test.go +++ b/event_reporter/reporter/event_payload_test.go @@ -68,7 +68,7 @@ func TestGetResourceEventPayload(t *testing.T) { app: &app, appTree: &appTree, revisionsMetadata: &revisionMetadata, - }, getMockedArgoTrackingMetadata()) + }, getMockedArgoTrackingMetadata(), "0.0.1") require.NoError(t, err) var eventPayload events.EventPayload @@ -110,7 +110,7 @@ func TestGetResourceEventPayload(t *testing.T) { app: &app, appTree: &appTree, revisionsMetadata: &revisionMetadata, - }, getMockedArgoTrackingMetadata()) + }, getMockedArgoTrackingMetadata(), "0.0.1") require.NoError(t, err) var eventPayload events.EventPayload @@ -146,6 +146,6 @@ func TestGetResourceEventPayloadWithoutRevision(t *testing.T) { }, &ReportedEntityParentApp{ app: &app, appTree: &appTree, - }, getMockedArgoTrackingMetadata()) + }, getMockedArgoTrackingMetadata(), "0.0.1") assert.NoError(t, err) }