I'd like to use testcontainers for integration testing. I need to test against a clickhouse storage.
The docker image is yandex/clichouse-server
My code thus far (imported mostly from the official redis example on testcontainers website):
ctx := context.Background()
req := testcontainers.ContainerRequest{
Image: "yandex/clickhouse-server",
ExposedPorts: []string{"9000/tcp"},
}
chContainer, err := testcontainers.GenericContainer(ctx, testcontainers.GenericContainerRequest{
ContainerRequest: req,
Started: true,
})
require.NoError(t, err, "unexpected error while creating clickhouse container")
endpoint, err := chContainer.Endpoint(ctx, "")
require.NoError(t, err)
This throws an error port not found on getting the endpoint, and I'm not sure where to go from there.