Skip to content

[Infra] Migrate Redis caching tests from GHA to CircleCI - #25354

Merged
shin-berri merged 3 commits into
mainfrom
litellm_migrate_redis_tests_to_circleci
Apr 8, 2026
Merged

[Infra] Migrate Redis caching tests from GHA to CircleCI#25354
shin-berri merged 3 commits into
mainfrom
litellm_migrate_redis_tests_to_circleci

Conversation

@yuneng-berri

Copy link
Copy Markdown
Contributor

Summary

Redis caching unit tests required cloud Redis credentials (REDIS_HOST, REDIS_PORT, REDIS_PASSWORD) which should live in CircleCI rather than GHA. This PR moves those tests to CircleCI and removes all Redis secret plumbing from GHA.

Changes

  • Added redis_caching_unit_tests job to .circleci/config.yml running the same 3 test files: test_dual_cache.py, test_redis_batch_optimizations.py, test_router_utils.py
  • Deleted .github/workflows/test-unit-caching-redis.yml
  • Removed Redis inputs, secrets, and env vars from _test-unit-services-base.yml
  • Removed enable-redis: false from test-unit-proxy-db.yml and test-unit-security.yml

Testing

  • CircleCI job mirrors the GHA config: 2 parallel workers, 2 reruns, 20m timeout
  • Coverage is collected and fed into the existing upload-coverage job

Type

🚄 Infrastructure

Redis caching unit tests (test_dual_cache, test_redis_batch_optimizations,
test_router_utils) required Redis secrets that should live in CircleCI.

- Add redis_caching_unit_tests job to CircleCI config
- Delete test-unit-caching-redis.yml GHA workflow
- Remove all Redis plumbing (inputs, secrets, env vars) from
  _test-unit-services-base.yml and its callers
@yuneng-berri
yuneng-berri requested a review from a team April 8, 2026 16:07
@vercel

vercel Bot commented Apr 8, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
litellm Ready Ready Preview, Comment Apr 8, 2026 6:51pm

Request Review

@greptile-apps

greptile-apps Bot commented Apr 8, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR migrates three Redis caching test files (test_dual_cache.py, test_redis_batch_optimizations.py, test_router_utils.py) from a GitHub Actions workflow to a new CircleCI job (redis_caching_unit_tests), removes all Redis secret plumbing from GHA, and wires the new job into the existing coverage-upload pipeline. The migration is structurally sound: project-level CircleCI env vars (REDIS_HOST, REDIS_PORT, REDIS_PASSWORD) are automatically available to all jobs without needing an explicit context or -e injection.

Confidence Score: 5/5

Safe to merge — clean infra migration with no logic changes and correct coverage wiring.

All findings are P2 or below. The migration faithfully replicates the GHA job structure in CircleCI, correctly threads coverage artifacts through the upload-coverage job, and removes Redis secret plumbing from GHA without leaving any dangling references. No production code is touched.

No files require special attention.

Vulnerabilities

No security concerns identified. Redis credentials (REDIS_HOST, REDIS_PORT, REDIS_PASSWORD) are correctly moved out of GHA (where they lived in a scoped environment) to CircleCI project-level env vars, which are not exposed to untrusted fork PRs. The new job runs only on main and litellm_* branches, matching the security posture of the deleted GHA workflow.

Important Files Changed

Filename Overview
.circleci/config.yml Adds redis_caching_unit_tests job and wires it into the upload-coverage pipeline; coverage combine and requires list are correctly updated.
.github/workflows/_test-unit-services-base.yml Cleanly removes enable-redis input, Redis secrets, and the integration-redis-postgres environment; remaining logic is correct.
.github/workflows/test-unit-caching-redis.yml File deleted — functionality moved to CircleCI; deletion is intentional and correct.
.github/workflows/test-unit-proxy-db.yml Removes now-deleted enable-redis: false flag; no functional impact since the default was already false.
.github/workflows/test-unit-security.yml Removes now-deleted enable-redis: false flag; no functional impact.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Push to main / litellm_*] --> B[GHA Workflows]
    A --> C[CircleCI Workflow]

    B --> D[test-unit-proxy-db]
    B --> E[test-unit-security]
    B --> F[~~test-unit-caching-redis~~\nDELETED]

    C --> G[redis_caching_unit_tests]
    G --> H[test_dual_cache.py]
    G --> I[test_redis_batch_optimizations.py]
    G --> J[test_router_utils.py]
    G --> K[persist redis_caching_coverage]

    K --> L[upload-coverage\ncoverage combine ...]

    style F fill:#ffcccc,stroke:#cc0000
    style G fill:#ccffcc,stroke:#00aa00
Loading

Reviews (3): Last reviewed commit: "[Fix] Install pytest-rerunfailures in re..." | Re-trigger Greptile

Comment thread .circleci/config.yml
Comment on lines +1360 to +1367
python -m pytest -vv \
tests/local_testing/test_dual_cache.py \
tests/local_testing/test_redis_batch_optimizations.py \
tests/local_testing/test_router_utils.py \
--cov=litellm --cov-report=xml \
-x -s -v --junitxml=test-results/junit.xml \
--durations=5 -n 2 \
--reruns 2 --reruns-delay 1

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Redundant verbosity flags

The command specifies both -vv (extra verbose) at the start and -v (verbose) further along. Since -vv is a superset of -v, the trailing -v is redundant. Compare with other jobs in the same file (e.g. audio_testing at line 1317) which use only -vv.

Suggested change
python -m pytest -vv \
tests/local_testing/test_dual_cache.py \
tests/local_testing/test_redis_batch_optimizations.py \
tests/local_testing/test_router_utils.py \
--cov=litellm --cov-report=xml \
-x -s -v --junitxml=test-results/junit.xml \
--durations=5 -n 2 \
--reruns 2 --reruns-delay 1
python -m pytest -vv \
tests/local_testing/test_dual_cache.py \
tests/local_testing/test_redis_batch_optimizations.py \
tests/local_testing/test_router_utils.py \
--cov=litellm --cov-report=xml \
-x -s --junitxml=test-results/junit.xml \
--durations=5 -n 2 \
--reruns 2 --reruns-delay 1

@codspeed-hq

codspeed-hq Bot commented Apr 8, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 16 untouched benchmarks


Comparing litellm_migrate_redis_tests_to_circleci (7ba0c69) with main (2dac54b)

Open in CodSpeed

@shin-berri
shin-berri self-requested a review April 8, 2026 22:14
@shin-berri
shin-berri merged commit d871bce into main Apr 8, 2026
100 of 106 checks passed
@shin-berri
shin-berri deleted the litellm_migrate_redis_tests_to_circleci branch April 8, 2026 22:14
Chesars added a commit that referenced this pull request Apr 16, 2026
Resolved conflicts:
- streaming_handler.py: combined role check (PR #24354, Azure streaming)
  with reasoning_items check (new in main) — both are independent OR
  conditions in is_chunk_non_empty()
- CI/CD: accepted main's versions throughout
  - Redis tests migrated to CircleCI (PR #25354): removed enable-redis
    from GH Actions workflows
  - E2E UI tests restructured (PR #25365): simplified CircleCI job
  - Coverage via Codecov added to all GH Actions unit test workflows
  - Deleted test-litellm-matrix.yml and test-proxy-e2e-azure-batches.yml
    (removed in main)
fzowl pushed a commit to fzowl/litellm that referenced this pull request Jun 24, 2026
…ests_to_circleci

[Infra] Migrate Redis caching tests from GHA to CircleCI
fzowl pushed a commit to fzowl/litellm that referenced this pull request Jun 24, 2026
Resolved conflicts:
- streaming_handler.py: combined role check (PR BerriAI#24354, Azure streaming)
  with reasoning_items check (new in main) — both are independent OR
  conditions in is_chunk_non_empty()
- CI/CD: accepted main's versions throughout
  - Redis tests migrated to CircleCI (PR BerriAI#25354): removed enable-redis
    from GH Actions workflows
  - E2E UI tests restructured (PR BerriAI#25365): simplified CircleCI job
  - Coverage via Codecov added to all GH Actions unit test workflows
  - Deleted test-litellm-matrix.yml and test-proxy-e2e-azure-batches.yml
    (removed in main)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants