Opened 15 months ago
Closed 15 months ago
#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 , 15 months ago
Triage Stage: | Unreviewed → Accepted |
---|
comment:2 by , 15 months ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:4 by , 15 months ago
Patch needs improvement: | set |
---|
Setting as patch needs improvement since apparently the coverage config should set parallel
to True.
comment:5 by , 15 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 , 15 months ago
Triage Stage: | Accepted → Ready for checkin |
---|
Tentatively accepted (not sure if this is doable).