#34810 closed Cleanup/optimization (fixed)

Calculate coverage on subprocesses such as django-admin commands

Reported by: Jacob Walls Owned by: Jacob Walls
Component: Core (Other) Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Noticed during #34778 that despite good coverage for the django-admin commands in tests/admin_scripts, the coverage report suggests only 12% coverage for django/core/management/templates.py.

This is because using coverage.py to trace code launched by a subprocess (and not through multiprocessing) requires additional configuration, e.g. adding code to sitecustomize.py or creating a .pth file.

Perhaps we could look into creating a tempdir with a .pth file to run the needed coverage.py configuration while running tests.

Change History (7)

comment:1 by Mariusz Felisiak, 16 months ago

Triage Stage: UnreviewedAccepted

Tentatively accepted (not sure if this is doable).

comment:2 by Jacob Walls, 16 months ago

Owner: changed from nobody to Jacob Walls
Status: newassigned

comment:3 by Jacob Walls, 16 months ago

Has patch: set

comment:4 by Natalia Bidart, 16 months ago

Patch needs improvement: set

Setting as patch needs improvement since apparently the coverage config should set parallel to True.

comment:5 by Jacob Walls, 16 months ago

Patch needs improvement: unset

Thanks for the review. Left a comment with what I found about the concurrency option taking the place of the parallel option.

comment:6 by Natalia Bidart, 16 months ago

Triage Stage: AcceptedReady for checkin

comment:7 by Natalia <124304+nessita@…>, 16 months ago

Resolution: fixed
Status: assignedclosed

In 1ab2cf79:

Fixed #34810 -- Measured test coverage on django-admin commands.

Note: See TracTickets for help on using tickets.
Back to Top