goose icon indicating copy to clipboard operation
goose copied to clipboard

First pass at adding testcontainers-go

Open mfridman opened this issue 2 years ago • 2 comments

First pass at #653

  • [x] How to explicitly bind to a port. Effectively, -p <MY_PORT>:5432
  • [x] How to reduce verbose logging from the package itself.

For example, I do not want to see a giant wall of text here:

**********************************************************************************************
Ryuk has been disabled for the current execution. This can cause unexpected behavior in your environment.
More on this: https://golang.testcontainers.org/features/garbage_collector/
**********************************************************************************************

Not really interested in the docker engine details:

2023/12/05 23:48:14 github.com/testcontainers/testcontainers-go - Connected to docker: 
  Server Version: 24.0.6
  API Version: 1.43
  Operating System: Docker Desktop
  Total Memory: 7944 MB
  Resolved Docker Host: unix:///var/run/docker.sock
  Resolved Docker Socket Path: /var/run/docker.sock
  Test SessionID: 14ee77ed3559f1df67d8ff4e0ce9bc0db0f069633eb473f48b640a1de3859167
  Test ProcessID: 6b631a85-de1f-4095-816d-3fbc46457d90

Lastly, don't really care about the container states. I'd like to set some bounds for startup/wait/etc. and just have the tool do the thing and only show verbose error states

2023/12/05 23:48:14 🐳 Creating container for image postgres:16-alpine
2023/12/05 23:48:14 ✅ Container created: 35c092208b95
2023/12/05 23:48:14 🐳 Starting container: 35c092208b95
2023/12/05 23:48:14 ✅ Container started: 35c092208b95
2023/12/05 23:48:14 🚧 Waiting for container id 35c092208b95 image: postgres:16-alpine. Waiting for: &{timeout:<nil> deadline:0xc000412e58 Strategies:[0xc000238b70]}

TL;DR - make the happy path silent by default and let users opt-in for more verbose logging.

mfridman avatar Dec 06 '23 05:12 mfridman

Filed an issue upstream, https://github.com/testcontainers/testcontainers-go/issues/1984

mfridman avatar Dec 15 '23 04:12 mfridman

I've done some research/testing and am fairly bullish on testcontainers, which is now part of Docker.

I hope upstream can solve some of those log output issues, but it's not a blocker.

mfridman avatar Dec 17 '23 17:12 mfridman

Going to close this for now and revisit later on.

mfridman avatar Mar 11 '24 13:03 mfridman