I'm looking to improve my integration testing process for Java projects by incorporating Docker. Specifically, I want to know how others are handling external services like Postgres and Redis during testing. Are you using Testcontainers, running shell scripts with 'docker run', or relying on external infrastructure? Also, I've been curious about the challenges you might face such as container startup times, cleanup issues, port collisions, or flakiness in CI environments. I'd really appreciate hearing about what has worked or failed for you. Thanks!
1 Answer
Testcontainers have really become the go-to. They handle container cleanup and port management automatically by using random ports, which is super helpful. But there's a downside: our CI tasks run on a VM instead of in containers, leading to slow startup times for the agents. We're currently exploring ways to address that, maybe by reusing agents or considering alternatives like cloud-based testing.
That's interesting! We actually let GitHub Actions manage our service containers, so we don't face those CI startup issues. It makes for a smoother pipeline.”}]},{