Skip to content

Commit

Permalink
Adjust tests to new prometheus client version
Browse files Browse the repository at this point in the history
  • Loading branch information
kuskoman committed Apr 13, 2023
1 parent ed501d5 commit c253d3b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion collectors/collector_manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ func TestDescribe(t *testing.T) {
cm.Describe(ch)

desc := <-ch
expectedDesc := "Desc{fqName: \"logstash_exporter_scrape_duration_seconds\", help: \"logstash_exporter: Duration of a scrape job.\", constLabels: {}, variableLabels: [collector result]}"
expectedDesc := "Desc{fqName: \"logstash_exporter_scrape_duration_seconds\", help: \"logstash_exporter: Duration of a scrape job.\", constLabels: {}, variableLabels: [{collector <nil>} {result <nil>}]}"
if desc.String() != expectedDesc {
t.Errorf("Expected metric description to be '%s', got %s", expectedDesc, desc.String())
}
Expand Down
4 changes: 2 additions & 2 deletions prometheus_helper/prometheus_helper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ func TestSimpleDescHelper(t *testing.T) {
})

t.Run("NewDescWithHelpAndLabel", func(t *testing.T) {
desc := helper.NewDescWithHelpAndLabel("metric", "help", "label")
expectedDesc := "Desc{fqName: \"logstash_exporter_test_metric\", help: \"help\", constLabels: {}, variableLabels: [label]}"
desc := helper.NewDescWithHelpAndLabel("metric", "help", "customLabel")
expectedDesc := "Desc{fqName: \"logstash_exporter_test_metric\", help: \"help\", constLabels: {}, variableLabels: [{customLabel <nil>}]}"
if desc.String() != expectedDesc {
t.Errorf("incorrect metric description, expected %s but got %s", expectedDesc, desc.String())
}
Expand Down

0 comments on commit c253d3b

Please sign in to comment.