Skip to content

Commit

Permalink
fix list metric test
Browse files Browse the repository at this point in the history
Signed-off-by: Ben Ye <benye@amazon.com>
  • Loading branch information
yeya24 committed Apr 22, 2024
1 parent c331262 commit 6b9e595
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions cmd/promlinter/list_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,8 @@ func TestLabel(t *testing.T) {

metrics := promlinter.RunList(fs, findFiles([]string{"../../testdata/"}, fs), true)

if len(metrics) != 10 {
t.Fatal()
}

assert.Equal(t, []string{"namespace", "name"}, metrics[7].Labels())
assert.Equal(t, []string{"namespace", "name", "const-label1=value1", "const-label2=?"}, metrics[8].Labels())
assert.Equal(t, []string{"namespace", "name"}, metrics[9].Labels())
assert.Equal(t, 11, len(metrics))
assert.Equal(t, []string{"namespace", "name"}, metrics[8].Labels())
assert.Equal(t, []string{"namespace", "name", "const-label1=value1", "const-label2=?"}, metrics[9].Labels())
assert.Equal(t, []string{"namespace", "name"}, metrics[10].Labels())
}

0 comments on commit 6b9e595

Please sign in to comment.