Skip to content

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

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

test(django): Prune redundant parametrize rows from the ASGI tests#7158
ericapisani wants to merge 3 commits into
masterfrom
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

@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

github-actions Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Codecov Results 📊

111552 passed | ⏭️ 6669 skipped | Total: 118221 | Pass Rate: 94.36% | Execution Time: 399m 1s

📊 Comparison with Base Branch

Metric Change
Total Tests 📉 -1014
Passed Tests 📉 -927
Failed Tests 📉 -1
Skipped Tests 📉 -86

➖ Removed Tests (1)

View removed tests
  • test_span_streaming_quart_auth_user_id[42-True]
    • File: tests.integrations.quart.test_quart

All tests are passing successfully.

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

Coverage diff
@@            Coverage Diff             @@
##          main       #PR       +/-##
==========================================
+ Coverage    90.20%    90.20%        —%
==========================================
  Files          193       193         —
  Lines        25370     25370         —
  Branches      9310      9310         —
==========================================
+ Hits         22885     22884        -1
- Misses        2485      2486        +1
- Partials      1431      1433        +2

Generated by Codecov Action

Base automatically changed from ep/django-tests-span-streaming to master August 13, 2026 16:37
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 force-pushed the ep/django-tests-asgi-params branch from 7b83466 to 05ce4f0 Compare August 13, 2026 16:38
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