From 30b98e86fb8786ce09b26b1ded73a5a26e2a3ac2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Brunner?= Date: Fri, 2 Jun 2023 17:59:12 +0200 Subject: [PATCH] restore --- c2cwsgiutils/acceptance/composition.py | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/c2cwsgiutils/acceptance/composition.py b/c2cwsgiutils/acceptance/composition.py index 1c688158d..725f5c878 100644 --- a/c2cwsgiutils/acceptance/composition.py +++ b/c2cwsgiutils/acceptance/composition.py @@ -94,17 +94,15 @@ def dc_try(self, args: List[str], **kwargs: Any) -> None: def stop_all(self) -> None: self.dc_try(["stop"]) - # if self.coverage_paths: - # target_dir = "/reports/" - # os.makedirs(target_dir, exist_ok=True) - # for path in self.coverage_paths: - # try: - # subprocess.run( # nosec - # ["docker", "cp", path, target_dir], check=True, timeout=60 - # ) - # except Exception: - # self.dc(["ps"]) - # raise + if self.coverage_paths: + target_dir = "/reports/" + os.makedirs(target_dir, exist_ok=True) + for path in self.coverage_paths: + try: + subprocess.run(["docker", "cp", path, target_dir], check=True, timeout=60) # nosec + except Exception: + self.dc(["ps"]) + raise def stop(self, container: str) -> None: self.dc_try(["stop", container])