Skip to content

Commit 2293150

Browse files
committed
fix golangci-lint
1 parent 7c12eab commit 2293150

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

percona/watcher/wal_test.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
package watcher
22

33
import (
4+
"context"
45
"testing"
56
"time"
67

78
"github.com/stretchr/testify/assert"
9+
"github.com/stretchr/testify/require"
810
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
911
"sigs.k8s.io/controller-runtime/pkg/client"
1012

@@ -284,6 +286,7 @@ func TestGetLatestBackup(t *testing.T) {
284286
},
285287
}
286288

289+
ctx := context.Background()
287290
for _, tt := range tests {
288291
t.Run(tt.name, func(t *testing.T) {
289292
client := testutils.BuildFakeClient(tt.backups...)
@@ -295,12 +298,12 @@ func TestGetLatestBackup(t *testing.T) {
295298
},
296299
}
297300

298-
latest, err := getLatestBackup(t.Context(), client, cluster)
301+
latest, err := getLatestBackup(ctx, client, cluster)
299302
if tt.expectedErr != nil {
300-
assert.EqualError(t, err, tt.expectedErr.Error())
303+
require.EqualError(t, err, tt.expectedErr.Error())
301304
assert.Nil(t, latest)
302305
} else {
303-
assert.NoError(t, err)
306+
require.NoError(t, err)
304307
assert.NotNil(t, latest)
305308
assert.Equal(t, latest.Name, tt.latestBackupName)
306309
}

0 commit comments

Comments
 (0)