Skip to content

Commit b0922b9

Browse files
committed
Fix test expectations
1 parent a632d31 commit b0922b9

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

exporter/replset_status_collector_test.go

+8-8
Original file line numberDiff line numberDiff line change
@@ -41,19 +41,19 @@ func TestReplsetStatusCollector(t *testing.T) {
4141

4242
// The last \n at the end of this string is important
4343
expected := strings.NewReader(`
44-
# HELP mongodb_myState myState
45-
# TYPE mongodb_myState untyped
46-
mongodb_myState 1
47-
# HELP mongodb_ok ok
48-
# TYPE mongodb_ok untyped
49-
mongodb_ok 1` + "\n")
44+
# HELP mongodb_rs_myState replicaSetGetStatus.
45+
# TYPE mongodb_rs_myState untyped
46+
mongodb_rs_myState 1
47+
# HELP mongodb_rs_ok replicaSetGetStatus.
48+
# TYPE mongodb_rs_ok untyped
49+
mongodb_rs_ok 1` + "\n")
5050
// Filter metrics for 2 reasons:
5151
// 1. The result is huge
5252
// 2. We need to check against know values. Don't use metrics that return counters like uptime
5353
// or counters like the number of transactions because they won't return a known value to compare
5454
filter := []string{
55-
"mongodb_myState",
56-
"mongodb_ok",
55+
"mongodb_rs_myState",
56+
"mongodb_rs_ok",
5757
}
5858
err := testutil.CollectAndCompare(c, expected, filter...)
5959
assert.NoError(t, err)

exporter/serverstatus_collector_test.go

+8-8
Original file line numberDiff line numberDiff line change
@@ -41,19 +41,19 @@ func TestServerStatusDataCollector(t *testing.T) {
4141

4242
// The last \n at the end of this string is important
4343
expected := strings.NewReader(`
44-
# HELP mongodb_mem_bits mem.
45-
# TYPE mongodb_mem_bits untyped
46-
mongodb_mem_bits 64
47-
# HELP mongodb_metrics_commands_connPoolSync_failed metrics.commands.connPoolSync.
48-
# TYPE mongodb_metrics_commands_connPoolSync_failed untyped
49-
mongodb_metrics_commands_connPoolSync_failed 0` + "\n")
44+
# HELP mongodb_ss_mem_bits serverStatus.mem.
45+
# TYPE mongodb_ss_mem_bits untyped
46+
mongodb_ss_mem_bits 64
47+
# HELP mongodb_ss_metrics_commands_connPoolSync_failed serverStatus.metrics.commands.connPoolSync.
48+
# TYPE mongodb_ss_metrics_commands_connPoolSync_failed untyped
49+
mongodb_ss_metrics_commands_connPoolSync_failed 0` + "\n")
5050
// Filter metrics for 2 reasons:
5151
// 1. The result is huge
5252
// 2. We need to check against know values. Don't use metrics that return counters like uptime
5353
// or counters like the number of transactions because they won't return a known value to compare
5454
filter := []string{
55-
"mongodb_mem_bits",
56-
"mongodb_metrics_commands_connPoolSync_failed",
55+
"mongodb_ss_mem_bits",
56+
"mongodb_ss_metrics_commands_connPoolSync_failed",
5757
}
5858
err := testutil.CollectAndCompare(c, expected, filter...)
5959
assert.NoError(t, err)

0 commit comments

Comments
 (0)