Opened 13 years ago

Closed 12 years ago

Last modified 12 years ago

#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)

16817.runtests-coverage.diff (1.4 KB ) - added by Julien Phalip 13 years ago.
Coverage.py conf file to make the process easier

Download all attachments as: .zip

Change History (11)

by Julien Phalip, 13 years ago

Coverage.py conf file to make the process easier

comment:1 by Alex Gaynor, 13 years ago

Triage Stage: UnreviewedAccepted

comment:2 by Preston Holmes, 13 years ago

Cc: preston@… added

comment:3 by Aymeric Augustin, 13 years ago

Easy pickings: set
Has patch: set
Patch needs improvement: set

Related ticket: #4501

comment:4 by Christopher Medrela, 13 years ago

Owner: changed from nobody to Christopher Medrela
Status: newassigned

comment:5 by Christopher Medrela, 13 years ago

Owner: Christopher Medrela removed
Status: assignednew

comment:6 by Pedro Lima, 12 years ago

Owner: set to Pedro Lima
Status: newassigned

comment:7 by Pedro Lima, 12 years ago

Cc: Pedro Lima added
Triage Stage: AcceptedReady for checkin

Included this patch and added documentation for coverage installation and use (also based on the documentation work of krzysiumed in #4501)

https://github.com/django/django/pull/120

comment:8 by Pedro Lima, 12 years ago

Triage Stage: Ready for checkinAccepted

comment:9 by Tim Graham <timograham@…>, 12 years ago

Resolution: fixed
Status: assignedclosed

In 06f5da3d7813e9a23b1e98ecf8b75fc6073800e9:

Fixed #16817 - Added a guide of code coverage to contributing docs.

Thanks Pedro Lima for the draft patch.

comment:10 by Tim Graham <timograham@…>, 12 years ago

In 3ac70a5907e054c734ca26e435f1ec1215797b08:

[1.4.X] Fixed #16817 - Added a guide of code coverage to contributing docs.

Thanks Pedro Lima for the draft patch.

Backport of 06f5da3d78 from master

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