diff --git a/.circleci/scripts/run_integration.sh b/.circleci/scripts/run_integration.sh index 1380b07de53..211572dd77f 100644 --- a/.circleci/scripts/run_integration.sh +++ b/.circleci/scripts/run_integration.sh @@ -256,6 +256,7 @@ fi env -i PATH="$PATH" HOME="$HOME" PYTHONPATH="$PYTHONPATH" \ INTEGRATION_RUN_ID="$integration_identity" \ + PYTEST_ADDOPTS="${PYTEST_ADDOPTS:-}" \ DATABASE_URL="$DATABASE_URL" \ "${shared_services[@]}" "${worker_coverage[@]}" \ INTEGRATION_WORKERS="${INTEGRATION_WORKERS:-1}" \ diff --git a/.github/workflows/test-integration.yml b/.github/workflows/test-integration.yml index 73159bd64d2..9352482adc7 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: @@ -150,6 +153,7 @@ jobs: timeout-minutes: 45 env: SUITE: ${{ matrix.suite }} + PYTEST_ADDOPTS: ${{ matrix.suite == 'database' && '--cov=litellm.proxy.db.accounting_ledger --cov=litellm.proxy.spend_tracking.cost_compiler --cov-branch --cov-report=xml:test-results/accounting-coverage.xml' || '' }} INTEGRATION_POSTGRES_CONTAINER: ${{ job.services.postgres.id }} INTEGRATION_REDIS_CONTAINER: ${{ job.services.redis.id }} LITELLM_LICENSE: ${{ secrets.LITELLM_LICENSE }} @@ -159,6 +163,16 @@ jobs: *) bash .circleci/scripts/run_integration.sh "$SUITE" ;; esac + - name: Upload accounting ledger integration coverage + if: ${{ !cancelled() && matrix.suite == 'database' && hashFiles('test-results/accounting-coverage.xml') != '' }} + uses: codecov/codecov-action@0fb7174895f61a3b6b78fc075e0cd60383518dac # v5.5.5 + with: + use_oidc: true + files: test-results/accounting-coverage.xml + disable_search: true + flags: accounting-ledger + fail_ci_if_error: true + - name: Verify every case ran exactly once if: ${{ !cancelled() && matrix.suite != 'browser' }} timeout-minutes: 2 diff --git a/codecov.yaml b/codecov.yaml index 521088868bd..d777602525d 100644 --- a/codecov.yaml +++ b/codecov.yaml @@ -20,6 +20,8 @@ flag_management: # the stale line maps mark comment lines of since-edited files as missed, # sinking patch coverage on unrelated PRs. individual_flags: + - name: accounting-ledger + carryforward: false - name: proxy-mgmt-behavior carryforward: false - name: security