diff --git a/.github/workflows/e2e_test.yml b/.github/workflows/e2e_test.yml index d1c6e92c..1d20eb94 100644 --- a/.github/workflows/e2e_test.yml +++ b/.github/workflows/e2e_test.yml @@ -19,11 +19,7 @@ jobs: # Run the Python script that handles the build and execution - name: Launch Docker Stack - run: python3 main.py local - - # Needs to be done in CI since docker stack does not support conditional waits - - name: Wait for minio - run: python3 main.py wait_for minio + run: python3 main.py local && python3 main.py wait_for "http://localhost:9001/minio/health/live" - name: Run pytest run: python3 main.py test diff --git a/main.py b/main.py index 34c786f7..0e153930 100644 --- a/main.py +++ b/main.py @@ -123,16 +123,12 @@ def test(): run_subprocess(f"docker exec -it {containerName} pytest") -def wait_for_response(name: str): +def wait_for_response(url: str): """ Wait for a response from the given url. This is needed to test code in CI/CD since docker stack does not support conditional waits and the dockerfile logic would be otherwise messy """ - url = None - if name == "minio": - url = "http://localhost:9001/minio/health/live" - print(f"Waiting for response from {url}") TIMEOUT_SEC = 60