From 95bb86a0554bc7788f61a5f5cbb7f79f5a57629e Mon Sep 17 00:00:00 2001 From: "Shiny Brar (he/il)" Date: Tue, 18 Jun 2024 18:55:34 -0400 Subject: [PATCH] ci(github-actions): fixed issue with setting up test infra --- .github/workflows/ci.yml | 4 +++- workflow/cli/run.py | 2 +- workflow/utils/write.py | 5 ++--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 86c1593..c7bbd2e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -62,7 +62,9 @@ jobs: - name: Run services run: | - docker-compose -f docker-compose.yml up -d + docker compose -f docker-compose.yml up buckets mongo results -d + sleep 10 + docker compose -f docker-compose.yml up -d sleep 10 docker compose logs - diff --git a/workflow/cli/run.py b/workflow/cli/run.py index fddfca7..77a00ab 100644 --- a/workflow/cli/run.py +++ b/workflow/cli/run.py @@ -144,7 +144,7 @@ def run( write.workspace(payload) if isinstance(workspace, dict): - logger.info(f"Running with workspace from {workspace}") + logger.info(f"Running with dict workspace: {workspace}") # Save the workspace to the default location write.workspace(workspace) diff --git a/workflow/utils/write.py b/workflow/utils/write.py index 6185e67..7cc45ea 100644 --- a/workflow/utils/write.py +++ b/workflow/utils/write.py @@ -24,6 +24,8 @@ def workspace( Returns: None: None """ + if not destination.parent.exists(): + destination.parent.mkdir(parents=True, exist_ok=True) # If destination file exists, move it to a backup location file. date: str = datetime.now().strftime("%Y%m%d%H%M%S") if destination.exists(): @@ -31,9 +33,6 @@ def workspace( # Make sure the source path exists. if isinstance(source, Path): assert source.exists(), f"workspace {source} does not exist." - if not destination.parent.exists(): - destination.parent.mkdir(parents=True, exist_ok=True) - # Copy the source to the destination. source.replace(destination) return # Write dictionary to destination.