Skip to content

tests(logs): avoid failures when running with integrations enabled #4388

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

Merged

Conversation

rominf
Copy link
Contributor

@rominf rominf commented May 14, 2025

When (at least) one of integrations is enabled (because some dependencies
are installed in the environment), sentry.sdk.name is changed from
sentry.python to sentry.python.[FIRST_ENABLED_INTEGRATION] which
makes test_logs_attributes fail. Prevent failure by relaxing the check.

This change is beneficial not only for packaging (this patch was required
for packaging for Fedora), but also for running tests with pytest
directly.

See also: #4316


Thank you for contributing to sentry-python! Please add tests to validate your changes, and lint your code using tox -e linters.

Running the test suite on your PR might require maintainer approval.

@rominf rominf requested a review from a team as a code owner May 14, 2025 12:01
When (at least) one of integrations is enabled (because some dependencies
are installed in the environment), `sentry.sdk.name` is changed from
`sentry.python` to `sentry.python.[FIRST_ENABLED_INTEGRATION]` which
makes `test_logs_attributes` fail. Prevent failure by relaxing the check.

This change is beneficial not only for packaging (this patch was required
for packaging for Fedora), but also for running tests with `pytest`
directly.

See also: getsentry#4316
@rominf rominf force-pushed the rominf-test-logs-sentry.sdk.name branch from d804713 to 7e10f72 Compare May 17, 2025 07:44
Copy link

codecov bot commented May 17, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.32%. Comparing base (aa0eaab) to head (7e10f72).
Report is 9 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4388      +/-   ##
==========================================
- Coverage   80.32%   80.32%   -0.01%     
==========================================
  Files         142      142              
  Lines       15961    15961              
  Branches     2727     2727              
==========================================
- Hits        12821    12820       -1     
- Misses       2266     2267       +1     
  Partials      874      874              

see 3 files with indirect coverage changes

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.

Looks good! Thanks a lot!

@antonpirker antonpirker merged commit 83e0386 into getsentry:master May 20, 2025
134 of 136 checks passed
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