litellm/.github/workflows
cursor-agent adf41853ee
feat(tests): vendor example_openai_endpoint as a local mock server
Adds a vendored copy of BerriAI/example_openai_endpoint under
tests/mock_endpoints/example_openai_endpoint/ together with infrastructure
to run it in-process during a test session, so CI no longer depends on the
public Railway deployment (which has had multiple outages, e.g. the May 19
2026 GCP-account incident that took down 8 CI jobs).

Pieces added:

- tests/mock_endpoints/example_openai_endpoint/  vendored upstream source
  (main.py, batch_and_files_api.py, requirements.txt, Dockerfile),
  intended to be re-vendored as-is from upstream when needed (see README).
- tests/mock_endpoints/__init__.py              helper module exposing
  MOCK_OPENAI_BASE_URL (reads LITELLM_MOCK_OPENAI_BASE_URL with the
  Railway URL as fallback) and start_mock_server() — boots the server as
  a subprocess on a free port, polls /chat/completions until it responds,
  returns an RAII-style handle for teardown.
- tests/mock_endpoints/conftest.py              session-scoped pytest
  fixture mock_openai_endpoint_server that any suite can opt into via
  pytest_plugins.
- tests/mock_endpoints/start_mock_server.sh     bash launcher (foreground
  or --background) for shell-driven workflows.
- tests/mock_endpoints/README.md                local + CI usage docs and
  instructions for re-vendoring from upstream.
- tests/test_litellm/mock_endpoints/            end-to-end smoke tests
  that boot the mock and exercise /chat/completions, /v1/embeddings, and
  the fine-tuning list endpoint.

Wiring:

- New mock-server dependency-group in pyproject.toml (just adds slowapi;
  the rest of the upstream deps already come in via dev/proxy-dev).
- _test-unit-base.yml now syncs --group mock-server so any reusable unit
  test job has the deps available.
- test-unit-misc.yml runs the new smoke tests as part of its path set.
- Makefile gains 'make mock-server' (and an install-mock-server helper)
  for running the server locally with the project venv.

The Railway URL is still the runtime fallback for any test that has not
been migrated, so this PR is non-breaking; follow-up PRs can migrate
hard-coded URLs to use MOCK_OPENAI_BASE_URL / the new fixture.

Co-authored-by: Mateo Wang <mateo-berri@users.noreply.github.com>
2026-05-20 15:57:20 +00:00
..
_test-unit-base.yml feat(tests): vendor example_openai_endpoint as a local mock server 2026-05-20 15:57:20 +00:00
_test-unit-services-base.yml fix(ci): flag codecov uploads, enable carryforward, close coverage gaps (#28028) 2026-05-16 10:56:32 -07:00
auto_update_price_and_context_window.yml build: migrate packaging, CI, and Docker from Poetry to uv (#25007) 2026-04-09 11:46:23 -07:00
auto_update_price_and_context_window_file.py only add/update vercel ai gateway models 2025-08-04 17:22:36 -07:00
check-schema-sync.yml chore: fixes 2026-04-05 01:30:57 -07:00
check_duplicate_issues.yml [Infra] Flip remaining CI jobs to Python 3.12 2026-04-22 21:26:19 -07:00
codeql.yml chore: fixes 2026-04-05 01:30:57 -07:00
codspeed.yml build: migrate packaging, CI, and Docker from Poetry to uv (#25007) 2026-04-09 11:46:23 -07:00
create-release-branch.yml ci(release): accept PEP 440 tag forms in create-release workflow 2026-04-28 19:33:18 -07:00
create-release.yml [Fix] Release Workflow: Detect SemVer-Style Pre-Release Dev Tags 2026-04-30 23:51:04 -07:00
create_daily_staging_branch.yml chore: fixes 2026-04-05 01:30:57 -07:00
guard-fork-dependencies.yml ci: add supply-chain guard to block fork PRs that modify dependencies 2026-04-25 18:46:50 +00:00
guard-main-branch.yml Point contributors toward litellm_oss_branch in guard error messages 2026-04-14 18:41:59 -07:00
helm_unit_test.yml chore: fixes 2026-04-05 01:30:57 -07:00
issue-keyword-labeler.yml chore: fixes 2026-04-05 01:30:57 -07:00
label-component.yml chore: fixes 2026-04-05 01:30:57 -07:00
mutation-test.yml ci: add manually-triggered mutation testing workflow (#27576) 2026-05-11 15:19:57 -07:00
run_llm_translation_tests.py build: migrate packaging, CI, and Docker from Poetry to uv (#25007) 2026-04-09 11:46:23 -07:00
scorecard.yml chore: fixes 2026-04-05 01:30:57 -07:00
stale.yml chore: fixes 2026-04-05 01:30:57 -07:00
sync-schema.yml chore: fixes 2026-04-05 01:30:57 -07:00
test-code-quality.yml ci: check out litellm-docs directly into docs/my-website 2026-04-24 14:21:18 -07:00
test-linting.yml [Infra] Expand CI branch filters for non-main PR targets 2026-04-15 15:39:57 -07:00
test-litellm-ui-build.yml [Infra] Expand CI branch filters for non-main PR targets 2026-04-15 15:39:57 -07:00
test-mcp.yml ci: use --cov=./litellm so coverage paths resolve unambiguously in Codecov 2026-05-14 14:01:05 -07:00
test-model-map.yaml [Infra] Expand CI branch filters for non-main PR targets 2026-04-15 15:39:57 -07:00
test-semgrep.yml [Infra] Move non-API-key CCI jobs to GitHub Actions 2026-04-22 13:38:00 -07:00
test-unit-core-utils.yml [Infra] Expand CI branch filters for non-main PR targets 2026-04-15 15:39:57 -07:00
test-unit-documentation.yml ci: check out litellm-docs directly into docs/my-website 2026-04-24 14:21:18 -07:00
test-unit-enterprise-routing.yml [Infra] Expand CI branch filters for non-main PR targets 2026-04-15 15:39:57 -07:00
test-unit-integrations.yml [Infra] Expand CI branch filters for non-main PR targets 2026-04-15 15:39:57 -07:00
test-unit-llm-providers.yml [Infra] Expand CI branch filters for non-main PR targets 2026-04-15 15:39:57 -07:00
test-unit-misc.yml feat(tests): vendor example_openai_endpoint as a local mock server 2026-05-20 15:57:20 +00:00
test-unit-proxy-auth.yml [Infra] Expand CI branch filters for non-main PR targets 2026-04-15 15:39:57 -07:00
test-unit-proxy-db.yml Gemini managed agents support (#28270) 2026-05-19 16:02:03 -07:00
test-unit-proxy-endpoints.yml [Infra] Remove CCI/GHA test duplication and semantically shard proxy DB tests 2026-04-23 14:48:38 -07:00
test-unit-proxy-infra.yml [Infra] Expand CI branch filters for non-main PR targets 2026-04-15 15:39:57 -07:00
test-unit-proxy-legacy.yml Merge remote-tracking branch 'origin/litellm_internal_staging' into litellm_migration_projects 2026-04-24 12:52:10 -07:00
test-unit-responses-caching-types.yml [Infra] Expand CI branch filters for non-main PR targets 2026-04-15 15:39:57 -07:00
test-unit-security.yml [Infra] Stop attaching push-only postgres workflows to a GHA environment 2026-04-23 16:32:18 -07:00
test_server_root_path.yml [Infra] Expand CI branch filters for non-main PR targets 2026-04-15 15:39:57 -07:00
zizmor.yml chore: fixes 2026-04-05 01:30:57 -07:00