Skip to content

Commit

Permalink
chore: update testcontainers
Browse files Browse the repository at this point in the history
  • Loading branch information
joshiste committed Jan 23, 2024
1 parent 1a5df6f commit 5d7b85b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 17 deletions.
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ require (
github.com/steadybit/discovery-kit/go/discovery_kit_sdk v1.0.4
github.com/steadybit/extension-kit v1.8.11
github.com/stretchr/testify v1.8.4
github.com/testcontainers/testcontainers-go v0.26.0
github.com/testcontainers/testcontainers-go v0.27.0
)

// Workaround for https:/testcontainers/testcontainers-go/issues/1359
Expand Down Expand Up @@ -112,7 +112,7 @@ require (
github.com/rs/xid v1.5.0 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/schollz/closestmatch v2.1.0+incompatible // indirect
github.com/shirou/gopsutil/v3 v3.23.10 // indirect
github.com/shirou/gopsutil/v3 v3.23.11 // indirect
github.com/shoenig/go-m1cpu v0.1.6 // indirect
github.com/sirupsen/logrus v1.9.3 // indirect
github.com/tdewolff/minify/v2 v2.20.7 // indirect
Expand Down
9 changes: 4 additions & 5 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -273,8 +273,8 @@ github.com/schollz/closestmatch v2.1.0+incompatible/go.mod h1:RtP1ddjLong6gTkbtm
github.com/seccomp/libseccomp-golang v0.9.2-0.20220502022130-f33da4d89646/go.mod h1:JA8cRccbGaA1s33RQf7Y1+q9gHmZX1yB/z9WDN1C6fg=
github.com/sergi/go-diff v1.0.0 h1:Kpca3qRNrduNnOQeazBd0ysaKrUJiIuISHxogkT9RPQ=
github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo=
github.com/shirou/gopsutil/v3 v3.23.10 h1:/N42opWlYzegYaVkWejXWJpbzKv2JDy3mrgGzKsh9hM=
github.com/shirou/gopsutil/v3 v3.23.10/go.mod h1:JIE26kpucQi+innVlAUnIEOSBhBUkirr5b44yr55+WE=
github.com/shirou/gopsutil/v3 v3.23.11 h1:i3jP9NjCPUz7FiZKxlMnODZkdSIp2gnzfrvsu9CuWEQ=
github.com/shirou/gopsutil/v3 v3.23.11/go.mod h1:1FrWgea594Jp7qmjHUUPlJDTPgcsb9mGnXDxavtikzM=
github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFtM=
github.com/shoenig/go-m1cpu v0.1.6/go.mod h1:1JJMcUBvfNwpq05QDQVAnx3gUHr9IYF7GNg9SUEw2VQ=
github.com/shoenig/test v0.6.4 h1:kVTaSd7WLz5WZ2IaoM0RSzRsUD+m8wRR+5qvntpn4LU=
Expand Down Expand Up @@ -323,8 +323,8 @@ github.com/tdewolff/parse/v2 v2.7.5 h1:RdcN3Ja6zAMSvnxxO047xRoWexX3RrXKi3H6EQHzX
github.com/tdewolff/parse/v2 v2.7.5/go.mod h1:3FbJWZp3XT9OWVN3Hmfp0p/a08v4h8J9W1aghka0soA=
github.com/tdewolff/test v1.0.11-0.20231101010635-f1265d231d52 h1:gAQliwn+zJrkjAHVcBEYW/RFvd2St4yYimisvozAYlA=
github.com/tdewolff/test v1.0.11-0.20231101010635-f1265d231d52/go.mod h1:6DAvZliBAAnD7rhVgwaM7DE5/d9NMOAJ09SqYqeK4QE=
github.com/testcontainers/testcontainers-go v0.26.0 h1:uqcYdoOHBy1ca7gKODfBd9uTHVK3a7UL848z09MVZ0c=
github.com/testcontainers/testcontainers-go v0.26.0/go.mod h1:ICriE9bLX5CLxL9OFQ2N+2N+f+803LNJ1utJb1+Inx0=
github.com/testcontainers/testcontainers-go v0.27.0 h1:IeIrJN4twonTDuMuBNQdKZ+K97yd7VrmNGu+lDpYcDk=
github.com/testcontainers/testcontainers-go v0.27.0/go.mod h1:+HgYZcd17GshBUZv9b+jKFJ198heWPQq3KQIp2+N+7U=
github.com/tidwall/gjson v1.17.0 h1:/Jocvlh98kcTfpN2+JzGQWQcqrPQwDrVEMApx/M5ZwM=
github.com/tidwall/gjson v1.17.0/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk=
github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA=
Expand Down Expand Up @@ -425,7 +425,6 @@ golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc=
golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
Expand Down
15 changes: 5 additions & 10 deletions kong/testcontainers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"github.com/steadybit/extension-kong/config"
"github.com/stretchr/testify/require"
"github.com/testcontainers/testcontainers-go"
tcnetwork "github.com/testcontainers/testcontainers-go/network"
"github.com/testcontainers/testcontainers-go/wait"
"testing"
"time"
Expand Down Expand Up @@ -97,15 +98,9 @@ func cleanupKong(t *testing.T, instance *config.Instance) {
}

func setupTestContainers(ctx context.Context) (*TestContainers, error) {
networkName := "test-kong-net"
kongImage := "kong/kong-gateway:2.8.1.2-alpine"

networkRequest := testcontainers.GenericNetworkRequest{
NetworkRequest: testcontainers.NetworkRequest{
Name: networkName,
},
}
_, err := testcontainers.GenericNetwork(ctx, networkRequest)
network, err := tcnetwork.New(ctx)
if err != nil {
return nil, err
}
Expand All @@ -119,7 +114,7 @@ func setupTestContainers(ctx context.Context) (*TestContainers, error) {
"POSTGRES_PASSWORD": "kongpass",
},
ExposedPorts: []string{"5433/tcp"},
Networks: []string{networkName},
Networks: []string{network.Name},
Cmd: []string{"-p", "5433"},
WaitingFor: wait.ForLog("database system is ready to accept connections"),
}
Expand All @@ -142,7 +137,7 @@ func setupTestContainers(ctx context.Context) (*TestContainers, error) {
"KONG_PG_USER": "kong",
"KONG_PG_PASSWORD": "kongpass",
},
Networks: []string{networkName},
Networks: []string{network.Name},
Cmd: []string{"kong", "migrations", "bootstrap", "-v"},
WaitingFor: wait.ForExit(),
}
Expand Down Expand Up @@ -177,7 +172,7 @@ func setupTestContainers(ctx context.Context) (*TestContainers, error) {
"KONG_ADMIN_LISTEN": "0.0.0.0:8001",
"KONG_ADMIN_GUI_URL": "http://localhost:8002",
},
Networks: []string{networkName},
Networks: []string{network.Name},
WaitingFor: wait.ForHTTP("/").WithPort("8001/tcp").WithStartupTimeout(5 * time.Minute),
}
kongContainer, err := testcontainers.GenericContainer(ctx, testcontainers.GenericContainerRequest{
Expand Down

0 comments on commit 5d7b85b

Please sign in to comment.