@@ -38,8 +38,8 @@ import (
3838 backendsm "github.com/chainloop-dev/chainloop/pkg/blobmanager/mocks"
3939 "github.com/chainloop-dev/chainloop/pkg/credentials"
4040 creds "github.com/chainloop-dev/chainloop/pkg/credentials/mocks"
41- "github.com/docker/go-connections/nat"
4241 "github.com/go-kratos/kratos/v2/log"
42+ "github.com/moby/moby/api/types/network"
4343 "github.com/stretchr/testify/assert"
4444 "github.com/stretchr/testify/require"
4545
@@ -167,7 +167,7 @@ func NewTestDatabase(t *testing.T) *TestDatabase {
167167 defer cancel ()
168168
169169 const port = "5432/tcp"
170- dbURL := func (host string , port nat .Port ) string {
170+ dbURL := func (host string , port network .Port ) string {
171171 return fmt .Sprintf ("postgres://postgres:postgres@%s:%s/postgres?sslmode=disable" , host , port .Port ())
172172 }
173173
@@ -180,7 +180,7 @@ func NewTestDatabase(t *testing.T) *TestDatabase {
180180 "POSTGRES_PASSWORD" : "postgres" ,
181181 "POSTGRES_DB" : "controlplane_test" ,
182182 },
183- WaitingFor : wait .ForSQL (nat . Port ( port ) , "postgres" , dbURL ).WithStartupTimeout (time .Second * 5 ),
183+ WaitingFor : wait .ForSQL (port , "postgres" , dbURL ).WithStartupTimeout (time .Second * 5 ),
184184 }
185185
186186 postgres , err := testcontainers .GenericContainer (ctx , testcontainers.GenericContainerRequest {
@@ -198,7 +198,7 @@ func (db *TestDatabase) Port(t *testing.T) int {
198198 defer cancel ()
199199 p , err := db .instance .MappedPort (ctx , "5432" )
200200 require .NoError (t , err )
201- return p . Int ( )
201+ return int ( p . Num () )
202202}
203203
204204func (db * TestDatabase ) ConnectionString (t * testing.T ) string {
0 commit comments