When pytest is run, it launches the Docker Compose services with docker_compose.execute("up --build -d").
A problem with this is: for our application, we'd need to run docker_compose.execute("build && docker-compose up -d") to actually build it properly (because docker-compose --build up follows the depends_on order for the build, which doesn't work in our case).
I think adding a new fixture like docker_setup(), similar to docker_cleanup(), would be a great way of allowing this customization (as suggested here for a different issue).
It's also useful for redirecting build logs that would otherwise be hidden: docker_compose.execute("build &> /tmp/build_logs.txt && docker-compose up -d")
When pytest is run, it launches the Docker Compose services with
docker_compose.execute("up --build -d")
.A problem with this is: for our application, we'd need to run
docker_compose.execute("build && docker-compose up -d")
to actually build it properly (becausedocker-compose --build up
follows thedepends_on
order for the build, which doesn't work in our case).I think adding a new fixture like
docker_setup()
, similar todocker_cleanup()
, would be a great way of allowing this customization (as suggested here for a different issue).