Skip to content

ref(tests): Replace custom envelopes_to_x helpers with capture_items#6233

Merged
sentrivana merged 2 commits intomasterfrom
ivana/use-capture-items-more
May 7, 2026
Merged

ref(tests): Replace custom envelopes_to_x helpers with capture_items#6233
sentrivana merged 2 commits intomasterfrom
ivana/use-capture-items-more

Conversation

@sentrivana
Copy link
Copy Markdown
Contributor

@sentrivana sentrivana commented May 7, 2026

We had multiple envelopes_to_x helpers around in tests for unwrapping metrics, logs, and spans. Replace them all with capture_items, which has the added benefit of being more true to the actual payload leaving the SDK, unlike envelopes_to_x, which used to modify some fields (setting them to None if they were not present, for instance).

Remove envelopes_to_spans, envelopes_to_metrics, envelopes_to_logs, and
otel_attributes_to_dict in favor of the capture_items conftest fixture.
Update capture_items to handle "trace_metric" item type.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 7, 2026

Codecov Results 📊

1871 passed | ⏭️ 341 skipped | Total: 2212 | Pass Rate: 84.58% | Execution Time: 2m 57s

📊 Comparison with Base Branch

Metric Change
Total Tests 📉 -131
Passed Tests 📉 -318
Failed Tests
Skipped Tests 📈 +187

All tests are passing successfully.

✅ Patch coverage is 100.00%. Project has 12988 uncovered lines.
❌ Project coverage is 40.33%. Comparing base (base) to head (head).

Coverage diff
@@            Coverage Diff             @@
##          main       #PR       +/-##
==========================================
- Coverage    41.86%    40.33%    -1.53%
==========================================
  Files          190       190         —
  Lines        21890     21768      -122
  Branches      7364      7688      +324
==========================================
+ Hits          9163      8780      -383
- Misses       12727     12988      +261
- Partials       466       454       -12

Generated by Codecov Action

@sentrivana sentrivana changed the title ref(tests): Replace envelopes_to_x helpers with capture_items fixture ref(tests): Replace custom envelopes_to_x helpers with capture_items May 7, 2026
@sentrivana sentrivana marked this pull request as ready for review May 7, 2026 09:26
@sentrivana sentrivana requested a review from a team as a code owner May 7, 2026 09:26
@sentrivana sentrivana enabled auto-merge (squash) May 7, 2026 11:20
@sentrivana sentrivana merged commit 0784b92 into master May 7, 2026
156 checks passed
@sentrivana sentrivana deleted the ivana/use-capture-items-more branch May 7, 2026 11:20
cla7aye15I4nd pushed a commit to cla7aye15I4nd/sentry-python that referenced this pull request May 7, 2026
…ms` (getsentry#6233)

We had multiple `envelopes_to_x` helpers around in tests for unwrapping
metrics, logs, and spans. Replace them all with `capture_items`, which
has the added benefit of being more true to the actual payload leaving
the SDK, unlike `envelopes_to_x`, which used to modify some fields
(setting them to `None` if they were not present, for instance).

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants