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

refactor(core): Standardize configuration and readiness steps in container lifecycle

Open santi opened this issue 1 year ago • 4 comments

Aims for this PR:

  • Include _configure() and _wait_until_ready() hooks in base DockerContainer image to be used by all container implementations in need of a configuration and readiness step.
  • Standardize method naming for getting a connection string from a container, where a popular client library expects a standardized URL format for connecting to the service provided by the container (E.g. a database URL for DB containers)
  • Remove DbContainer class, as the two points above will render it redundant.

santi avatar Apr 04 '24 08:04 santi

Referencing https://github.com/testcontainers/testcontainers-python/issues/459 for context

santi avatar Apr 04 '24 08:04 santi

would this have the potential to break existing code that depends on conventions from v3 and v4?

alexanderankin avatar Apr 06 '24 11:04 alexanderankin

if i were to try to merge this, what should i keep in mind @santi ? Anything not already reflected here? I did a first pass and seems like i will have to revisit this several times in order to make sense of this fully...

also, like i asked above, is this breaking at all?

alexanderankin avatar May 14 '24 07:05 alexanderankin

@alexanderankin Hey, sorry for the delay on this one. This is just a WIP draft that is not ready for a merge quite yet, and has probably drifted a bit from the main branch. I intend on getting this one up-to-date this week, and do a nice write-up on the implications and document the intention behind the changes / API standardisation it introduces.

santi avatar May 20 '24 20:05 santi