Opened 13 years ago

Closed 13 years ago

#15675 closed New feature (fixed)

Allow TestRunners to define their own command-line options

Reported by: msiedlarek Owned by: msiedlarek
Component: Testing framework Version: 1.3
Severity: Normal Keywords: test, management, test runner
Cc: msiedlarek Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

The point is to allow custom test runners do define and process their own command-line options, apart from default ones like verbose.

Attached patch is one of possible solutions. Management command just looks for option_list attribute in a test runner and if it's present, adds it to its own option_list. Any comments or better ideas are welcome.

Attachments (5)

ticket15675.patch (2.3 KB ) - added by msiedlarek 13 years ago.
Patch
ticket15675-2.patch (3.3 KB ) - added by msiedlarek 13 years ago.
Second version of patch - with documentation
ticket15675-3.patch (6.3 KB ) - added by msiedlarek 13 years ago.
Third version of patch - with documentation and regression tests
ticket15675-4.patch (6.2 KB ) - added by msiedlarek 13 years ago.
Fourth version of patch - merged with r16022 trunk and added AUTHORS entry
ticket15675-5.patch (6.2 KB ) - added by msiedlarek 13 years ago.
Fifth version of patch - compatible with r16102 trunk

Download all attachments as: .zip

Change History (17)

comment:1 by msiedlarek, 13 years ago

Has patch: set

comment:2 by msiedlarek, 13 years ago

Owner: changed from nobody to msiedlarek
Triage Stage: UnreviewedDesign decision needed

by msiedlarek, 13 years ago

Attachment: ticket15675.patch added

Patch

comment:3 by Russell Keith-Magee, 13 years ago

Needs tests: set
Patch needs improvement: set
Triage Stage: Design decision neededAccepted

Patch looks fine to me. However, it strikes me that this is something that could be tested in some capacity; probably using the infrastructure of the admin_scripts regressiontests.

Also, for future reference: As a matter of process, you shouldn't be triaging your own tickets. If you've submitted a ticket and a patch, just leave it in unreviewed. Someone else makes the call as to whether the ticket is ok, or needs a decision, or is ready for checkin. By marking your own ticket DDN, you have move out out of a list that gets immediate attention (the unreviewed pile) and into a list that gets intermittent attention (the DDN list).

comment:4 by msiedlarek, 13 years ago

Ok, I'll make some tests for it.

Also thanks for pointing out my mistake - it's my first patch to Django and although I've read contributing docs some mistake just had to be made. ;)

by msiedlarek, 13 years ago

Attachment: ticket15675-2.patch added

Second version of patch - with documentation

comment:5 by Luke Plant, 13 years ago

Type: New feature

by msiedlarek, 13 years ago

Attachment: ticket15675-3.patch added

Third version of patch - with documentation and regression tests

comment:6 by msiedlarek, 13 years ago

Severity: Normal

Attached third version of patch with documentation and regression tests using admin_scripts infrastructure. My approach to these tests needs an answer - is it ok to cross-import form other test packages?

And other, even more newbie and quite unrelated question - how much contributor has to do to made his way to AUTHORS? :)

comment:7 by msiedlarek, 13 years ago

Cc: msiedlarek added
Needs tests: unset
Patch needs improvement: unset
Status: newassigned

comment:8 by Julien Phalip, 13 years ago

Component: Core (Other)Testing framework

The patch looks good -- I'm going to review it in more detail. You definitely deserve your name on the list of authors, so feel free to resubmit the patch including your name while you can ;)

comment:9 by msiedlarek, 13 years ago

Ok, attached updated patch. The only last thing that makes me think is whether "versionadded development" in documentation is a correct approach.

by msiedlarek, 13 years ago

Attachment: ticket15675-4.patch added

Fourth version of patch - merged with r16022 trunk and added AUTHORS entry

by msiedlarek, 13 years ago

Attachment: ticket15675-5.patch added

Fifth version of patch - compatible with r16102 trunk

comment:10 by Dmitry Jemerov, 13 years ago

Easy pickings: unset
UI/UX: unset

Ticket #16185 is a related issue; it has a patch attached which combines this patch with another new feature: the possibility to specify the test runner class on the command line.

comment:11 by msiedlarek, 13 years ago

Cool with me I guess

comment:12 by Russell Keith-Magee, 13 years ago

Resolution: fixed
Status: assignedclosed

In [16352]:

Fixed #16185, #15675 -- Added the ability for test runners to define custom options, and to specify a custom test runner at the command line. Thanks to Dmitry Jemerov and Mikołaj Siedlarek for the patch.

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