[Infra] Add Server Root Test to GitHub Actions#21353
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Greptile SummaryAdds a new GitHub Actions workflow (
Confidence Score: 4/5
|
| Filename | Overview |
|---|---|
| .github/workflows/test_server_root_path.yml | New CI workflow that builds a Docker image and tests SERVER_ROOT_PATH functionality across 3 path variants plus a no-root-path baseline. Well-structured with good endpoint coverage. Minor style issues with unnecessary master branch references. |
Flowchart
flowchart TD
A[PR / Push to main] --> B[test-server-root-path job]
A --> C[test-without-root-path job]
B --> D[Build Docker Image]
D --> E{Matrix: 3 root paths}
E --> F["/api/v1"]
E --> G["/litellm"]
E --> H["/proxy"]
F --> I[Start container with SERVER_ROOT_PATH]
G --> I
H --> I
I --> J[Wait for Uvicorn]
J --> K[Test /health]
K --> L[Test /health/liveliness]
L --> M[Test /health/readiness]
M --> N[Test /ui]
N --> O[Test /ui/ content]
O --> P[Test /docs]
P --> Q[Test /openapi.json]
Q --> R[Test /v1/models with auth]
R --> S[Verify 404 without prefix]
S --> T[Run unit tests in container]
T --> U[Cleanup]
C --> V[Build Docker Image]
V --> W[Start container without SERVER_ROOT_PATH]
W --> X[Wait for Uvicorn]
X --> Y[Test /health and /ui at root]
Y --> Z[Cleanup]
Last reviewed commit: 0e736a7
| - name: Run unit tests for SERVER_ROOT_PATH | ||
| run: | | ||
| docker exec litellm-test pip install pytest pytest-asyncio | ||
| docker exec litellm-test pytest /app/tests/proxy_unit_tests/test_server_root_path.py -v |
There was a problem hiding this comment.
Missing if: always() on cleanup dependency
If the "Run unit tests" step fails, the workflow proceeds to "Cleanup" because it has if: always(). However, the pip install on line 227 could fail and leave pytest uninstalled, causing a confusing error on line 228. Consider combining them in a single docker exec call or adding || true to the install step so the test step still runs (or fails clearly). This is minor since a pip install failure would be unusual, but it could mask the real issue during debugging.
More importantly, if the container failed to start or crashed between the health check steps and this step, docker exec will fail with an opaque error. Consider adding a container health check before running the exec.
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
…llm into litellm_gh_server_root_test
Relevant issues
Pre-Submission checklist
Please complete all items before asking a LiteLLM maintainer to review your PR
tests/litellm/directory, Adding at least 1 test is a hard requirement - see detailsmake test-unit@greptileaiand received a Confidence Score of at least 4/5 before requesting a maintainer reviewCI (LiteLLM team)
Branch creation CI run
Link:
CI run for the last commit
Link:
Merge / cherry-pick CI run
Links:
Type
🚄 Infrastructure
Changes
There has been regressions around the SERVER_ROOT_PATH environment handling. Since our normal CI/CD does not run on non-team member PRs it is difficult to catch issues relating to this. Adding a github actions CI step that always run to help catch regressions