Skip to content

[do not merge] Testing merge - #7704

Closed
sentrivana wants to merge 4 commits into
major/3.0from
ivana/major/test-merge-4
Closed

sentrivana wants to merge 4 commits into
major/3.0from
ivana/major/test-merge-4

Conversation

@sentrivana

Copy link
Copy Markdown
Contributor

No description provided.

pabloDeputter and others added 4 commits September 23, 2026 17:07
- ignore everything except `index.py` and `.gitignore` itself.
- avoids having dependencies and files generated by tests showing up as
untracked.
### Description

Multiple user callback fixes:
- Emit client reports with reason `callback_error`
([docs](https://develop.sentry.dev/sdk/telemetry/client-reports/#discard-reasons-1))
when telemetry is dropped because of an error in a user callback
- This was missing for `before_send`, `before_send_transaction`,
`before_send_metric`, `before_send_log`
- Emit client reports with reason `before_send` if a log or a metric is
explicitly dropped in `before_send_metric`/`before_send_log` by
returning `None`
- Isolate `profiles_sampler` errors in `capture_internal_exceptions`
- Isolate `error_processor` errors in `capture_internal_exceptions`
- Event and error processors used to let the event go through if an
error occurred. Now they'll drop the event as per spec.

#### Issues
Closes
https://linear.app/getsentry/issue/PY-2763/adhere-to-user-callback-error-spec
As this is technically a breaking change and we have a major around the
corner, let's do it there. Reverting this change on master.
@sentrivana sentrivana closed this Sep 24, 2026
@sentrivana
sentrivana deleted the ivana/major/test-merge-4 branch September 24, 2026 13:19
@github-actions

Copy link
Copy Markdown
Contributor

Codecov Results 📊

62404 passed | ❌ 18 failed | ⏭️ 2890 skipped | Total: 65312 | Pass Rate: 95.55% | Execution Time: 174m 11s

📊 Comparison with Base Branch

Metric Change
Total Tests 📉 -71742
Passed Tests 📉 -67498
Failed Tests 📈 +18
Skipped Tests 📉 -4262

➕ New Tests (18)

View new tests
  • test_traces_sampler_exception_falls_back
    • File: tests.tracing.test_span_streaming
    • Status: ❌ Failing
  • test_traces_sampler_exception_falls_back
    • File: tests.tracing.test_span_streaming
    • Status: ❌ Failing
  • test_input_attributes_nonstreaming_chat[True-messages0-expected_system_instructions0-expected_input_messages0]
    • File: tests.integrations.mistral.test_mistral
    • Status: ❌ Failing
  • test_traces_sampler_exception_falls_back
    • File: tests.tracing.test_span_streaming
    • Status: ❌ Failing
  • test_traces_sampler_exception_falls_back
    • File: tests.tracing.test_span_streaming
    • Status: ❌ Failing
  • test_traces_sampler_exception_falls_back
    • File: tests.tracing.test_span_streaming
    • Status: ❌ Failing
  • test_traces_sampler_exception_falls_back
    • File: tests.tracing.test_span_streaming
    • Status: ❌ Failing
  • test_traces_sampler_exception_falls_back
    • File: tests.tracing.test_span_streaming
    • Status: ❌ Failing
  • test_traces_sampler_exception_falls_back
    • File: tests.tracing.test_span_streaming
    • Status: ❌ Failing
  • test_cache_spans_item_size
    • File: tests.integrations.django.test_cache_module
    • Status: ❌ Failing
  • test_traces_sampler_exception_falls_back
    • File: tests.tracing.test_span_streaming
    • Status: ❌ Failing
  • test_traces_sampler_exception_falls_back
    • File: tests.tracing.test_span_streaming
    • Status: ❌ Failing
  • test_traces_sampler_exception_falls_back
    • File: tests.tracing.test_span_streaming
    • Status: ❌ Failing
  • test_traces_sampler_exception_falls_back
    • File: tests.tracing.test_span_streaming
    • Status: ❌ Failing
  • test_traces_sampler_exception_falls_back
    • File: tests.tracing.test_span_streaming
    • Status: ❌ Failing
  • test_traces_sampler_exception_falls_back
    • File: tests.tracing.test_span_streaming
    • Status: ❌ Failing
  • test_traces_sampler_exception_falls_back
    • File: tests.tracing.test_span_streaming
    • Status: ❌ Failing
  • test_traces_sampler_exception_falls_back
    • File: tests.tracing.test_span_streaming
    • Status: ❌ Failing

❌ Failed Tests

test_traces_sampler_exception_falls_back

File: tests.tracing.test_span_streaming
Suite: py3.10-common
Error: TypeError: Unknown option 'trace_lifecycle'

Stack Trace
tests/tracing/test_span_streaming.py:474: in test_traces_sampler_exception_falls_back
    sentry_init(
tests/conftest.py:349: in inner
    client = sentry_sdk.Client(*a, **kw)
sentry_sdk/client.py:277: in __init__
    super(_Client, self).__init__(options=get_options(*args, **kwargs))
sentry_sdk/client.py:106: in _get_options
    raise TypeError("Unknown option %r" % (key,))
E   TypeError: Unknown option 'trace_lifecycle'

test_traces_sampler_exception_falls_back

File: tests.tracing.test_span_streaming
Suite: py3.10-gevent
Error: TypeError: Unknown option 'trace_lifecycle'

Stack Trace
tests/tracing/test_span_streaming.py:474: in test_traces_sampler_exception_falls_back
    sentry_init(
tests/conftest.py:349: in inner
    client = sentry_sdk.Client(*a, **kw)
sentry_sdk/client.py:277: in __init__
    super(_Client, self).__init__(options=get_options(*args, **kwargs))
sentry_sdk/client.py:106: in _get_options
    raise TypeError("Unknown option %r" % (key,))
E   TypeError: Unknown option 'trace_lifecycle'

test_input_attributes_nonstreaming_chat[True-messages0-expected_system_instructions0-expected_input_messages0]

File: tests.integrations.mistral.test_mistral
Suite: py3.10-mistral-v2.0.5
Error: KeyError: 140287984636352

Stack Trace
tests/integrations/mistral/test_mistral.py:380: in test_input_attributes_nonstreaming_chat
    sentry_init(
tests/conftest.py:349: in inner
    client = sentry_sdk.Client(*a, **kw)
sentry_sdk/client.py:278: in __init__
    self._init_impl()
sentry_sdk/client.py:428: in _init_impl
    self.integrations = setup_integrations(
sentry_sdk/integrations/__init__.py:216: in setup_integrations
    for integration_cls in iter_default_integrations(
sentry_sdk/integrations/__init__.py:44: in iter_default_integrations
    yield getattr(import_module(module), cls)
/usr/lib/python3.10/importlib/__init__.py:126: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
<frozen importlib._bootstrap>:1050: in _gcd_import
    ???
<frozen importlib._bootstrap>:1024: in _find_and_load
    ???
<frozen importlib._bootstrap>:171: in __enter__
    ???
<frozen importlib._bootstrap>:123: in acquire
    ???
E   KeyError: 140287984636352

test_traces_sampler_exception_falls_back

File: tests.tracing.test_span_streaming
Suite: py3.11-common
Error: TypeError: Unknown option 'trace_lifecycle'

Stack Trace
tests/tracing/test_span_streaming.py:474: in test_traces_sampler_exception_falls_back
    sentry_init(
tests/conftest.py:349: in inner
    client = sentry_sdk.Client(*a, **kw)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^
sentry_sdk/client.py:277: in __init__
    super(_Client, self).__init__(options=get_options(*args, **kwargs))
                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
sentry_sdk/client.py:106: in _get_options
    raise TypeError("Unknown option %r" % (key,))
E   TypeError: Unknown option 'trace_lifecycle'

test_traces_sampler_exception_falls_back

File: tests.tracing.test_span_streaming
Suite: py3.11-gevent
Error: TypeError: Unknown option 'trace_lifecycle'

Stack Trace
tests/tracing/test_span_streaming.py:474: in test_traces_sampler_exception_falls_back
    sentry_init(
tests/conftest.py:349: in inner
    client = sentry_sdk.Client(*a, **kw)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^
sentry_sdk/client.py:277: in __init__
    super(_Client, self).__init__(options=get_options(*args, **kwargs))
                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
sentry_sdk/client.py:106: in _get_options
    raise TypeError("Unknown option %r" % (key,))
E   TypeError: Unknown option 'trace_lifecycle'

test_traces_sampler_exception_falls_back

File: tests.tracing.test_span_streaming
Suite: py3.12-common
Error: TypeError: Unknown option 'trace_lifecycle'

Stack Trace
tests/tracing/test_span_streaming.py:474: in test_traces_sampler_exception_falls_back
    sentry_init(
tests/conftest.py:349: in inner
    client = sentry_sdk.Client(*a, **kw)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^
sentry_sdk/client.py:277: in __init__
    super(_Client, self).__init__(options=get_options(*args, **kwargs))
                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
sentry_sdk/client.py:106: in _get_options
    raise TypeError("Unknown option %r" % (key,))
E   TypeError: Unknown option 'trace_lifecycle'

test_traces_sampler_exception_falls_back

File: tests.tracing.test_span_streaming
Suite: py3.12-gevent
Error: TypeError: Unknown option 'trace_lifecycle'

Stack Trace
tests/tracing/test_span_streaming.py:474: in test_traces_sampler_exception_falls_back
    sentry_init(
tests/conftest.py:349: in inner
    client = sentry_sdk.Client(*a, **kw)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^
sentry_sdk/client.py:277: in __init__
    super(_Client, self).__init__(options=get_options(*args, **kwargs))
                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
sentry_sdk/client.py:106: in _get_options
    raise TypeError("Unknown option %r" % (key,))
E   TypeError: Unknown option 'trace_lifecycle'

test_traces_sampler_exception_falls_back

File: tests.tracing.test_span_streaming
Suite: py3.13-common
Error: TypeError: Unknown option 'trace_lifecycle'

Stack Trace
tests/tracing/test_span_streaming.py:474: in test_traces_sampler_exception_falls_back
    sentry_init(
tests/conftest.py:349: in inner
    client = sentry_sdk.Client(*a, **kw)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^
sentry_sdk/client.py:277: in __init__
    super(_Client, self).__init__(options=get_options(*args, **kwargs))
                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
sentry_sdk/client.py:106: in _get_options
    raise TypeError("Unknown option %r" % (key,))
E   TypeError: Unknown option 'trace_lifecycle'

test_traces_sampler_exception_falls_back

File: tests.tracing.test_span_streaming
Suite: py3.14-common
Error: TypeError: Unknown option 'trace_lifecycle'

Stack Trace
tests/tracing/test_span_streaming.py:474: in test_traces_sampler_exception_falls_back
    sentry_init(
tests/conftest.py:349: in inner
    client = sentry_sdk.Client(*a, **kw)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^
sentry_sdk/client.py:277: in __init__
    super(_Client, self).__init__(options=get_options(*args, **kwargs))
                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
sentry_sdk/client.py:106: in _get_options
    raise TypeError("Unknown option %r" % (key,))
E   TypeError: Unknown option 'trace_lifecycle'

test_cache_spans_item_size

File: tests.integrations.django.test_cache_module
Suite: py3.14-django-v5.2.17
Error: tests/integrations/django/test_cache_module.py:546: in test_cache_spans_item_size assert not spans[0]["attributes"]["cache.hit"] E assert not True

Stack Trace
tests/integrations/django/test_cache_module.py:546: in test_cache_spans_item_size
    assert not spans[0]["attributes"]["cache.hit"]
E   assert not True

test_traces_sampler_exception_falls_back

File: tests.tracing.test_span_streaming
Suite: py3.14t-common
Error: TypeError: Unknown option 'trace_lifecycle'

Stack Trace
tests/tracing/test_span_streaming.py:474: in test_traces_sampler_exception_falls_back
    sentry_init(
tests/conftest.py:349: in inner
    client = sentry_sdk.Client(*a, **kw)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^
sentry_sdk/client.py:277: in __init__
    super(_Client, self).__init__(options=get_options(*args, **kwargs))
                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
sentry_sdk/client.py:106: in _get_options
    raise TypeError("Unknown option %r" % (key,))
E   TypeError: Unknown option 'trace_lifecycle'

test_traces_sampler_exception_falls_back

File: tests.tracing.test_span_streaming
Suite: py3.15-common
Error: TypeError: Unknown option 'trace_lifecycle'

Stack Trace
tests/tracing/test_span_streaming.py:474: in test_traces_sampler_exception_falls_back
    sentry_init(
tests/conftest.py:349: in inner
    client = sentry_sdk.Client(*a, **kw)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^
sentry_sdk/client.py:277: in __init__
    super(_Client, self).__init__(options=get_options(*args, **kwargs))
                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
sentry_sdk/client.py:106: in _get_options
    raise TypeError("Unknown option %r" % (key,))
E   TypeError: Unknown option 'trace_lifecycle'

test_traces_sampler_exception_falls_back

File: tests.tracing.test_span_streaming
Suite: py3.15t-common
Error: TypeError: Unknown option 'trace_lifecycle'

Stack Trace
tests/tracing/test_span_streaming.py:474: in test_traces_sampler_exception_falls_back
    sentry_init(
tests/conftest.py:349: in inner
    client = sentry_sdk.Client(*a, **kw)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^
sentry_sdk/client.py:277: in __init__
    super(_Client, self).__init__(options=get_options(*args, **kwargs))
                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
sentry_sdk/client.py:106: in _get_options
    raise TypeError("Unknown option %r" % (key,))
E   TypeError: Unknown option 'trace_lifecycle'

test_traces_sampler_exception_falls_back

File: tests.tracing.test_span_streaming
Suite: py3.7-common
Error: TypeError: Unknown option 'trace_lifecycle'

Stack Trace
tests/tracing/test_span_streaming.py:477: in test_traces_sampler_exception_falls_back
    trace_lifecycle="stream",
tests/conftest.py:349: in inner
    client = sentry_sdk.Client(*a, **kw)
sentry_sdk/client.py:277: in __init__
    super(_Client, self).__init__(options=get_options(*args, **kwargs))
sentry_sdk/client.py:106: in _get_options
    raise TypeError("Unknown option %r" % (key,))
E   TypeError: Unknown option 'trace_lifecycle'

test_traces_sampler_exception_falls_back

File: tests.tracing.test_span_streaming
Suite: py3.7-gevent
Error: TypeError: Unknown option 'trace_lifecycle'

Stack Trace
tests/tracing/test_span_streaming.py:477: in test_traces_sampler_exception_falls_back
    trace_lifecycle="stream",
tests/conftest.py:349: in inner
    client = sentry_sdk.Client(*a, **kw)
sentry_sdk/client.py:277: in __init__
    super(_Client, self).__init__(options=get_options(*args, **kwargs))
sentry_sdk/client.py:106: in _get_options
    raise TypeError("Unknown option %r" % (key,))
E   TypeError: Unknown option 'trace_lifecycle'

test_traces_sampler_exception_falls_back

File: tests.tracing.test_span_streaming
Suite: py3.8-common
Error: TypeError: Unknown option 'trace_lifecycle'

Stack Trace
tests/tracing/test_span_streaming.py:474: in test_traces_sampler_exception_falls_back
    sentry_init(
tests/conftest.py:349: in inner
    client = sentry_sdk.Client(*a, **kw)
sentry_sdk/client.py:277: in __init__
    super(_Client, self).__init__(options=get_options(*args, **kwargs))
sentry_sdk/client.py:106: in _get_options
    raise TypeError("Unknown option %r" % (key,))
E   TypeError: Unknown option 'trace_lifecycle'

test_traces_sampler_exception_falls_back

File: tests.tracing.test_span_streaming
Suite: py3.8-gevent
Error: TypeError: Unknown option 'trace_lifecycle'

Stack Trace
tests/tracing/test_span_streaming.py:474: in test_traces_sampler_exception_falls_back
    sentry_init(
tests/conftest.py:349: in inner
    client = sentry_sdk.Client(*a, **kw)
sentry_sdk/client.py:277: in __init__
    super(_Client, self).__init__(options=get_options(*args, **kwargs))
sentry_sdk/client.py:106: in _get_options
    raise TypeError("Unknown option %r" % (key,))
E   TypeError: Unknown option 'trace_lifecycle'

test_traces_sampler_exception_falls_back

File: tests.tracing.test_span_streaming
Suite: py3.9-common
Error: TypeError: Unknown option 'trace_lifecycle'

Stack Trace
tests/tracing/test_span_streaming.py:474: in test_traces_sampler_exception_falls_back
    sentry_init(
tests/conftest.py:349: in inner
    client = sentry_sdk.Client(*a, **kw)
sentry_sdk/client.py:277: in __init__
    super(_Client, self).__init__(options=get_options(*args, **kwargs))
sentry_sdk/client.py:106: in _get_options
    raise TypeError("Unknown option %r" % (key,))
E   TypeError: Unknown option 'trace_lifecycle'

✅ Patch coverage is 100.00%. Project has 2076 uncovered lines.
❌ Project coverage is 90.12%. Comparing base (b5b96b8) to head (5ae47c8).

Files with missing lines (1)
File Patch % Lines
sentry_sdk/client.py 100.00% ⚠️ 4 partials
Coverage diff
@@            Coverage Diff             @@
##        master       #PR       +/-##
==========================================
- Coverage    90.21%    90.12%    -0.09%
==========================================
  Files          194       178       -16
  Lines        26030     21008     -5022
  Branches      9678      7584     -2094
==========================================
+ Hits         23480     18932     -4548
- Misses        2550      2076      -474
- Partials      1454      1199      -255

Generated by Codecov Action

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