Skip to content

Commit

Permalink
e2e test
Browse files Browse the repository at this point in the history
  • Loading branch information
C-Loftus committed Dec 10, 2024
1 parent 89d1c28 commit df9b84d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
6 changes: 1 addition & 5 deletions .github/workflows/e2e_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 1 addition & 5 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit df9b84d

Please sign in to comment.