Skip to content

Commit 1c6b3ea

Browse files
committed
use exisitng docker-compose file
1 parent 5cc1754 commit 1c6b3ea

File tree

3 files changed

+16
-28
lines changed

3 files changed

+16
-28
lines changed

e2e_tests/conftest.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66
@pytest.fixture(scope="session", autouse=True)
77
def docker_compose_setup():
88
"""Spin up Docker containers for OPAL services using docker-compose."""
9-
compose_file = os.path.abspath("./docker-compose.yml")
9+
compose_file = os.path.abspath("../app-tests/docker-compose-app-tests.yml")
1010

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

1313
# Wait for services to be up and running
14-
time.sleep(60)
14+
time.sleep(10)
1515

1616
yield
1717

e2e_tests/docker-compose.yml

-22
This file was deleted.

e2e_tests/tests/test_e2e.py

+14-4
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,24 @@
11
import requests
22
import time
3+
import subprocess
4+
5+
def check_logs(container_name):
6+
result = subprocess.run(["docker", "logs", container_name], capture_output=True, text=True)
7+
assert "ERROR" not in result.stdout and "CRITICAL" not in result.stdout, f"Critical errors found in {container_name}"
38

49
def test_opal_server_health():
510
"""Test OPAL Server health endpoint."""
6-
response = requests.get("http://localhost:7002/healthcheck")
11+
response = requests.get("http://opal_server:7002/healthcheck")
712
assert response.status_code == 200
813

914
def test_opal_client_health():
1015
"""Test OPAL Client endpoint."""
11-
12-
response = requests.get("http://localhost:7000/healthcheck")
16+
response = requests.get("http://opal_client:7000/healthcheck")
1317
assert response.status_code == 200
14-
print(response.json())
18+
print(response.json())
19+
20+
def test_opal_server_logs():
21+
check_logs("app-tests-opal_server-1")
22+
23+
def test_opal_client_logs():
24+
check_logs("app-tests-opal_client-1")

0 commit comments

Comments
 (0)