testcontainers-rs icon indicating copy to clipboard operation
testcontainers-rs copied to clipboard

Equivalent to TestContainers.exposeHostPorts?

Open hovinen opened this issue 2 years ago • 6 comments

I'm working on a test which must expose a service running on the host to a service running in a container.

In Java, this can be done with Testcontainers.exposeHostPorts(localServerPort); as per https://java.testcontainers.org/features/networking/.

I am unable to find an equivalent to this functionality in the Rust crate. How can one do this?

hovinen avatar Nov 14 '23 09:11 hovinen

I recommend linking to the actual section which you're referring to so other people don't get confused like me.

dezyh avatar Dec 03 '23 06:12 dezyh

I am unable to find an equivalent to this functionality in the Rust crate. How can one do this?

It is not supported at the moment. I am not familiar with the Java implementation in how they achieve this.

thomaseizinger avatar Jan 15 '24 03:01 thomaseizinger

I think this would indeed be very useful. I'll have a look at it when I find the time.

mervyn-mccreight avatar Apr 22 '24 23:04 mervyn-mccreight