diff options
| author | mo khan <mo@mokhan.ca> | 2025-05-13 15:00:41 -0600 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2025-05-13 15:00:41 -0600 |
| commit | 8bdd221a6d0b59d71cf6c0658e2b7edb6744caaa (patch) | |
| tree | 072615be77e87b37f5659885ba4177516b4d616f /test/integration | |
| parent | 9fbd377052135a17575e0b0d79ed245a863288c4 (diff) | |
test: try host network mode
Diffstat (limited to 'test/integration')
| -rw-r--r-- | test/integration/container.go | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/test/integration/container.go b/test/integration/container.go index badb640..9240b84 100644 --- a/test/integration/container.go +++ b/test/integration/container.go @@ -9,6 +9,8 @@ import ( "testing" "time" + xcontainer "github.com/docker/docker/api/types/container" + "github.com/docker/docker/api/types/network" "github.com/stretchr/testify/require" "github.com/testcontainers/testcontainers-go" "github.com/testcontainers/testcontainers-go/wait" @@ -39,8 +41,11 @@ func NewContainer(t *testing.T, ctx context.Context, envVars map[string]string) ctx, env.Fetch("IMAGE_TAG", "sparkled:invalid"), testcontainers.WithEnv(envVars), - testcontainers.WithExposedPorts("8080/tcp", "9901/tcp", "10000/tcp"), - testcontainers.WithHostPortAccess(port), + // testcontainers.WithExposedPorts("8080/tcp", "9901/tcp", "10000/tcp"), + testcontainers.WithHostConfigModifier(func(cfg *xcontainer.HostConfig) { + cfg.NetworkMode = xcontainer.NetworkMode(network.NetworkHost) + }), + // testcontainers.WithHostPortAccess(port), testcontainers.WithLogConsumers(&LogConsumer{t: t}), testcontainers.WithWaitStrategy(wait.ForLog("Listening on").WithStartupTimeout(10*time.Second)), ) |
