Skip to content

Test Common w/ multiple OTel versions & add compat with old OTel #4312

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 28 commits into
base: ivana/potel/fix-propagate-scope-false
Choose a base branch
from

Conversation

sentrivana
Copy link
Contributor

@sentrivana sentrivana commented Apr 17, 2025

With the switch to OTel, the Common test suite is now dependent on an otel package, so it technically fits the toxgen usecase. By letting toxgen take care of it, we're making sure we're always testing a good range of otel versions, including the oldest one (to catch regressions) and the newest one (to catch incompatibilities early).

Couple things surfaced in terms of incompatibility with older versions:

Also included:

  • removing the opentelemetry-experimental extra (not used anymore)
  • ❗ switching to using opentelemetry-sdk instead of opentelemetry-distro -- the distro only seems to be setting up some defaults that we're not using

Closes #3241

Copy link

codecov bot commented Apr 17, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.37%. Comparing base (f835a19) to head (752dad5).

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@                          Coverage Diff                           @@
##           ivana/potel/fix-propagate-scope-false    #4312   +/-   ##
======================================================================
  Coverage                                  84.36%   84.37%           
======================================================================
  Files                                        144      144           
  Lines                                      14630    14637    +7     
  Branches                                    2325     2326    +1     
======================================================================
+ Hits                                       12343    12350    +7     
  Misses                                      1561     1561           
  Partials                                     726      726           
Files with missing lines Coverage Δ
sentry_sdk/integrations/__init__.py 89.61% <ø> (ø)
sentry_sdk/opentelemetry/utils.py 82.15% <100.00%> (+0.22%) ⬆️
sentry_sdk/tracing.py 80.00% <100.00%> (+0.28%) ⬆️

... and 2 files with indirect coverage changes

@sentrivana sentrivana changed the title Determine lowest compatible OTel version and integrate in toxgen Test common test suite against a range of opentelemetry-distro version Apr 17, 2025
@sentrivana sentrivana changed the title Test common test suite against a range of opentelemetry-distro version Test common test suite against multiple opentelemetry-distro versions Apr 17, 2025
@@ -70,7 +70,6 @@ def get_file_text(file_name):
"openai": ["openai>=1.0.0", "tiktoken>=0.3.0"],
"openfeature": ["openfeature-sdk>=0.7.1"],
"opentelemetry": ["opentelemetry-distro>=0.35b0"],
"opentelemetry-experimental": ["opentelemetry-distro"],
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is unused now

@sentrivana sentrivana changed the base branch from potel-base to ivana/potel/fix-propagate-scope-false April 17, 2025 10:58
@sentrivana sentrivana changed the title Test common test suite against multiple opentelemetry-distro versions Test common test suite against multiple OTel versions Apr 17, 2025
@sentrivana sentrivana changed the title Test common test suite against multiple OTel versions Test common against multiple OTel versions & add compat with old OTel Apr 17, 2025
@sentrivana sentrivana changed the title Test common against multiple OTel versions & add compat with old OTel Test Common against multiple OTel versions & add compat with old OTel Apr 17, 2025
@sentrivana sentrivana changed the title Test Common against multiple OTel versions & add compat with old OTel Test Common w/ multiple OTel versions & add compat with old OTel Apr 17, 2025
@sentrivana sentrivana marked this pull request as ready for review April 23, 2025 12:08
@sentrivana sentrivana requested a review from a team as a code owner April 23, 2025 12:08
Copy link
Member

@antonpirker antonpirker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one question. otherwise this look good.

gc.disable()
request.addfinalizer(gc.enable)

gc.collect()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moving this line is still necessary, even if we skip this test sometimes?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moving this makes the test suite pass locally on 3.8, so it's still an improvement though not in CI

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.

2 participants