From dab99aa3e31990704b74d7badc9bae1d6a7b5756 Mon Sep 17 00:00:00 2001 From: Nicolas Duchon Date: Mon, 23 Dec 2024 03:15:19 +0100 Subject: [PATCH] =?UTF-8?q?test:=20=F0=9F=A4=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/conftest.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/test/conftest.py b/test/conftest.py index 05d5fa9..d45f223 100644 --- a/test/conftest.py +++ b/test/conftest.py @@ -332,19 +332,23 @@ def get_nginx_conf_from_container(container): def docker_compose_up(compose_file='docker-compose.yml'): - logging.info(f'{DOCKER_COMPOSE} -f {compose_file} up -d') + composeCmd = f'{DOCKER_COMPOSE} --file {compose_file} up --remove-orphans --detach' + logging.info(composeCmd) + try: - subprocess.check_output(shlex.split(f'{DOCKER_COMPOSE} -f {compose_file} up -d'), stderr=subprocess.STDOUT) + subprocess.check_output(shlex.split(composeCmd), stderr=subprocess.STDOUT) except subprocess.CalledProcessError as e: - pytest.fail(f"Error while runninng '{DOCKER_COMPOSE} -f {compose_file} up -d':\n{e.output}", pytrace=False) + pytest.fail(f"Error while runninng '{composeCmd}:\n{e.output}", pytrace=False) def docker_compose_down(compose_file='docker-compose.yml'): - logging.info(f'{DOCKER_COMPOSE} -f {compose_file} down -v') + composeCmd = f'{DOCKER_COMPOSE} --file {compose_file} down --remove-orphans --volumes' + logging.info(composeCmd) + try: - subprocess.check_output(shlex.split(f'{DOCKER_COMPOSE} -f {compose_file} down -v'), stderr=subprocess.STDOUT) + subprocess.check_output(shlex.split(composeCmd), stderr=subprocess.STDOUT) except subprocess.CalledProcessError as e: - pytest.fail(f"Error while runninng '{DOCKER_COMPOSE} -f {compose_file} down -v':\n{e.output}", pytrace=False) + pytest.fail(f"Error while runninng '{composeCmd}':\n{e.output}", pytrace=False) def wait_for_nginxproxy_to_be_ready():