diff --git a/.lightning/workflows/tests.yaml b/.lightning/workflows/tests.yaml index 8604cac59c..344dc1f477 100644 --- a/.lightning/workflows/tests.yaml +++ b/.lightning/workflows/tests.yaml @@ -43,7 +43,9 @@ run: | python -c "import torch ; gpus = torch.cuda.device_count() ; assert gpus >= 2, f'GPU: {gpus}'" python -c "from torch import __version__ as ver ; assert str(ver).split('+')[0] == '$TORCH_VERSION', f'PyTorch: installed {ver} but expected $TORCH_VERSION'" - pytest -v --durations=100 + pytest -v --durations=100 tests/ --ignore=tests/test_serve.py + pytest -v --durations=100 tests/test_serve.py + wget https://raw.githubusercontent.com/Lightning-AI/utilities/main/scripts/run_standalone_tests.sh PL_RUN_STANDALONE_TESTS=1 bash run_standalone_tests.sh "tests" diff --git a/tests/test_serve.py b/tests/test_serve.py index 81d51dcd27..dc1dff1e78 100644 --- a/tests/test_serve.py +++ b/tests/test_serve.py @@ -208,7 +208,9 @@ def run_server(): try: # Test server health response = requests.get("http://127.0.0.1:8000/health") - assert response.status_code == 200, f"Server health check failed with status code {response.status_code}" + assert response.status_code == 200, ( + f"Server health check failed with status code {response.status_code}: {response.text}" + ) assert response.text == "ok", "Server did not respond as expected." # Test non-streaming chat completion @@ -220,7 +222,7 @@ def run_server(): }, ) assert response.status_code == 200, ( - f"Non-streaming chat completion failed with status code {response.status_code}" + f"Non-streaming chat completion failed with status code {response.status_code}: {response.text}" ) response_json = response.json() assert "choices" in response_json, "Response JSON does not contain 'choices'."