The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]
Python ai-gatewayanthropicazure-openaibedrockgatewaylangchainlitellmllmllm-gatewayllmopsmcp-gatewayopenaiopenai-proxyrustrust-aivertex-ai
ci: run migrated unit selections on every event in legacy GHA shards (#43182)
yuneng-jiang694783ebbeca
diff --git a/.github/workflows/_test-unit-base.yml b/.github/workflows/_test-unit-base.ymlindex ef1dc53b4a6..fac0d766535 100644--- a/.github/workflows/_test-unit-base.yml+++ b/.github/workflows/_test-unit-base.yml@@ -13,12 +13,13 @@ on:have its path existence-checked like any other token.required: truetype: string- fork-flag:+ unit-flag:description: >-Codecov flag of the `.circleci/tests.yml` job that now owns part of- this shard. CircleCI does not run on pull requests from forks, so on- those events this shard also runs the files- `.circleci/scripts/unit_selection.sh` lists for the flag.+ this shard. The shard also runs the files+ `.circleci/scripts/unit_selection.sh` lists for the flag, on every+ event, because the CircleCI pipeline is manual-only while the tests+ migrate.required: falsetype: stringdefault: ""@@ -175,8 +176,7 @@ jobs:timeout-minutes: ${{ inputs.timeout-minutes }}env:TEST_PATH: ${{ inputs.test-path }}- FORK_FLAG: ${{ inputs.fork-flag }}- IS_FORK: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository }}+ UNIT_FLAG: ${{ inputs.unit-flag }}MAX_FAILURES: ${{ inputs.max-failures }}WORKERS: ${{ inputs.workers }}RERUNS: ${{ inputs.reruns }}@@ -186,11 +186,11 @@ jobs:run: |echo "has-coverage=false" >> "$GITHUB_OUTPUT"selection="${TEST_PATH}"- if [ "${IS_FORK}" = "true" ] && [ -n "${FORK_FLAG}" ]; then- selection="${TEST_PATH} $(bash .circleci/scripts/unit_selection.sh "${FORK_FLAG}" | tr '\n' ' ')"+ if [ -n "${UNIT_FLAG}" ]; then+ selection="${TEST_PATH} $(bash .circleci/scripts/unit_selection.sh "${UNIT_FLAG}" | tr '\n' ' ')"fiif [ -z "${selection// /}" ]; then- echo "shard selection is empty on this event (CircleCI flag ${FORK_FLAG:-none} owns it); nothing to run"+ echo "shard selection is empty; nothing to run"exit 0fipytest_args=()diff --git a/.github/workflows/test-unit-proxy-db.yml b/.github/workflows/test-unit-proxy-db.ymlindex 86b385d91a7..da4477b6947 100644--- a/.github/workflows/test-unit-proxy-db.yml+++ b/.github/workflows/test-unit-proxy-db.yml@@ -22,9 +22,10 @@ concurrency:## `.circleci/tests.yml` runs each group's files on same-repo events under the# `proxy-db-<group>` Codecov flag; `.circleci/scripts/unit_selection.sh` holds-# the file lists. CircleCI does not build pull requests from forks, so `fork-flag`-# makes the shard run that list there. `test-path` keeps the files that still-# reach real providers and never left tests/proxy_unit_tests.+# the file lists. That pipeline is manual-only while the tests migrate, so+# `unit-flag` makes the shard run that list on every event. `test-path` keeps+# the files that still reach real providers and never left+# tests/proxy_unit_tests.## Design targets:# * Every shard runs in <= 7 minutes of wall-clock on the default runner.@@ -78,7 +79,7 @@ jobs:# Must run serially — event-loop conflict with the logging worker.- test-group: key-generationtest-path: ""- fork-flag: proxy-db-key-generation+ unit-flag: proxy-db-key-generationworkers: 0dist: loadscopetimeout: 20@@ -86,13 +87,13 @@ jobs:# ---- auth: split into 2 shards ----- test-group: auth-checkstest-path: ""- fork-flag: proxy-db-auth-checks+ unit-flag: proxy-db-auth-checksworkers: 4dist: loadscopetimeout: 15- test-group: jwt-and-keystest-path: ""- fork-flag: proxy-db-jwt-and-keys+ unit-flag: proxy-db-jwt-and-keysworkers: 4dist: loadscopetimeout: 15@@ -100,7 +101,7 @@ jobs:# ---- test_proxy_utils.py, single shard, worksteal distribution ----- test-group: proxy-utilstest-path: ""- fork-flag: proxy-db-proxy-utils+ unit-flag: proxy-db-proxy-utilsworkers: 4dist: workstealtimeout: 15@@ -108,13 +109,13 @@ jobs:# ---- proxy server: split into 2 shards ----- test-group: proxy-server-coretest-path: "tests/proxy_unit_tests/test_proxy_server_gemini_pass_through.py"- fork-flag: proxy-db-proxy-server-core+ unit-flag: proxy-db-proxy-server-coreworkers: 4dist: loadscopetimeout: 15- test-group: proxy-runtimetest-path: ""- fork-flag: proxy-db-proxy-runtime+ unit-flag: proxy-db-proxy-runtimeworkers: 4dist: loadscopetimeout: 15@@ -122,20 +123,20 @@ jobs:# ---- logging: split into 2 shards ----- test-group: custom-loggingtest-path: "tests/proxy_unit_tests/test_proxy_custom_logger.py"- fork-flag: proxy-db-custom-logging+ unit-flag: proxy-db-custom-loggingworkers: 4dist: loadscopetimeout: 15- test-group: logging-misctest-path: ""- fork-flag: proxy-db-logging-misc+ unit-flag: proxy-db-logging-miscworkers: 4dist: loadscopetimeout: 15- test-group: db-and-spendtest-path: ""- fork-flag: proxy-db-db-and-spend+ unit-flag: proxy-db-db-and-spendworkers: 4dist: loadscopetimeout: 15@@ -143,27 +144,27 @@ jobs:# ---- guardrails + budget + hooks: split into 2 ----- test-group: guardrails-hookstest-path: ""- fork-flag: proxy-db-guardrails-hooks+ unit-flag: proxy-db-guardrails-hooksworkers: 4dist: loadscopetimeout: 15- test-group: budgetstest-path: ""- fork-flag: proxy-db-budgets+ unit-flag: proxy-db-budgetsworkers: 4dist: loadscopetimeout: 15- test-group: endpoints-and-responsestest-path: "tests/proxy_unit_tests/test_proxy_exception_mapping.py"- fork-flag: proxy-db-endpoints-and-responses+ unit-flag: proxy-db-endpoints-and-responsesworkers: 4dist: loadscopetimeout: 15uses: ./.github/workflows/_test-unit-base.ymlwith:test-path: ${{ matrix.test-path }}- fork-flag: ${{ matrix.fork-flag }}+ unit-flag: ${{ matrix.unit-flag }}workers: ${{ matrix.workers }}reruns: 2timeout-minutes: ${{ matrix.timeout }}diff --git a/.github/workflows/test-unit.yml b/.github/workflows/test-unit.ymlindex 126a6e26e6f..a60d230d05f 100644--- a/.github/workflows/test-unit.yml+++ b/.github/workflows/test-unit.yml@@ -36,9 +36,9 @@ concurrency:# Folding it in here is a follow-up, together with generalising that guard into# assert_ci_coverage.py.#-# `fork-flag` names the `.circleci/tests.yml` job that now runs part of the-# shard under the same Codecov flag. CircleCI does not build pull requests from-# forks, so the shard still runs those files there and skips them elsewhere.+# `unit-flag` names the `.circleci/tests.yml` job that now runs part of the+# shard under the same Codecov flag. That pipeline is manual-only while the+# tests migrate, so the shard also runs those files on every event.jobs:unit:name: ${{ matrix.shard }}@@ -53,7 +53,7 @@ jobs:- shard: mcp-integrationartifact-name: mcp-integrationtest-path: "tests/mcp_tests tests/test_litellm/experimental_mcp_client"- fork-flag: mcp-integration+ unit-flag: mcp-integrationworkers: 2reruns: 0timeout-minutes: 20@@ -73,7 +73,7 @@ jobs:tests/test_litellm/google_genaitests/test_litellm/router_utilstests/test_litellm/router_strategy- fork-flag: enterprise-routing+ unit-flag: enterprise-routingworkers: 2reruns: 2timeout-minutes: 20@@ -205,7 +205,7 @@ jobs:tests/test_litellm/proxy/types_utilstests/test_litellm/proxy/logging_endpointstests/test_litellm/proxy/test_*.py- fork-flag: proxy-infra+ unit-flag: proxy-infraworkers: 4reruns: 2timeout-minutes: 20@@ -214,7 +214,7 @@ jobs:- shard: caching-localartifact-name: caching-localtest-path: ""- fork-flag: caching-local+ unit-flag: caching-localworkers: 2reruns: 2timeout-minutes: 20@@ -223,7 +223,7 @@ jobs:- shard: proxy-extrasartifact-name: proxy-extrastest-path: ""- fork-flag: proxy-extras+ unit-flag: proxy-extrasworkers: 2reruns: 2timeout-minutes: 20@@ -232,7 +232,7 @@ jobs:- shard: enterprise-packageartifact-name: enterprise-packagetest-path: ""- fork-flag: enterprise-package+ unit-flag: enterprise-packageworkers: 4reruns: 2timeout-minutes: 20@@ -251,7 +251,7 @@ jobs:uses: ./.github/workflows/_test-unit-base.ymlwith:test-path: ${{ matrix.test-path }}- fork-flag: ${{ matrix.fork-flag || '' }}+ unit-flag: ${{ matrix.unit-flag || '' }}workers: ${{ matrix.workers }}reruns: ${{ matrix.reruns }}timeout-minutes: ${{ matrix.timeout-minutes }}