mirror of
https://github.com/tiennm99/litellm.git
synced 2026-06-18 03:31:23 +00:00
3b5b98327e
GHA doesn't support conditional service containers, so the Postgres container always starts even for Redis-only jobs. Use integration-redis-postgres environment for any workflow with enable-redis so the Postgres container gets valid credentials. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
39 lines
1.2 KiB
YAML
39 lines
1.2 KiB
YAML
name: "Unit Tests: Caching (Redis)"
|
|
|
|
# Uses cloud Redis credentials — only runs on trusted branches, not PRs.
|
|
# This prevents external PRs from accessing Redis credentials.
|
|
on:
|
|
push:
|
|
branches: [main, "litellm_*"]
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
caching-redis:
|
|
uses: ./.github/workflows/_test-unit-services-base.yml
|
|
with:
|
|
# Redis-only tests that do NOT require provider API keys.
|
|
# Tests needing API keys (test_caching.py, test_caching_ssl.py, test_prometheus_service.py,
|
|
# test_router_caching.py) are in Phase 3 integration workflows.
|
|
test-path: >-
|
|
tests/local_testing/test_dual_cache.py
|
|
tests/local_testing/test_redis_batch_optimizations.py
|
|
tests/local_testing/test_router_utils.py
|
|
workers: 2
|
|
reruns: 2
|
|
timeout-minutes: 20
|
|
enable-redis: true
|
|
enable-postgres: false
|
|
secrets:
|
|
REDIS_HOST: ${{ secrets.REDIS_HOST }}
|
|
REDIS_PORT: ${{ secrets.REDIS_PORT }}
|
|
REDIS_PASSWORD: ${{ secrets.REDIS_PASSWORD }}
|
|
DATABASE_URL: ${{ secrets.DATABASE_URL }}
|
|
POSTGRES_USER: ${{ secrets.POSTGRES_USER }}
|
|
POSTGRES_PASSWORD: ${{ secrets.POSTGRES_PASSWORD }}
|