-
Notifications
You must be signed in to change notification settings - Fork 195
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5cc1754
commit 1c6b3ea
Showing
3 changed files
with
16 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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") |