litellm/tests/logging_callback_tests
yuneng-jiang 5e1c5c0bd1
test: move offline proxy auth, hook, spend and pass-through tests to tests/unit (#45568)
* test: move offline proxy auth, guardrail hook, spend, budget reset, GCS payload and pass-through tests into tests/unit

Relocate 53 legacy tests that pass with no network or keys into the tests/unit
files that mirror the code they exercise, drop 2 llm_guard tests already covered
by test_llm_guard_call_type_aliases, and delete the emptied legacy files.

* test: freeze the reset clock and run the real reset methods in the moved budget reset tests

Pin datetime in reset_budget_job and timezone_utils to a fixed instant and await
the service-hook tasks the job spawns instead of sleeping. Drive the per-user
failure with a malformed budget_duration row from the prisma mock so the real
_reset_budget_for_key/user/team run instead of patched replacements.

* test: use fixed timestamps in the moved pass-through and spend log tests

* test: mock the moderation HTTP call and type the moved moderation and spend log tests

Serve the OpenAI moderation response through an httpx MockTransport so the real
async_make_request runs, annotate the moved tests' locals with Final, and pass
get_logging_payload typed kwargs instead of an untyped input_args dict.

* test: drive the moved proxy tests through boundaries and annotate their locals with Final

Serve GCS downloads and the Router moderation call through httpx mocks with fake
Google credentials, let the real pass-through success handler fail on the mocked
upstream response, and fold the Vertex live route endpoint check into the existing
route test. Annotate moved locals with Final, build the budget reset rows without
rebinding, and type the remaining fakes without **kwargs
2026-10-09 09:49:13 -07:00
..
gcs_pub_sub_body test(ci): pin the ROI estimator flag and the prompt-cache counter in two drifted tests (#44499) 2026-10-04 08:40:23 -07:00
langfuse_expected_request_body feat(langfuse): migrate the sdk callback to langfuse v4 (#36741) 2026-09-24 23:22:56 -07:00
base_test.py test: remove dead imports and helpers left behind by legacy test deletion (#45208) 2026-10-07 18:04:17 -07:00
conftest.py test(logging): drain the logging worker after each logging callback test so no later test inherits its events (#43344) 2026-09-26 14:08:26 -07:00
create_mock_standard_logging_payload.py test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -07:00
gettysburg.wav (Testing) - Add e2e testing for langfuse logging with tags (#7922) 2025-01-22 09:09:25 -08:00
log.txt test: update test 2025-04-10 14:04:57 -07:00
logging_worker_drain_canary.py test(logging): drain the logging worker after each logging callback test so no later test inherits its events (#43344) 2026-09-26 14:08:26 -07:00
test_bedrock_knowledgebase_hook.py test: replace 61 live logging and otel tests with offline unit and integration coverage (#45362) 2026-10-08 15:55:57 -07:00
test_gcs_pub_sub.py fix(proxy): bound client x-litellm-call-id, open log deep links by call id, prefer exact request_id rows 2026-09-02 15:45:55 -07:00
test_langfuse_e2e_test.py refactor: expose core private helpers under public names (#44871) 2026-10-07 00:05:27 +00:00
test_langfuse_unit_tests.py test: move offline logging, secret manager and provider tests from legacy dirs into tests/unit (#45554) 2026-10-09 09:48:10 -07:00
test_log_db_redis_services.py test: replace 61 live logging and otel tests with offline unit and integration coverage (#45362) 2026-10-08 15:55:57 -07:00
test_logging_worker_drain.py test(logging): drain the logging worker after each logging callback test so no later test inherits its events (#43344) 2026-09-26 14:08:26 -07:00
test_pagerduty_alerting.py test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -07:00
test_sqs_logger.py test: move offline logging, secret manager and provider tests from legacy dirs into tests/unit (#45554) 2026-10-09 09:48:10 -07:00