Skip to content

Commit 4168b9b

Browse files
committed
fix up linter
1 parent 433720a commit 4168b9b

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,4 +114,3 @@ test-cluster: env ## Starts MongoDB test cluster. Use env var TEST_MON
114114

115115
test-cluster-clean: env ## Stops MongoDB test cluster.
116116
docker compose down --remove-orphans --volumes
117-
rm -f ./docker/kerberos/cache/*

exporter/exporter_test.go

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ func TestMongoS(t *testing.T) {
199199
}
200200
}
201201

202-
func TestMongoWithGSSAPI(t *testing.T) {
202+
func TestGSSAPIAuth(t *testing.T) {
203203
logger := logrus.New()
204204
logger.SetReportCaller(true)
205205

@@ -241,7 +241,11 @@ func TestMongoWithGSSAPI(t *testing.T) {
241241

242242
username := "pmm-test%40PERCONATEST.COM"
243243
password := "password1"
244-
uri := fmt.Sprintf("mongodb://%s:%s@%s:27017/?authSource=$external&authMechanism=GSSAPI", username, password, mongoHost)
244+
uri := fmt.Sprintf("mongodb://%s:%s@%s/?authSource=$external&authMechanism=GSSAPI",
245+
username,
246+
password,
247+
net.JoinHostPort(mongoHost, "27017"),
248+
)
245249
exporterOpts := &Opts{
246250
URI: uri,
247251
Logger: logger,
@@ -258,10 +262,10 @@ func TestMongoWithGSSAPI(t *testing.T) {
258262
gc := newGeneralCollector(ctx, client, nodeType, e.opts.Logger)
259263
r := e.makeRegistry(ctx, client, new(labelsGetterMock), *e.opts)
260264

261-
expected := strings.NewReader(fmt.Sprintf(`
265+
expected := strings.NewReader(`
262266
# HELP mongodb_up Whether MongoDB is up.
263267
# TYPE mongodb_up gauge
264-
mongodb_up {cluster_role="mongod"} 1`) + "\n")
268+
mongodb_up {cluster_role="mongod"} 1` + "\n")
265269

266270
filter := []string{
267271
"mongodb_up",
@@ -270,7 +274,7 @@ func TestMongoWithGSSAPI(t *testing.T) {
270274
assert.NoError(t, err, "mongodb_up metric should be 1")
271275

272276
res := r.Unregister(gc)
273-
assert.Equal(t, true, res)
277+
assert.True(t, res)
274278
}
275279

276280
func TestMongoUpMetric(t *testing.T) {

0 commit comments

Comments
 (0)