#16817 closed Cleanup/optimization (fixed)
Add a guide on code coverage to contributing docs
Reported by: | Julien Phalip | Owned by: | Pedro Lima |
---|---|---|---|
Component: | Documentation | Version: | 1.3 |
Severity: | Normal | Keywords: | |
Cc: | preston@…, Pedro Lima | Triage Stage: | Accepted |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | yes |
Easy pickings: | yes | UI/UX: | no |
Description
Increasing code coverage is a good place to start for new contributors to get acquainted both with the Django codebase and with its test suite. Python core has a nice guide for it [1]
and it'd be useful for Django to have one too. The guide would explain how to install the coverage.py
module, run it on top of the runtests
script, generate the reports, etc.:
$ coverage run ./runtests.py --settings=test_sqlite $ coverage html
Some embedded third-party modules should be excluded so as to not mess up the results. This exclusion would be facilitated by adding a configuration file to django/tests/
(see attachment).
It would also be useful to have a regularly-updated online report that one could easily refer to. There's already one on the CI server [2]
, which is a great start, although it is using Cobertura instead of coverage.py
.
[1]
http://docs.python.org/devguide/coverage.html
[2]
http://ci.django-cms.org/job/Django%20Coverage/cobertura
Attachments (1)
Change History (11)
Changed 12 years ago by
Attachment: | 16817.runtests-coverage.diff added |
---|
comment:1 Changed 12 years ago by
Triage Stage: | Unreviewed → Accepted |
---|
comment:2 Changed 11 years ago by
Cc: | preston@… added |
---|
comment:3 Changed 11 years ago by
Easy pickings: | set |
---|---|
Has patch: | set |
Patch needs improvement: | set |
Related ticket: #4501
comment:4 Changed 11 years ago by
Owner: | changed from nobody to Christopher Medrela |
---|---|
Status: | new → assigned |
comment:5 Changed 11 years ago by
Owner: | Christopher Medrela deleted |
---|---|
Status: | assigned → new |
comment:6 Changed 11 years ago by
Owner: | set to Pedro Lima |
---|---|
Status: | new → assigned |
comment:7 Changed 11 years ago by
Cc: | Pedro Lima added |
---|---|
Triage Stage: | Accepted → Ready for checkin |
Included this patch and added documentation for coverage installation and use (also based on the documentation work of krzysiumed in #4501)
comment:8 Changed 11 years ago by
Triage Stage: | Ready for checkin → Accepted |
---|
comment:9 Changed 10 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Coverage.py conf file to make the process easier