From 7642906ed92dd1dad77508235f08f5868af46c93 Mon Sep 17 00:00:00 2001 From: David Carmichael Date: Tue, 31 Oct 2023 15:58:32 +0000 Subject: [PATCH] Adjustments to the docker testing engine --- docker_tests.py | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/docker_tests.py b/docker_tests.py index a5dcbc64..72350e0e 100644 --- a/docker_tests.py +++ b/docker_tests.py @@ -42,8 +42,8 @@ def build_docker(tag_, file_): def create_docker(tag_): - with DockerCli(f"create --name {tag_} {tag_}") as output_: - print(f"create --name {tag_} {tag_}") + with DockerCli(f"create --name {tag_.replace(':latest', '')} {tag_}") as output_: + print(f"create --name {tag_.replace(':latest', '')} {tag_}") _ = output_ @@ -54,12 +54,8 @@ def start_docker(tag_): build_pool = multiprocessing.Pool() - create_pool = multiprocessing.Pool() - start_pool = multiprocessing.Pool() running_builds = [] - running_creates = [] - running_starts = [] print("Building test environments, please wait...") @@ -75,26 +71,18 @@ def start_docker(tag_): for tag, file in tags.items(): if tag in enabled_tags: - p_create = create_pool.apply_async(create_docker, args=(tag,)) - running_creates.append(p_create) - - for pro in running_creates: - pro.wait() + create_docker(tag.replace(':latest', '')) print("Running test environments, please wait...") for tag, file in tags.items(): if tag in enabled_tags: - p_starts = start_pool.apply_async(start_docker, args=(tag,)) - running_starts.append(p_starts) - - for pro in running_starts: - pro.wait() + start_docker(tag.replace(':latest', '')) print("Gathering logs, please wait...") for tag in tags: if tag in enabled_tags: - get_logs(tag) + get_logs(tag.replace(':latest', '')) cleanup_input = input("Do you want to cleanup? (Y/n): ") @@ -102,7 +90,7 @@ def start_docker(tag_): print("Cleaning up, please wait...") for tag in tags: if tag in enabled_tags: - with DockerCli(f"rm {tag}") as output: + with DockerCli(f"rm {tag.replace(':latest', '')}") as output: _ = output for tag in tags: