Skip to content

test(django): Prune redundant parametrize rows from the ASGI tests - #7158

Draft
ericapisani wants to merge 3 commits into
ep/django-tests-span-streamingfrom
ep/django-tests-asgi-params
Draft

test(django): Prune redundant parametrize rows from the ASGI tests#7158
ericapisani wants to merge 3 commits into
ep/django-tests-span-streamingfrom
ep/django-tests-asgi-params

Conversation

@ericapisani

@ericapisani ericapisani commented Aug 10, 2026

Copy link
Copy Markdown
Member

Description

Three independent redundancies in asgi/test_asgi.py:

  • test_asgi_request_body — the send_default_pii dimension held every row to the same outcome, so the 5 pii=False rows re-ran their pii=True counterparts. The application/xml row takes the same "no structured body" branch as the text/plain row.
  • test_active_thread_id — the middleware_spans arm only toggled spans this test never inspects; both settings stay covered by the dedicated middleware-span tests.
  • test_user_identity_error_event_data_collection — swapped the shared 6-row table for a local 4-row one, dropping the 2 precedence rows already asserted by the WSGI tests in test_data_scrubbing.py.

356 -> 320 cases.

Refs PY-2641
Refs #6975

The send_default_pii dimension held every row to the same outcome: none of
the expected_data values differ between the pii=True and pii=False halves
of the table, so the 5 pii=False rows re-ran the assertions of their
pii=True counterparts. Drop them and the now-constant dimension.

Also drop the application/xml row, which exercises the same "no structured
body" branch as the text/plain row already in the table.
…ad_id

The arm only toggled creation of middleware spans, which this test never
inspects: the streaming path skips non-segment spans, and the static path
looks at profile and transaction items. Both DjangoIntegration(middleware_spans=)
settings remain covered by the dedicated middleware-span tests.
test_user_identity_error_event_data_collection borrowed the shared 6-row
DATA_COLLECTION_USER_INFO_CASES table, 2 rows of which cover send_default_pii
vs. data_collection precedence — already asserted by the WSGI tests in
test_data_scrubbing.py. Replace it with a local 4-row table covering the
branches asgi.py actually takes: pii on/off crossed with data_collection
user_info on/off.
@ericapisani ericapisani changed the title ep/django tests asgi params test(django): Prune redundant parametrize rows from the ASGI tests Aug 10, 2026
@linear-code

linear-code Bot commented Aug 10, 2026

Copy link
Copy Markdown

PY-2641

@github-actions

Copy link
Copy Markdown
Contributor

Codecov Results 📊

101453 passed | ❌ 2 failed | ⏭️ 6483 skipped | Total: 107938 | Pass Rate: 93.99% | Execution Time: 355m 7s

📊 Comparison with Base Branch

Metric Change
Total Tests 📉 -2723
Passed Tests 📉 -2531
Failed Tests 📈 +2
Skipped Tests 📉 -194

➕ New Tests (2)

View new tests
  • test_continuous_profiler_auto_start_and_stop_sampled[experiment-gevent]
    • File: tests.profiler.test_continuous_profiler
    • Status: ❌ Failing
  • test_continuous_profiler_auto_start_and_stop_sampled[experiment-thread]
    • File: tests.profiler.test_continuous_profiler
    • Status: ❌ Failing

❌ Failed Tests

test_continuous_profiler_auto_start_and_stop_sampled[experiment-gevent]

File: tests.profiler.test_continuous_profiler
Suite: py3.6-gevent
Error: AssertionError: profiler should not be running assert '93225ee7a1244eb2962037247495de71' is None + where '93225ee7a1244eb2962037247495de71' = get_profiler_id()

Stack Trace
tests/profiler/test_continuous_profiler.py:812: in test_continuous_profiler_auto_start_and_stop_sampled
    assert get_profiler_id() is None, "profiler should not be running"
E   AssertionError: profiler should not be running
E   assert '93225ee7a1244eb2962037247495de71' is None
E    +  where '93225ee7a1244eb2962037247495de71' = get_profiler_id()

test_continuous_profiler_auto_start_and_stop_sampled[experiment-thread]

File: tests.profiler.test_continuous_profiler
Suite: py3.7-common
Error: AssertionError: profiler should not be running assert 'fd63ad2639094b6d82d73f25e167cb8c' is None + where 'fd63ad2639094b6d82d73f25e167cb8c' = get_profiler_id()

Stack Trace
tests/profiler/test_continuous_profiler.py:812: in test_continuous_profiler_auto_start_and_stop_sampled
    assert get_profiler_id() is None, "profiler should not be running"
E   AssertionError: profiler should not be running
E   assert 'fd63ad2639094b6d82d73f25e167cb8c' is None
E    +  where 'fd63ad2639094b6d82d73f25e167cb8c' = get_profiler_id()

✅ Patch coverage is 100.00%. Project has 2479 uncovered lines.
✅ Project coverage is 90.14%. Comparing base (base) to head (head).

Coverage diff
@@            Coverage Diff             @@
##          main       #PR       +/-##
==========================================
+ Coverage    90.14%    90.14%        —%
==========================================
  Files          193       193         —
  Lines        25147     25147         —
  Branches      9136      9136         —
==========================================
+ Hits         22669     22668        -1
- Misses        2478      2479        +1
- Partials      1431      1432        +1

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.

1 participant