@@ -21,12 +21,10 @@ import (
2121 "testing"
2222 "time"
2323
24+ "github.com/percona/mongodb_exporter/internal/tu"
2425 "github.com/prometheus/client_golang/prometheus/testutil"
2526 "github.com/sirupsen/logrus"
2627 "github.com/stretchr/testify/assert"
27- "github.com/stretchr/testify/require"
28-
29- "github.com/percona/mongodb_exporter/internal/tu"
3028)
3129
3230func TestReplsetStatusCollector (t * testing.T ) {
@@ -37,9 +35,7 @@ func TestReplsetStatusCollector(t *testing.T) {
3735
3836 ti := labelsGetterMock {}
3937
40- version , err := retrieveMongoDBBuildInfo (ctx , client , logrus .New ().WithField ("component" , "test" ))
41- require .NoError (t , err )
42- c := newReplicationSetStatusCollector (ctx , client , logrus .New (), false , ti , version )
38+ c := newReplicationSetStatusCollector (ctx , client , logrus .New (), false , ti )
4339
4440 // The last \n at the end of this string is important
4541 expected := strings .NewReader (`
@@ -57,7 +53,7 @@ func TestReplsetStatusCollector(t *testing.T) {
5753 "mongodb_myState" ,
5854 "mongodb_ok" ,
5955 }
60- err = testutil .CollectAndCompare (c , expected , filter ... )
56+ err : = testutil .CollectAndCompare (c , expected , filter ... )
6157 assert .NoError (t , err )
6258}
6359
@@ -69,10 +65,7 @@ func TestReplsetStatusCollectorNoSharding(t *testing.T) {
6965
7066 ti := labelsGetterMock {}
7167
72- version , err := retrieveMongoDBBuildInfo (ctx , client , logrus .New ().WithField ("component" , "test" ))
73- require .NoError (t , err )
74-
75- c := newReplicationSetStatusCollector (ctx , client , logrus .New (), false , ti , version )
68+ c := newReplicationSetStatusCollector (ctx , client , logrus .New (), false , ti )
7669
7770 // Replication set metrics should not be generated for unsharded server
7871 count := testutil .CollectAndCount (c )
0 commit comments