Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
SamMHD committed Feb 27, 2024
1 parent 9a52312 commit 35aedc9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/auth/metrics_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,18 +66,18 @@ func TestAddUpstreamAuthLabel(t *testing.T) {
}
func TestAddWithDownstreamDeadline(t *testing.T) {
// Test case 1: With downstream deadline
labels := AddWithDownstreamDeadline(nil, true)
labels := AddWithDownstreamDeadlineLabel(nil, true)
assert.NotNil(t, labels, "Labels should not be nil")
assert.Equal(t, "true", labels[WithDownstreamDeadlineLabel], "WithDownstreamDeadlineLabel should be true")

// Test case 2: Without downstream deadline
labels = AddWithDownstreamDeadline(nil, false)
labels = AddWithDownstreamDeadlineLabel(nil, false)
assert.NotNil(t, labels, "Labels should not be nil")
assert.Equal(t, "false", labels[WithDownstreamDeadlineLabel], "WithDownstreamDeadlineLabel should be false")

// Test case 3: Existing labels
existingLabels := prometheus.Labels{"existing": "label"}
labels = AddWithDownstreamDeadline(existingLabels, true)
labels = AddWithDownstreamDeadlineLabel(existingLabels, true)
assert.NotNil(t, labels, "Labels should not be nil")
assert.Equal(t, "true", labels[WithDownstreamDeadlineLabel], "WithDownstreamDeadlineLabel should be true")
assert.Equal(t, "label", labels["existing"], "Existing label should remain unchanged")
Expand Down

0 comments on commit 35aedc9

Please sign in to comment.