#32609: runtests.py setup should use DiscoverRunner's test label logic
-------------------------------------+-------------------------------------
     Reporter:  Chris Jerdonek       |                    Owner:  nobody
         Type:                       |                   Status:  new
  Cleanup/optimization               |
    Component:  Testing framework    |                  Version:  dev
     Severity:  Normal               |               Resolution:
     Keywords:                       |             Triage Stage:
  DiscoverRunner,runtests            |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Description changed by Chris Jerdonek:

Old description:

> I noticed that `runtests.py` does its own rudimentary "parsing" of the
> provided test labels here:
> https://github.com/django/django/blob/548dce50cf548e777a0c34b5485a146a0606ae73/tests/runtests.py#L128-L132
>
> However, it would be better if it used the same logic as
> `DiscoverRunner.build_suite()`:
> https://github.com/django/django/blob/548dce50cf548e777a0c34b5485a146a0606ae73/django/test/runner.py#L612
>
> There are a few reasons for this. First, it would let `runtests` take
> into account the test tags when determining which app modules apply.
> Second, it would centralize the test label logic, which should simplify
> maintenance. (For example, I was previously unaware of this code path,
> which explains why some things mysteriously weren't working before.)
> Third, it might even permit test labels to be directory paths when used
> with `runtests.py`, as a free side effect. (Currently, directory paths
> don't seem to work with `runtests.py`, I believe for this reason.)

New description:

 I noticed that `runtests.py` does its own rudimentary "parsing" of the
 provided test labels here:
 
https://github.com/django/django/blob/548dce50cf548e777a0c34b5485a146a0606ae73/tests/runtests.py#L128-L132

 However, it would be better if it used the same logic as
 `DiscoverRunner.build_suite()`:
 
https://github.com/django/django/blob/548dce50cf548e777a0c34b5485a146a0606ae73/django/test/runner.py#L612

 There are a few reasons for this. First, it would let `runtests` take into
 account the test tags when determining which app modules apply. Second, it
 would centralize the test label logic, which should simplify maintenance.
 (For example, I was previously unaware of this code path, which explains
 why some things mysteriously weren't working before.) Third, it might even
 permit test labels to be directory paths when used with `runtests.py`, as
 a free side effect. (Currently, directory paths don't seem to work with
 `runtests.py`, I believe for this reason.) A fourth is that `runtests.py`
 will fail faster if a bad test label is passed.

--

-- 
Ticket URL: <https://code.djangoproject.com/ticket/32609#comment:1>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.75921c3a4d8c696cddd028c443f8b4b6%40djangoproject.com.

Reply via email to