Skip to content

Commit

Permalink
use exisitng docker-compose file
Browse files Browse the repository at this point in the history
  • Loading branch information
varshith257 committed Oct 31, 2024
1 parent 5cc1754 commit 1c6b3ea
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 28 deletions.
4 changes: 2 additions & 2 deletions e2e_tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
@pytest.fixture(scope="session", autouse=True)
def docker_compose_setup():
"""Spin up Docker containers for OPAL services using docker-compose."""
compose_file = os.path.abspath("./docker-compose.yml")
compose_file = os.path.abspath("../app-tests/docker-compose-app-tests.yml")

subprocess.run(["docker-compose", "-f", compose_file, "up", "-d"])

# Wait for services to be up and running
time.sleep(60)
time.sleep(10)

yield

Expand Down
22 changes: 0 additions & 22 deletions e2e_tests/docker-compose.yml

This file was deleted.

18 changes: 14 additions & 4 deletions e2e_tests/tests/test_e2e.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,24 @@
import requests
import time
import subprocess

def check_logs(container_name):
result = subprocess.run(["docker", "logs", container_name], capture_output=True, text=True)
assert "ERROR" not in result.stdout and "CRITICAL" not in result.stdout, f"Critical errors found in {container_name}"

def test_opal_server_health():
"""Test OPAL Server health endpoint."""
response = requests.get("http://localhost:7002/healthcheck")
response = requests.get("http://opal_server:7002/healthcheck")
assert response.status_code == 200

def test_opal_client_health():
"""Test OPAL Client endpoint."""

response = requests.get("http://localhost:7000/healthcheck")
response = requests.get("http://opal_client:7000/healthcheck")
assert response.status_code == 200
print(response.json())
print(response.json())

def test_opal_server_logs():
check_logs("app-tests-opal_server-1")

def test_opal_client_logs():
check_logs("app-tests-opal_client-1")

0 comments on commit 1c6b3ea

Please sign in to comment.