complement icon indicating copy to clipboard operation
complement copied to clipboard

Simplify internals

Open kegsay opened this issue 2 years ago • 3 comments

The idea of running docker containers in Go tests isn't new. It was reasonably new back when Complement started, but now there are libraries we could use instead, notably https://github.com/testcontainers/testcontainers-go

We should consider using this internally. This would be transparent to tests as they have a separate API shape, and greatly simplify the burden of maintaining Complement internals, as the cost of an extra dependency. This dependency though is backed by a number of companies and does test containers for other languages as well, not just Go.

kegsay avatar Oct 02 '23 15:10 kegsay

Hi from Testcontaines for Go! 👋 I landed here after a quick search on Github. Please let us know if we can help out adopting the project.

mdelapenya avatar Oct 31 '24 13:10 mdelapenya

I've extensively used testcontainers for other end-to-end style tests in CI and it seems for the most part to work well, though ryuk seems a little too eager in terminating running containers for some reason. Nonetheless, the original issue still stands, it reduces the complexity burden of maintaining Complement, it's just something we need to actually get around to doing.

kegsay avatar Jan 21 '25 08:01 kegsay

Thanks for letting me know! We worked in having a more robust Ryuk in terms of how it prunes containers. You probably want to give it a try to the latest version of testcontainers-go, which includes the ability to use the settings described in here: https://github.com/testcontainers/moby-ryuk?tab=readme-ov-file#ryuk-configuration

mdelapenya avatar Jan 21 '25 15:01 mdelapenya