Skip to content

Commit c46516e

Browse files
fix linter
1 parent 81dc1a0 commit c46516e

File tree

3 files changed

+15
-10
lines changed

3 files changed

+15
-10
lines changed

pkg/postgres/tables_test.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
package postgres
22

33
import (
4+
"context"
5+
"testing"
6+
47
"github.com/conductorone/baton-postgresql/pkg/testutil"
58
"github.com/stretchr/testify/assert"
6-
"testing"
79
)
810

911
func TestTableGrantRevoke(t *testing.T) {
10-
ctx := t.Context()
12+
ctx := context.Background()
1113

12-
container := testutil.SetupPostgresContainer(t)
14+
container := testutil.SetupPostgresContainer(ctx, t)
1315

1416
client, err := New(ctx, container.Dsn())
1517
assert.NoError(t, err)

pkg/postgres/views_test.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
package postgres
22

33
import (
4+
"context"
5+
"testing"
6+
47
"github.com/conductorone/baton-postgresql/pkg/testutil"
58
"github.com/stretchr/testify/assert"
6-
"testing"
79
)
810

911
func TestViewGrantRevoke(t *testing.T) {
10-
ctx := t.Context()
12+
ctx := context.Background()
1113

12-
container := testutil.SetupPostgresContainer(t)
14+
container := testutil.SetupPostgresContainer(ctx, t)
1315

1416
client, err := New(ctx, container.Dsn())
1517
assert.NoError(t, err)

pkg/testutil/container.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@ package testutil
33
import (
44
"context"
55
_ "embed"
6-
"github.com/jackc/pgx/v4"
7-
"github.com/jackc/pgx/v4/pgxpool"
86
"testing"
97
"time"
108

9+
"github.com/jackc/pgx/v4"
10+
"github.com/jackc/pgx/v4/pgxpool"
11+
1112
"github.com/stretchr/testify/assert"
1213
"github.com/testcontainers/testcontainers-go"
1314
"github.com/testcontainers/testcontainers-go/modules/postgres"
@@ -39,8 +40,8 @@ func (d *SQLContainer) Role() string {
3940
return "test_role"
4041
}
4142

42-
func SetupPostgresContainer(t *testing.T) *SQLContainer {
43-
ctx, cancel := context.WithTimeout(t.Context(), time.Minute)
43+
func SetupPostgresContainer(ctx context.Context, t *testing.T) *SQLContainer {
44+
ctx, cancel := context.WithTimeout(ctx, time.Minute)
4445
defer cancel()
4546

4647
pgContainer, err := postgres.Run(ctx,

0 commit comments

Comments
 (0)