File tree Expand file tree Collapse file tree 3 files changed +15
-10
lines changed
Expand file tree Collapse file tree 3 files changed +15
-10
lines changed Original file line number Diff line number Diff line change 11package postgres
22
33import (
4+ "context"
5+ "testing"
6+
47 "github.com/conductorone/baton-postgresql/pkg/testutil"
58 "github.com/stretchr/testify/assert"
6- "testing"
79)
810
911func 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 )
Original file line number Diff line number Diff line change 11package postgres
22
33import (
4+ "context"
5+ "testing"
6+
47 "github.com/conductorone/baton-postgresql/pkg/testutil"
58 "github.com/stretchr/testify/assert"
6- "testing"
79)
810
911func 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 )
Original file line number Diff line number Diff line change @@ -3,11 +3,12 @@ package testutil
33import (
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 ,
You can’t perform that action at this time.
0 commit comments