Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .lightning/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
6 changes: 4 additions & 2 deletions tests/test_serve.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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'."
Expand Down
Loading