-
-
Notifications
You must be signed in to change notification settings - Fork 511
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Docker-compose expects ports to be exposed while finding containers to wait for them #329
Comments
What happens if you set the second parameter to WithExposedService("nginx_1", 0, wait.NewHTTPStrategy("/").WithPort("80/tcp").WithStartupTimeout(10*time.Second)). |
Yes, for sure it's possible to pass zero, but for the sake of a clean API, I consider not forcing the client code to pass the port if not needed. Besides that, looking up the container by container name is more straight-forward than using name and port. I guess it was firstly implemented in that way because of a specific need. Besides that, a downstream project was suffering this issue: apache/skywalking-infra-e2e#19 (comment) |
@ajcasagrande if you agree, we can close this one. OTOH I'd be happy to discuss about any other consideration/implication you see. Thanks! |
I think my preference would be to add a new |
I have a local branch doing exactly that 😁 |
Given #476 has been merged, I'm closing this issue. In there, it's possible to do what is requested in this issue: compose, err := NewDockerCompose("./testresources/docker-compose-simple.yml")
assert.NoError(t, err, "NewDockerCompose()")
err = compose.
// Appending with _1 as given in the Java Test-Containers Example
WaitForService("mysql-1", wait.NewLogStrategy("started").WithStartupTimeout(10*time.Second).WithOccurrence(1)).
Up(ctx, Wait(true)) |
Describe the bug
When using a docker-compose file that has no exposed ports, then it's not possible to apply any wait strategy, because it uses a port to create the filter when retrieving the running containers.
To Reproduce
Can you write a unit test to reproduce your issue?
docker-compose-no-exposed-ports.yml
Unit Test
Expected behavior
It's possible to reach the service by service name.
docker info
The text was updated successfully, but these errors were encountered: