test(logging): pin compression_savings in the gcs pubsub spend log fixture - #34204
Merged
yuneng-berri merged 1 commit intoJul 22, 2026
Merged
Conversation
…xture The spend-log metadata schema gained a compression_savings key, so the gcs pubsub v1 payload now carries it. The golden fixture was never updated, and the comparator flags any key present in the payload but absent from the fixture, so test_async_gcs_pub_sub_v1 failed on every run. Pin the key as null rather than adding it to ignored_keys; the value is deterministic on this path, so ignoring it would leave the assertion blind to the field entirely.
Contributor
Greptile SummaryThis PR updates the GCS Pub/Sub v1 spend-log fixture to match the emitted metadata shape. The main change is:
Confidence Score: 5/5This looks safe to merge.
|
| Filename | Overview |
|---|---|
| tests/logging_callback_tests/gcs_pub_sub_body/spend_logs_payload.json | Adds the deterministic null expectation for compression_savings without weakening the fixture comparison |
Reviews (1): Last reviewed commit: "test(logging): pin compression_savings i..." | Re-trigger Greptile
ryan-crabbe-berri
approved these changes
Jul 22, 2026
yuneng-berri
enabled auto-merge (squash)
July 22, 2026 00:49
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Relevant issues
Linear ticket
Pre-Submission checklist
Please complete all items before asking a LiteLLM maintainer to review your PR
@greptileaito re-request a review after pushing changes)Delays in PR merge?
If you're seeing a delay in your PR being merged, ping the LiteLLM Team on Slack (#pr-review).
Screenshots / Proof of Fix
This is a test-only change to a golden fixture, so there is no runtime behavior to exercise against a live proxy; the emitted payload is already correct on staging and only the expectation file was behind. The meaningful evidence is the test going red before and green after, at the two commits below
Before, fixture at
e7b9357bc2(staging tip merged into this branch, without the fix):After, fixture at
7ef380fa3c(this PR):Type
✅ Test
Changes
test_async_gcs_pub_sub_v1has been failing on every run in thelogging_testingCircleCI job. It is not flaky; the golden fixture is stale#33810 added a
compression_savingskey toSpendLogsMetadata, which is the schema that defines the spend-log metadata JSON._get_spend_logs_metadatabuildsclean_metadatafromSpendLogsMetadata.__annotations__, so every field declared there is emitted by construction, and the GCS pubsub v1 path publishes theSpendLogsPayloadverbatim. The new key therefore shows up in the published message by design. That PR updated the other spend-log fixtures, including the inline metadata strings intest_spend_management_endpoints.py, but missedgcs_pub_sub_body/spend_logs_payload.json. The comparator in this test flags any key present in the actual payload but absent from the expected file, so it fails deterministicallyThis pins
compression_savingsas null in the fixture rather than adding it toignored_keys. The precedent in this file is the latter;metadata.litellm_call_idwas ignored when it was introduced. That was the right call there because the value is a random UUID and cannot be pinned.compression_savingsis deterministic on this path, so ignoring it would leave the assertion permanently blind to the field, whereas pinning it keeps both directions of the comparison meaningful: the test now fails if the key is dropped from the payload as well as if it changes shapeFinal Attestation