From 953a0b8706608116d173fff7934f73d12005410a Mon Sep 17 00:00:00 2001 From: moe-berri Date: Sat, 7 Nov 2026 12:26:36 +0800 Subject: [PATCH] ci(coverage): report database integration coverage --- .circleci/scripts/run_integration.sh | 6 +++++- .github/workflows/test-integration.yml | 16 ++++++++++++++++ codecov.yaml | 4 ++++ 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/.circleci/scripts/run_integration.sh b/.circleci/scripts/run_integration.sh index fb91bcce77f..8ce4476f156 100644 --- a/.circleci/scripts/run_integration.sh +++ b/.circleci/scripts/run_integration.sh @@ -246,6 +246,10 @@ fi shared_services=() worker_coverage=() +pytest_coverage=() +if [ "$suite" = database ]; then + pytest_coverage=("PYTEST_ADDOPTS=--cov=litellm --cov-report=xml:$PWD/$results/coverage.xml") +fi if [ "$isolated_workers" = false ]; then shared_services=( "REDIS_HOST=$REDIS_HOST" "REDIS_PORT=$REDIS_PORT" @@ -259,7 +263,7 @@ fi env -i PATH="$PATH" HOME="$HOME" PYTHONPATH="$PYTHONPATH" \ INTEGRATION_RUN_ID="$integration_identity" \ DATABASE_URL="$DATABASE_URL" \ - "${shared_services[@]}" "${worker_coverage[@]}" \ + "${shared_services[@]}" "${worker_coverage[@]}" "${pytest_coverage[@]}" \ INTEGRATION_WORKERS="${INTEGRATION_WORKERS:-1}" \ LITELLM_MODE=PRODUCTION \ "${license_env[@]}" \ diff --git a/.github/workflows/test-integration.yml b/.github/workflows/test-integration.yml index 73159bd64d2..e237d3dfbe5 100644 --- a/.github/workflows/test-integration.yml +++ b/.github/workflows/test-integration.yml @@ -43,6 +43,9 @@ jobs: name: integration ${{ matrix.suite }} if: github.event_name != 'pull_request' || github.event.label.name == 'run-ci' environment: integration-license + permissions: + contents: read + id-token: write runs-on: ${{ fromJSON('{"providers":"ubuntu-latest-64-cores","extensions":"ubuntu-latest-64-cores","accounting":"ubuntu-latest-32-cores","management":"ubuntu-latest-32-cores","management-replica":"ubuntu-latest-32-cores"}')[matrix.suite] || 'ubuntu-latest-16-cores' }} timeout-minutes: 60 strategy: @@ -189,6 +192,19 @@ jobs: SCANNED_SECRET: ${{ secrets.LITELLM_LICENSE }} run: python .github/scripts/assert_secret_absent.py test-results + - name: Upload database coverage to Codecov + if: ${{ !cancelled() && steps.secret-scan.outcome == 'success' && (matrix.suite == 'database' || matrix.suite == 'database-replica') }} + timeout-minutes: 5 + continue-on-error: true + uses: codecov/codecov-action@0fb7174895f61a3b6b78fc075e0cd60383518dac # v5.5.5 + with: + use_oidc: true + files: test-results/integration-${{ matrix.suite }}/coverage.xml + disable_search: true + root_dir: ${{ github.workspace }} + flags: integration-${{ matrix.suite }} + fail_ci_if_error: false + - name: Upload results if: ${{ !cancelled() && steps.secret-scan.outcome == 'success' }} timeout-minutes: 10 diff --git a/codecov.yaml b/codecov.yaml index 521088868bd..5423208b354 100644 --- a/codecov.yaml +++ b/codecov.yaml @@ -34,6 +34,10 @@ flag_management: carryforward: false - name: integrations carryforward: false + - name: integration-database + carryforward: false + - name: integration-database-replica + carryforward: false - name: llm-vertex-ai carryforward: false - name: llm-other-providers