Skip to content

Commit

Permalink
test: added metrics to the tests
Browse files Browse the repository at this point in the history
  • Loading branch information
puffitos committed Dec 23, 2024
1 parent 15f3dad commit 0c7eb4a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/sparrow/targets/manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ func Test_gitlabTargetManager_refreshTargets(t *testing.T) {
interactor: remote,
name: "test",
cfg: General{UnhealthyThreshold: time.Hour, Scheme: "https"},
metrics: newMetrics(),
}
if err := gtm.refreshTargets(context.Background()); (err != nil) != (tt.wantErr != nil) {
t.Fatalf("refreshTargets() error = %v, wantErr %v", err, tt.wantErr)
Expand Down Expand Up @@ -193,6 +194,7 @@ func Test_gitlabTargetManager_refreshTargets_No_Threshold(t *testing.T) {
interactor: remote,
name: "test",
cfg: General{UnhealthyThreshold: 0, Scheme: "https"},
metrics: newMetrics(),
}
if err := gtm.refreshTargets(context.Background()); (err != nil) != (tt.wantErr != nil) {
t.Fatalf("refreshTargets() error = %v, wantErr %v", err, tt.wantErr)
Expand Down Expand Up @@ -304,6 +306,7 @@ func Test_gitlabTargetManager_register(t *testing.T) {
}
gtm := &manager{
interactor: glmock,
metrics: newMetrics(),
}
if err := gtm.register(context.Background()); (err != nil) != tt.wantErr {
t.Fatalf("register() error = %v, wantErr %v", err, tt.wantErr)
Expand Down Expand Up @@ -830,6 +833,7 @@ func mockGitlabTargetManager(g *remotemock.MockClient, name string) *manager { /
done: make(chan struct{}, 1),
interactor: g,
name: name,
metrics: newMetrics(),
cfg: General{
CheckInterval: 100 * time.Millisecond,
UnhealthyThreshold: 1 * time.Second,
Expand Down

0 comments on commit 0c7eb4a

Please sign in to comment.