Code

Opened 3 years ago

Closed 3 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 3 years ago.
Patch
ticket15675-2.patch (3.3 KB) - added by msiedlarek 3 years ago.
Second version of patch - with documentation
ticket15675-3.patch (6.3 KB) - added by msiedlarek 3 years ago.
Third version of patch - with documentation and regression tests
ticket15675-4.patch (6.2 KB) - added by msiedlarek 3 years ago.
Fourth version of patch - merged with r16022 trunk and added AUTHORS entry
ticket15675-5.patch (6.2 KB) - added by msiedlarek 3 years ago.
Fifth version of patch - compatible with r16102 trunk

Download all attachments as: .zip

Change History (17)

comment:1 Changed 3 years ago by msiedlarek

  • Has patch set
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

comment:2 Changed 3 years ago by msiedlarek

  • Owner changed from nobody to msiedlarek
  • Triage Stage changed from Unreviewed to Design decision needed

Changed 3 years ago by msiedlarek

Patch

comment:3 Changed 3 years ago by russellm

  • Needs tests set
  • Patch needs improvement set
  • Triage Stage changed from Design decision needed to Accepted

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 Changed 3 years ago by msiedlarek

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. ;)

Changed 3 years ago by msiedlarek

Second version of patch - with documentation

comment:5 Changed 3 years ago by lukeplant

  • Type set to New feature

Changed 3 years ago by msiedlarek

Third version of patch - with documentation and regression tests

comment:6 Changed 3 years ago by msiedlarek

  • Severity set to 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 Changed 3 years ago by msiedlarek

  • Cc msiedlarek added
  • Needs tests unset
  • Patch needs improvement unset
  • Status changed from new to assigned

comment:8 Changed 3 years ago by julien

  • Component changed from Core (Other) to 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 Changed 3 years ago by msiedlarek

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

Changed 3 years ago by msiedlarek

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

Changed 3 years ago by msiedlarek

Fifth version of patch - compatible with r16102 trunk

comment:10 Changed 3 years ago by intelliyole

  • 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 Changed 3 years ago by msiedlarek

Cool with me I guess

comment:12 Changed 3 years ago by russellm

  • Resolution set to fixed
  • Status changed from assigned to closed

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.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.