LCORE-1361: various improvements in integration tests#1197
Conversation
WalkthroughMultiple test files updated with assertion refinements, condition checks, and coverage directives to align with modified validation logic and test expectations. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
tests/integration/endpoints/test_model_list.py (1)
245-255: Granular assertions are a clear improvement; consider using thestatusconstant for the status code.The four-assertion structure correctly mirrors the
ServiceUnavailableResponse(backend_name="Llama Stack", cause=str(e))model dump used inmodels.py. One optional consistency nit:test_rlsapi_v1_integration.pyusesstatus.HTTP_503_SERVICE_UNAVAILABLEfor the same check; importing and using it here would keep the test files uniform.♻️ Optional: use the `status` constant
-from fastapi import Request +from fastapi import Request, status- assert exc_info.value.status_code == 503 + assert exc_info.value.status_code == status.HTTP_503_SERVICE_UNAVAILABLE🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@tests/integration/endpoints/test_model_list.py` around lines 245 - 255, Replace the hard-coded status code assertion with the shared status constant: import status (e.g., from fastapi import status) at the top of tests/integration/endpoints/test_model_list.py and change the assertion that checks exc_info.value.status_code == 503 to use status.HTTP_503_SERVICE_UNAVAILABLE; keep the other assertions intact (they align with ServiceUnavailableResponse used by models_endpoint_handler).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@tests/integration/endpoints/test_model_list.py`:
- Around line 245-255: Replace the hard-coded status code assertion with the
shared status constant: import status (e.g., from fastapi import status) at the
top of tests/integration/endpoints/test_model_list.py and change the assertion
that checks exc_info.value.status_code == 503 to use
status.HTTP_503_SERVICE_UNAVAILABLE; keep the other assertions intact (they
align with ServiceUnavailableResponse used by models_endpoint_handler).
ℹ️ Review info
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (6)
tests/integration/endpoints/test_model_list.pytests/integration/endpoints/test_rlsapi_v1_integration.pytests/integration/test_configuration.pytests/integration/test_openapi_json.pytests/integration/test_rh_identity_integration.pytests/integration/test_version.py
Description
LCORE-1361: various improvements in integration tests
Type of change
Tools used to create PR
Related Tickets & Documents
Summary by CodeRabbit