fix: add missing replace directove for testcontainers
All checks were successful
concourse-ci/lint/golangci-lint Lint Go files
concourse-ci/test/gotestsum Run unit tests

This commit is contained in:
Peter 2023-01-03 19:58:34 +01:00 committed by Gitea
parent 9c8692cfce
commit 6006f6fb0d
5 changed files with 35 additions and 1284 deletions

View file

@ -41,7 +41,8 @@ linters-settings:
- condition
- return
gomoddirectives:
replace-allow-list: []
replace-allow-list:
- github.com/docker/docker
govet:
check-shadowing: true
enable-all: true

13
go.mod
View file

@ -21,14 +21,14 @@ require (
gopkg.in/yaml.v3 v3.0.1
)
replace github.com/docker/docker => github.com/docker/docker v20.10.3-0.20221013203545-33ab36d6b304+incompatible
require (
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect
github.com/Microsoft/go-winio v0.5.2 // indirect
github.com/Microsoft/hcsshim v0.9.5 // indirect
github.com/PaesslerAG/gval v1.0.0 // indirect
github.com/cenkalti/backoff/v4 v4.2.0 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/containerd/cgroups v1.0.4 // indirect
github.com/containerd/containerd v1.6.12 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
@ -37,13 +37,14 @@ require (
github.com/docker/go-connections v0.4.0 // indirect
github.com/docker/go-units v0.5.0 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/jackc/pgpassfile v1.0.0 // indirect
github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b // indirect
github.com/klauspost/compress v1.11.13 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/moby/sys/mount v0.3.3 // indirect
github.com/moby/sys/mountinfo v0.6.2 // indirect
github.com/moby/patternmatcher v0.5.0 // indirect
github.com/moby/sys/sequential v0.5.0 // indirect
github.com/moby/term v0.0.0-20221128092401-c43b287e0e0f // indirect
github.com/morikuni/aec v1.0.0 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
@ -52,8 +53,8 @@ require (
github.com/pkg/errors v0.9.1 // indirect
github.com/rogpeppe/go-internal v1.9.0 // indirect
github.com/sirupsen/logrus v1.9.0 // indirect
go.opencensus.io v0.23.0 // indirect
go.uber.org/atomic v1.10.0 // indirect
go.uber.org/goleak v1.1.12 // indirect
golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90 // indirect
golang.org/x/net v0.0.0-20220906165146-f3363e06e74c // indirect
golang.org/x/sys v0.3.0 // indirect

1275
go.sum

File diff suppressed because it is too large Load diff

View file

@ -6,7 +6,7 @@ import (
"testing"
"time"
"github.com/testcontainers/testcontainers-go"
tc "github.com/testcontainers/testcontainers-go"
"github.com/testcontainers/testcontainers-go/wait"
"code.icb4dc0.de/prskr/nurse/config"
@ -19,8 +19,8 @@ func PrepareRedisContainer(tb testing.TB) *config.Server {
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Minute)
tb.Cleanup(cancel)
container, err := testcontainers.GenericContainer(ctx, testcontainers.GenericContainerRequest{
ContainerRequest: testcontainers.ContainerRequest{
container, err := tc.GenericContainer(ctx, tc.GenericContainerRequest{
ContainerRequest: tc.ContainerRequest{
Image: "docker.io/redis:alpine",
ExposedPorts: []string{redisPort},
SkipReaper: true,
@ -28,10 +28,10 @@ func PrepareRedisContainer(tb testing.TB) *config.Server {
WaitingFor: wait.ForListeningPort(redisPort),
},
Started: true,
Logger: testcontainers.TestLogger(tb),
Logger: tc.TestLogger(tb),
})
if err != nil {
tb.Fatalf("testcontainers.GenericContainer() err = %v", err)
tb.Fatalf("tc.GenericContainer() err = %v", err)
}
tb.Cleanup(func() {

View file

@ -6,7 +6,7 @@ import (
"time"
"github.com/maxatome/go-testdeep/td"
"github.com/testcontainers/testcontainers-go"
tc "github.com/testcontainers/testcontainers-go"
"github.com/testcontainers/testcontainers-go/wait"
"code.icb4dc0.de/prskr/nurse/config"
@ -27,8 +27,8 @@ func PreparePostgresContainer(tb testing.TB) (name string, cfg *config.Server) {
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Minute)
tb.Cleanup(cancel)
container, err := testcontainers.GenericContainer(ctx, testcontainers.GenericContainerRequest{
ContainerRequest: testcontainers.ContainerRequest{
container, err := tc.GenericContainer(ctx, tc.GenericContainerRequest{
ContainerRequest: tc.ContainerRequest{
Image: "docker.io/postgres:alpine",
ExposedPorts: []string{postgresPort},
SkipReaper: true,
@ -41,10 +41,10 @@ func PreparePostgresContainer(tb testing.TB) (name string, cfg *config.Server) {
WaitingFor: wait.ForListeningPort(postgresPort),
},
Started: true,
Logger: testcontainers.TestLogger(tb),
Logger: tc.TestLogger(tb),
})
td.CmpNoError(tb, err, "testcontainers.GenericContainer()")
td.CmpNoError(tb, err, "tc.GenericContainer()")
tb.Cleanup(func() {
td.CmpNoError(tb, container.Terminate(context.Background()), "container.Terminate()")
@ -76,8 +76,8 @@ func PrepareMariaDBContainer(tb testing.TB) (name string, cfg *config.Server) {
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Minute)
tb.Cleanup(cancel)
container, err := testcontainers.GenericContainer(ctx, testcontainers.GenericContainerRequest{
ContainerRequest: testcontainers.ContainerRequest{
container, err := tc.GenericContainer(ctx, tc.GenericContainerRequest{
ContainerRequest: tc.ContainerRequest{
Image: "docker.io/mariadb:10",
ExposedPorts: []string{mysqlPort},
SkipReaper: true,
@ -91,10 +91,10 @@ func PrepareMariaDBContainer(tb testing.TB) (name string, cfg *config.Server) {
WaitingFor: wait.ForListeningPort(mysqlPort),
},
Started: true,
Logger: testcontainers.TestLogger(tb),
Logger: tc.TestLogger(tb),
})
td.CmpNoError(tb, err, "testcontainers.GenericContainer()")
td.CmpNoError(tb, err, "tc.GenericContainer()")
tb.Cleanup(func() {
td.CmpNoError(tb, container.Terminate(context.Background()), "container.Terminate()")