…l harness (#43282)
* test(integration): port langfuse callbacks-in-db coverage to the local harness
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
* test(integration): assert the langfuse db rows after the exported span
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
---------
Co-authored-by: yuneng <yuneng@berri.ai>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
(cherry picked from commit e11c3f5)
TLDR
Problem this solves:
rc/1.104.0still carries the Railway-backedtest_e2e_langfuse_callbacks_in_db, red on every runHow it solves it:
git cherry-pick -x e11c3f5815b54a3bf76ace48bfead4f2bf0f8da0, the squash commit of test(integration): port langfuse callbacks-in-db coverage to the local harness #43282, ontorc/1.104.0git diff e11c3f58 HEAD -- tests/is empty for the two touched filesUser Flow
Before: an admin on the rc line turns Langfuse on at runtime and the suite guarding this path is red for reasons unrelated to the proxy
success_callback: ["langfuse"]andLANGFUSE_*env vars and get 200chatcmpl-...idhttps://exampleopenaiendpoint-production-c715.up.railway.app/langfuse/trace/<id>, which always answers{"exists": false}, so the job is redAfter: the same runtime configuration is proven against a local Langfuse fake in the integration suite
chatcmpl-...id/api/public/otel/v1/tracescarrying agenerationobservation whoseresponse_idmetadata equals that id, authenticated with the keys from step 1, with no provider or virtual key in the payloadPre-Submission checklist
Please complete all items before asking a LiteLLM maintainer to review your PR
uv run pytest tests/test_litellm/<your_test_file>.py -v. Leave the suites (make test-unit-*,make test-unit) to CI: it finishes in ~15 minutes where a laptop takes an hour or more@greptileaito re-request a review after pushing changes)Screenshots / Proof of Fix
Tests-only backport, so the proof is the pick applying cleanly and the ported test green on the rc line. The full Before and After legs, including the two mutation runs, are in #43282
Shared setup: integration Postgres and Redis from
.circleci/scripts/run_integration.sh, scripted upstream on 8190, integration proxy on 4000 booted from this branchBefore (rc/1.104.0 tip)
curl -s -o /dev/null -w '%{http_code}' -X POST https://exampleopenaiendpoint-production-c715.up.railway.app/api/public/otel/v1/traces -H 'content-type: application/x-protobuf' --data-binary ''prints404: the mock the legacy test depends on has no v4 OTLP ingest route, sotest_e2e_langfuse_callbacks_in_dbcannot passAfter (5acdc1a)
git cherry-pick -x e11c3f5815b54a3bf76ace48bfead4f2bf0f8da0applies with no conflicts and the commit carries(cherry picked from commit e11c3f5815b54a3bf76ace48bfead4f2bf0f8da0)pytest tests/integration/observability/test_langfuse_delivery.py -k stored_in_the_db:1 passed, 2 deselected in 14.79sSELECT param_name, param_value FROM "LiteLLM_Config" WHERE param_name IN ('litellm_settings', 'environment_variables')before and after both print(0 rows),diffis emptyruff check --config ruff-tests.tomlon the test file:All checks passed!;basedpyright:0 errors, 0 warnings, 0 notesType
✅ Test
Final Attestation
Link to Devin session: https://app.devin.ai/sessions/e8a4cf844b854f00ac366862831d87f2
Open in Devin Desktop: https://app.devin.ai/desktop/session/e8a4cf844b854f00ac366862831d87f2?variant=devin