Skip to content

ref: Remove _capture_experimental_log scope parameter #4424

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 1 commit into
base: szokeasaurusrex/logs-user-attributes
Choose a base branch
from

Conversation

szokeasaurusrex
Copy link
Member

We are always just using the current scope anyway; it is less confusing if we eliminate the parameter

Stacked on:

We are always just using the current scope anyway; it is less confusing if we eliminate the parameter
@szokeasaurusrex szokeasaurusrex requested a review from a team as a code owner May 28, 2025 16:25
Copy link

codecov bot commented May 28, 2025

❌ 21 Tests Failed:

Tests completed Failed Passed Skipped
20032 21 20011 5155
View the top 3 failed test(s) by shortest run time
tests.integrations.aiohttp.test_aiohttp::test_crumb_capture_client_error[301-None]
Stack Traces | 0.002s run time
file .../integrations/aiohttp/test_aiohttp.py, line 534
  @pytest.mark.parametrize(
      "status_code,level",
      [
          (200, None),
          (301, None),
          (403, "warning"),
          (405, "warning"),
          (500, "error"),
      ],
  )
  @pytest.mark.asyncio
  async def test_crumb_capture_client_error(
      sentry_init,
      aiohttp_raw_server,
      aiohttp_client,
      event_loop,
      capture_events,
      status_code,
      level,
  ):
      sentry_init(integrations=[AioHttpIntegration()])

      async def handler(request):
          return web.Response(status=status_code)

      raw_server = await aiohttp_raw_server(handler)

      with start_transaction():
          events = capture_events()

          client = await aiohttp_client(raw_server)
          resp = await client.get("/")
          assert resp.status == status_code
          capture_message("Testing!")

          (event,) = events

          crumb = event["breadcrumbs"]["values"][0]
          assert crumb["type"] == "http"
          if level is None:
              assert "level" not in crumb
          else:
              assert crumb["level"] == level
          assert crumb["category"] == "httplib"
          assert crumb["data"] == ApproxDict(
              {
                  "url": "http://127.0.0.1:{}/".format(raw_server.port),
                  "http.fragment": "",
                  "http.method": "GET",
                  "http.query": "",
                  "http.response.status_code": status_code,
              }
          )
E       fixture 'event_loop' not found
>       available fixtures: DictionaryContaining, ObjectDescribedBy, StringContaining, _capture_internal_warnings, _class_event_loop, _function_event_loop, _module_event_loop, _package_event_loop, _session_event_loop, aiohttp_client, aiohttp_client_cls, aiohttp_raw_server, aiohttp_server, aiohttp_unused_port, benchmark, cache, capfd, capfdbinary, caplog, capsys, capsysbinary, capture_envelopes, capture_events, capture_events_forksafe, capture_exceptions, capture_record_lost_event_calls, clean_scopes, cov, doctest_namespace, event_loop_policy, httpserver, httpsserver, internal_exceptions, loop, maybe_monkeypatched_threading, monkeypatch, no_cover, proactor_loop, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, render_span_tree, reset_integrations, sentry_init, smtpserver, suppress_deprecation_warnings, teardown_profiling, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory, uninstall_integration, unused_tcp_port, unused_tcp_port_factory, unused_udp_port, unused_udp_port_factory, validate_event_schema
>       use 'pytest --fixtures [testpath]' for help on them.

.../integrations/aiohttp/test_aiohttp.py:534
tests.integrations.aiohttp.test_aiohttp::test_crumb_capture_client_error[301-None]
Stack Traces | 0.002s run time
file .../integrations/aiohttp/test_aiohttp.py, line 534
  @pytest.mark.parametrize(
      "status_code,level",
      [
          (200, None),
          (301, None),
          (403, "warning"),
          (405, "warning"),
          (500, "error"),
      ],
  )
  @pytest.mark.asyncio
  async def test_crumb_capture_client_error(
      sentry_init,
      aiohttp_raw_server,
      aiohttp_client,
      event_loop,
      capture_events,
      status_code,
      level,
  ):
      sentry_init(integrations=[AioHttpIntegration()])

      async def handler(request):
          return web.Response(status=status_code)

      raw_server = await aiohttp_raw_server(handler)

      with start_transaction():
          events = capture_events()

          client = await aiohttp_client(raw_server)
          resp = await client.get("/")
          assert resp.status == status_code
          capture_message("Testing!")

          (event,) = events

          crumb = event["breadcrumbs"]["values"][0]
          assert crumb["type"] == "http"
          if level is None:
              assert "level" not in crumb
          else:
              assert crumb["level"] == level
          assert crumb["category"] == "httplib"
          assert crumb["data"] == ApproxDict(
              {
                  "url": "http://127.0.0.1:{}/".format(raw_server.port),
                  "http.fragment": "",
                  "http.method": "GET",
                  "http.query": "",
                  "http.response.status_code": status_code,
              }
          )
E       fixture 'event_loop' not found
>       available fixtures: DictionaryContaining, ObjectDescribedBy, StringContaining, _capture_internal_warnings, _class_event_loop, _function_event_loop, _module_event_loop, _package_event_loop, _session_event_loop, aiohttp_client, aiohttp_client_cls, aiohttp_raw_server, aiohttp_server, benchmark, cache, capfd, capfdbinary, caplog, capsys, capsysbinary, capture_envelopes, capture_events, capture_events_forksafe, capture_exceptions, capture_record_lost_event_calls, clean_scopes, cov, doctest_namespace, event_loop_policy, httpserver, httpsserver, internal_exceptions, maybe_monkeypatched_threading, monkeypatch, no_cover, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, render_span_tree, reset_integrations, sentry_init, smtpserver, suppress_deprecation_warnings, teardown_profiling, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory, uninstall_integration, unused_tcp_port, unused_tcp_port_factory, unused_udp_port, unused_udp_port_factory, validate_event_schema
>       use 'pytest --fixtures [testpath]' for help on them.

.../integrations/aiohttp/test_aiohttp.py:534
tests.integrations.aiohttp.test_aiohttp::test_crumb_capture_client_error[405-warning]
Stack Traces | 0.002s run time
file .../integrations/aiohttp/test_aiohttp.py, line 534
  @pytest.mark.parametrize(
      "status_code,level",
      [
          (200, None),
          (301, None),
          (403, "warning"),
          (405, "warning"),
          (500, "error"),
      ],
  )
  @pytest.mark.asyncio
  async def test_crumb_capture_client_error(
      sentry_init,
      aiohttp_raw_server,
      aiohttp_client,
      event_loop,
      capture_events,
      status_code,
      level,
  ):
      sentry_init(integrations=[AioHttpIntegration()])

      async def handler(request):
          return web.Response(status=status_code)

      raw_server = await aiohttp_raw_server(handler)

      with start_transaction():
          events = capture_events()

          client = await aiohttp_client(raw_server)
          resp = await client.get("/")
          assert resp.status == status_code
          capture_message("Testing!")

          (event,) = events

          crumb = event["breadcrumbs"]["values"][0]
          assert crumb["type"] == "http"
          if level is None:
              assert "level" not in crumb
          else:
              assert crumb["level"] == level
          assert crumb["category"] == "httplib"
          assert crumb["data"] == ApproxDict(
              {
                  "url": "http://127.0.0.1:{}/".format(raw_server.port),
                  "http.fragment": "",
                  "http.method": "GET",
                  "http.query": "",
                  "http.response.status_code": status_code,
              }
          )
E       fixture 'event_loop' not found
>       available fixtures: DictionaryContaining, ObjectDescribedBy, StringContaining, _capture_internal_warnings, _class_event_loop, _function_event_loop, _module_event_loop, _package_event_loop, _session_event_loop, aiohttp_client, aiohttp_client_cls, aiohttp_raw_server, aiohttp_server, benchmark, cache, capfd, capfdbinary, caplog, capsys, capsysbinary, capture_envelopes, capture_events, capture_events_forksafe, capture_exceptions, capture_record_lost_event_calls, clean_scopes, cov, doctest_namespace, event_loop_policy, httpserver, httpsserver, internal_exceptions, maybe_monkeypatched_threading, monkeypatch, no_cover, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, render_span_tree, reset_integrations, sentry_init, smtpserver, suppress_deprecation_warnings, teardown_profiling, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory, uninstall_integration, unused_tcp_port, unused_tcp_port_factory, unused_udp_port, unused_udp_port_factory, validate_event_schema
>       use 'pytest --fixtures [testpath]' for help on them.

.../integrations/aiohttp/test_aiohttp.py:534

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

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.

1 participant