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

Add documentation to `DockerContainer` in `core`.

Open jamesward opened this issue 2 years ago • 8 comments

Please add docs for the Generic Container. Thanks!

jamesward avatar Dec 20 '22 16:12 jamesward

Hi @jamesward, the GenericContainer is deprecated and will be removed in the upcoming 4.x release of testcontainers-python. I'm closing this for now, but please follow up if you have further questions.

tillahoffmann avatar Feb 17 '23 03:02 tillahoffmann

Thanks for the heads up! What is the alternative?

jamesward avatar Feb 17 '23 13:02 jamesward

GenericContainer was just another name for DockerContainer (see https://github.com/testcontainers/testcontainers-python/blob/v3.7.1/testcontainers/core/generic.py#L62-L65). I hope the latter is documented a bit better, but it could also do with some work.

tillahoffmann avatar Feb 17 '23 14:02 tillahoffmann

Ah! Thanks. Also I noticed docs on DockerContainer which I don't remember being there before. I'll give it a try!

jamesward avatar Feb 17 '23 23:02 jamesward

Dug in again and I am using DockerContainer and still need some more docs :) For instance, I'm not sure how to wait until a port is listening.

jamesward avatar Feb 17 '23 23:02 jamesward

There is some information in https://github.com/testcontainers/testcontainers-python/blob/master/core/testcontainers/core/waiting_utils.py and examples scattered across the repository. But I agree we need better documentation.

What sort of listening do you want to wait for, e.g., HTTP or some other protocol?

tillahoffmann avatar Feb 18 '23 17:02 tillahoffmann

Yeah, on my other related projects I use:

Wait.forHttp("/")

Thanks!

jamesward avatar Feb 18 '23 19:02 jamesward

I've just discovered testcontainers and have been through some of the docs & tutorials. I kept seeing GenericContainer everywhere so that's the first thing I looked for when I went to prototype, but couldn't find it

It might be an idea to mention in the docs that GenericContainer has been superceded by DockerContainer, at least until the getting started docs can catch up

mattfysh avatar Dec 14 '23 01:12 mattfysh