Repository navigation
ci: move caching, proxy-extras, gateway and enterprise tests into tests/unit and run them from litellm-tests #42902
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
1ad9006
0df19f6
3833a4c
c4364ee
d9dd7d6
8f84ef6
372f717
d2054d6
8f8d572
5553b66
f2d1187
d4e2447
715975f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| #!/usr/bin/env bash | ||
| set -euo pipefail | ||
|
|
||
| flag="${1:?usage: unit_selection.sh <codecov flag>}" | ||
|
|
||
| legacy_flags=( | ||
| caching-local | ||
| enterprise-package | ||
| enterprise-routing | ||
| proxy-extras | ||
| proxy-infra | ||
| ) | ||
|
|
||
| legacy_paths() { | ||
| case "$1" in | ||
| caching-local) echo tests/unit/caching ;; | ||
| enterprise-package) | ||
| echo tests/unit/enterprise/integrations | ||
| echo tests/unit/enterprise/proxy/auth | ||
| echo tests/unit/enterprise/proxy/guardrails | ||
| echo tests/unit/enterprise/proxy/hooks | ||
| echo tests/unit/enterprise/proxy/management_endpoints | ||
| echo tests/unit/enterprise/proxy/test_audit_logging_endpoints.py | ||
| echo tests/unit/enterprise/enterprise_callbacks/test_prometheus_logging_callbacks.py ;; | ||
| enterprise-routing) | ||
| echo tests/unit/enterprise/enterprise_callbacks/send_emails | ||
| echo tests/unit/enterprise/proxy/test_afile_retrieve_returns_unified_id.py | ||
| echo tests/unit/enterprise/proxy/test_batch_retrieve_input_file_id.py | ||
| echo tests/unit/enterprise/proxy/test_batch_retrieve_registers_missing_output_file_id.py | ||
| echo tests/unit/enterprise/proxy/test_batch_retrieve_returns_unified_input_file_id.py | ||
| echo tests/unit/enterprise/proxy/test_batch_update_db_managed_output_file_id.py | ||
| echo tests/unit/enterprise/proxy/test_deleted_file_returns_403_not_404.py | ||
| echo tests/unit/enterprise/proxy/test_enterprise_routes.py | ||
| echo tests/unit/enterprise/proxy/test_file_deletion_blocking.py | ||
| echo tests/unit/enterprise/proxy/test_managed_files_access_check.py | ||
| echo tests/unit/enterprise/proxy/test_managed_files_hook.py ;; | ||
| proxy-extras) echo tests/unit/litellm_proxy_extras ;; | ||
| proxy-infra) echo tests/unit/gateway ;; | ||
| *) echo "unit_selection.sh: unknown flag $1" >&2; exit 1 ;; | ||
| esac | ||
| } | ||
|
|
||
| expand() { | ||
| while read -r path; do | ||
| if [ -d "$path" ]; then | ||
| find "$path" -name 'test_*.py' | ||
| elif [ -f "$path" ]; then | ||
| echo "$path" | ||
| else | ||
| echo "unit_selection.sh: $path does not exist" >&2 | ||
| exit 1 | ||
| fi | ||
| done | ||
| } | ||
|
|
||
| if [ "$flag" = unit ]; then | ||
| comm -23 \ | ||
| <(find tests/unit -name 'test_*.py' | sort) \ | ||
| <(for legacy in "${legacy_flags[@]}"; do legacy_paths "$legacy"; done | expand | sort) | ||
| exit 0 | ||
| fi | ||
|
|
||
| legacy_paths "$flag" | expand | sort |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -35,6 +35,10 @@ concurrency: | |
| # already a matrix and carries a shard-coverage guard that reads that file by | ||
| # name. 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. | ||
|
Comment on lines
+39
to
+41
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Context Used: AGENTS.md (source) Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time! |
||
| jobs: | ||
| unit: | ||
| name: ${{ matrix.shard }} | ||
|
|
@@ -65,10 +69,10 @@ jobs: | |
| - shard: enterprise-routing | ||
| artifact-name: enterprise-routing | ||
| test-path: >- | ||
| tests/test_litellm/enterprise | ||
| tests/test_litellm/google_genai | ||
| tests/test_litellm/router_utils | ||
| tests/test_litellm/router_strategy | ||
| fork-flag: enterprise-routing | ||
| workers: 2 | ||
| reruns: 2 | ||
| timeout-minutes: 20 | ||
|
|
@@ -200,35 +204,34 @@ jobs: | |
| tests/test_litellm/proxy/types_utils | ||
| tests/test_litellm/proxy/logging_endpoints | ||
| tests/test_litellm/proxy/test_*.py | ||
| tests/test_gateway | ||
| fork-flag: proxy-infra | ||
| workers: 4 | ||
| reruns: 2 | ||
| timeout-minutes: 20 | ||
| job-timeout-minutes: 60 | ||
|
|
||
| - shard: caching-local | ||
| artifact-name: caching-local | ||
| test-path: >- | ||
| tests/local_testing/test_cache_preset_key.py | ||
| tests/local_testing/test_caching_handler.py | ||
| tests/local_testing/test_responses_stream_cache_keys.py | ||
| tests/local_testing/test_unit_test_caching.py | ||
| test-path: "" | ||
| fork-flag: caching-local | ||
| workers: 2 | ||
| reruns: 2 | ||
| timeout-minutes: 20 | ||
| job-timeout-minutes: 60 | ||
|
|
||
| - shard: proxy-extras | ||
| artifact-name: proxy-extras | ||
| test-path: "tests/litellm-proxy-extras" | ||
| test-path: "" | ||
| fork-flag: proxy-extras | ||
| workers: 2 | ||
| reruns: 2 | ||
| timeout-minutes: 20 | ||
| job-timeout-minutes: 60 | ||
|
|
||
| - shard: enterprise-package | ||
| artifact-name: enterprise-package | ||
| test-path: "tests/enterprise" | ||
| test-path: "" | ||
| fork-flag: enterprise-package | ||
| workers: 4 | ||
| reruns: 2 | ||
| timeout-minutes: 20 | ||
|
|
@@ -247,6 +250,7 @@ jobs: | |
| uses: ./.github/workflows/_test-unit-base.yml | ||
| with: | ||
| test-path: ${{ matrix.test-path }} | ||
| fork-flag: ${{ matrix.fork-flag || '' }} | ||
| workers: ${{ matrix.workers }} | ||
| reruns: ${{ matrix.reruns }} | ||
| timeout-minutes: ${{ matrix.timeout-minutes }} | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.