Skip to content

Commit

Permalink
event-reporter: fixed unit tests (#360)
Browse files Browse the repository at this point in the history
  • Loading branch information
oleksandr-codefresh authored Dec 17, 2024
1 parent 3bd2b8c commit 4d75d35
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
3 changes: 3 additions & 0 deletions event_reporter/reporter/app_revision_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ func TestGetRevisionsDetails(t *testing.T) {
appServiceClient,
&metrics.MetricsServer{},
fakeArgoDb(),
"0.0.1",
}

result, _ := reporter.getRevisionsDetails(context.Background(), &app, []string{expectedRevision})
Expand Down Expand Up @@ -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})
Expand Down Expand Up @@ -162,6 +164,7 @@ func TestGetRevisionsDetails(t *testing.T) {
appServiceClient,
&metrics.MetricsServer{},
fakeArgoDb(),
"0.0.1",
}

result, _ := reporter.getRevisionsDetails(context.Background(), &app, []string{expectedRevision})
Expand Down
1 change: 1 addition & 0 deletions event_reporter/reporter/application_event_reporter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ func fakeReporter(customAppServiceClient appclient.ApplicationClient) *applicati
customAppServiceClient,
metricsServ,
fakeArgoDb(),
"0.0.1",
}
}

Expand Down
6 changes: 3 additions & 3 deletions event_reporter/reporter/event_payload_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -146,6 +146,6 @@ func TestGetResourceEventPayloadWithoutRevision(t *testing.T) {
}, &ReportedEntityParentApp{
app: &app,
appTree: &appTree,
}, getMockedArgoTrackingMetadata())
}, getMockedArgoTrackingMetadata(), "0.0.1")
assert.NoError(t, err)
}

0 comments on commit 4d75d35

Please sign in to comment.