[Django] #31621: Add ability to specify "all cores" to "test --parallel"

50 views
Skip to first unread message

Django

unread,
May 23, 2020, 9:37:17 AM5/23/20
to django-...@googlegroups.com
#31621: Add ability to specify "all cores" to "test --parallel"
-------------------------------------+-------------------------------------
Reporter: Adam | Owner: nobody
(Chainz) Johnson |
Type: | Status: assigned
Cleanup/optimization |
Component: Testing | Version: master
framework |
Severity: Normal | Keywords:
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
The `--parallel` flag to `test` is used as a binary "on" to mean "on all
cores." But it also tries to parse the value after it as a number. This is
annoying as there's no easy way to alias it as "on", since when adding a
test name afterwards it is parsed as an integer:

{{{
$ python manage.py test --parallel example.core.tests.test_a
usage: manage.py test [-h] [--noinput] [--failfast] ...
manage.py test: error: argument --parallel: invalid int value:
'example.core.tests.test_a'
}}}

Pytest's xdist plugin supports the value "auto" to mean "all cores." I
suggest we copy that.

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

Django

unread,
May 25, 2020, 4:55:22 AM5/25/20
to django-...@googlegroups.com
#31621: Add ability to specify "all cores" to "test --parallel"
-------------------------------------+-------------------------------------
Reporter: Adam (Chainz) | Owner: nobody

Johnson |
Type: | Status: assigned
Cleanup/optimization |
Component: Testing framework | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Adam (Chainz) Johnson):

* has_patch: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/31621#comment:1>

Django

unread,
May 26, 2020, 12:12:51 AM5/26/20
to django-...@googlegroups.com
#31621: Add "--parallel=auto" option to the "test" command.
-------------------------------------+-------------------------------------
Reporter: Adam (Chainz) | Owner: Adam
Johnson | (Chainz) Johnson
Type: New feature | Status: assigned

Component: Testing framework | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by felixxm):

* owner: nobody => Adam (Chainz) Johnson
* type: Cleanup/optimization => New feature
* stage: Unreviewed => Accepted


Comment:

[https://github.com/django/django/pull/12963 PR]

--
Ticket URL: <https://code.djangoproject.com/ticket/31621#comment:2>

Django

unread,
May 26, 2020, 9:37:50 AM5/26/20
to django-...@googlegroups.com
#31621: Add "--parallel=auto" option to the "test" command.
-------------------------------------+-------------------------------------
Reporter: Adam (Chainz) | Owner: Adam
Johnson | (Chainz) Johnson
Type: New feature | Status: assigned
Component: Testing framework | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Ahmad A. Hussein):

* stage: Accepted => Ready for checkin


Comment:

Patch looks good

--
Ticket URL: <https://code.djangoproject.com/ticket/31621#comment:3>

Django

unread,
May 26, 2020, 4:58:13 PM5/26/20
to django-...@googlegroups.com
#31621: Add "--parallel=auto" option to the "test" command.
-------------------------------------+-------------------------------------
Reporter: Adam (Chainz) | Owner: Adam
Johnson | (Chainz) Johnson
Type: New feature | Status: assigned
Component: Testing framework | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by felixxm):

* needs_better_patch: 0 => 1
* stage: Ready for checkin => Accepted


--
Ticket URL: <https://code.djangoproject.com/ticket/31621#comment:4>

Django

unread,
May 31, 2020, 11:04:01 AM5/31/20
to django-...@googlegroups.com
#31621: Add "--parallel=auto" option to the "test" command.
-------------------------------------+-------------------------------------
Reporter: Adam (Chainz) | Owner: Adam
Johnson | (Chainz) Johnson
Type: New feature | Status: assigned
Component: Testing framework | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Sergey Fedoseev):

* cc: Sergey Fedoseev (added)


Comment:

What about this?

{{{
$ python manage.py test --parallel -- example.core.tests.test_a
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/31621#comment:5>

Django

unread,
Jul 9, 2021, 1:34:50 AM7/9/21
to django-...@googlegroups.com
#31621: Add "--parallel=auto" option to the "test" command.
-------------------------------------+-------------------------------------
Reporter: Adam Johnson | Owner: Adam

| Johnson
Type: New feature | Status: assigned
Component: Testing framework | Version: dev

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* needs_tests: 0 => 1


Comment:

[https://github.com/django/django/pull/14614 New PR]

--
Ticket URL: <https://code.djangoproject.com/ticket/31621#comment:7>

Django

unread,
Jul 9, 2021, 1:36:20 AM7/9/21
to django-...@googlegroups.com
#31621: Add "--parallel=auto" option to the "test" command.
-------------------------------------+-------------------------------------
Reporter: Adam Johnson | Owner: Adam
| Johnson
Type: New feature | Status: assigned
Component: Testing framework | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Sergey Fedoseev):

* cc: Sergey Fedoseev (removed)


--
Ticket URL: <https://code.djangoproject.com/ticket/31621#comment:8>

Django

unread,
Jul 9, 2021, 4:40:56 AM7/9/21
to django-...@googlegroups.com
#31621: Add "--parallel=auto" option to the "test" command.
-------------------------------------+-------------------------------------
Reporter: Adam Johnson | Owner: Adam
| Johnson
Type: New feature | Status: assigned
Component: Testing framework | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Adam Johnson):

* needs_better_patch: 1 => 0


--
Ticket URL: <https://code.djangoproject.com/ticket/31621#comment:9>

Django

unread,
Jul 9, 2021, 4:41:10 AM7/9/21
to django-...@googlegroups.com
#31621: Add "--parallel=auto" option to the "test" command.
-------------------------------------+-------------------------------------
Reporter: Adam Johnson | Owner: Adam
| Johnson
Type: New feature | Status: assigned
Component: Testing framework | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Adam Johnson):

* needs_better_patch: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/31621#comment:10>

Django

unread,
Jul 9, 2021, 4:41:23 AM7/9/21
to django-...@googlegroups.com
#31621: Add "--parallel=auto" option to the "test" command.
-------------------------------------+-------------------------------------
Reporter: Adam Johnson | Owner: Adam
| Johnson
Type: New feature | Status: assigned
Component: Testing framework | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Adam Johnson):

* needs_tests: 1 => 0


--
Ticket URL: <https://code.djangoproject.com/ticket/31621#comment:11>

Django

unread,
Aug 3, 2021, 3:59:52 AM8/3/21
to django-...@googlegroups.com
#31621: Add "--parallel=auto" option to the "test" command.
-------------------------------------+-------------------------------------
Reporter: Adam Johnson | Owner: Adam
| Johnson
Type: New feature | Status: assigned
Component: Testing framework | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* needs_better_patch: 1 => 0

* stage: Accepted => Ready for checkin


--
Ticket URL: <https://code.djangoproject.com/ticket/31621#comment:12>

Django

unread,
Aug 3, 2021, 5:30:56 AM8/3/21
to django-...@googlegroups.com
#31621: Add "--parallel=auto" option to the "test" command.
-------------------------------------+-------------------------------------
Reporter: Adam Johnson | Owner: Adam
| Johnson
Type: New feature | Status: assigned
Component: Testing framework | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"7e38a8d66f9a4fbbf373de30f1cc6be906502559" 7e38a8d6]:
{{{
#!CommitTicketReference repository=""
revision="7e38a8d66f9a4fbbf373de30f1cc6be906502559"
Refs #31621 -- Added more tests for test --parallel option.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/31621#comment:13>

Django

unread,
Aug 3, 2021, 5:30:56 AM8/3/21
to django-...@googlegroups.com
#31621: Add "--parallel=auto" option to the "test" command.
-------------------------------------+-------------------------------------
Reporter: Adam Johnson | Owner: Adam
| Johnson
Type: New feature | Status: closed

Component: Testing framework | Version: dev
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak <felisiak.mariusz@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"ae89daf46f83a7b39d599d289624c3377bfa4ab1" ae89daf4]:
{{{
#!CommitTicketReference repository=""
revision="ae89daf46f83a7b39d599d289624c3377bfa4ab1"
Fixed #31621 -- Added support for '--parallel auto' to test management
command.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/31621#comment:14>

Django

unread,
Aug 19, 2021, 3:18:49 AM8/19/21
to django-...@googlegroups.com
#31621: Add "--parallel=auto" option to the "test" command.
-------------------------------------+-------------------------------------
Reporter: Adam Johnson | Owner: Adam
| Johnson
Type: New feature | Status: closed
Component: Testing framework | Version: dev
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"36714be874fa9ba7c0229d97607906669615e409" 36714be8]:
{{{
#!CommitTicketReference repository=""
revision="36714be874fa9ba7c0229d97607906669615e409"
Refs #31621 -- Fixed handling --parallel option in test management command
and runtests.py.

Regression in ae89daf46f83a7b39d599d289624c3377bfa4ab1.
Thanks Tim Graham for the report.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/31621#comment:16>

Django

unread,
Aug 19, 2021, 3:18:49 AM8/19/21
to django-...@googlegroups.com
#31621: Add "--parallel=auto" option to the "test" command.
-------------------------------------+-------------------------------------
Reporter: Adam Johnson | Owner: Adam
| Johnson
Type: New feature | Status: closed
Component: Testing framework | Version: dev
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"c2a5735d8679c4d07ceb667cc5418f64ee372b60" c2a5735d]:
{{{
#!CommitTicketReference repository=""
revision="c2a5735d8679c4d07ceb667cc5418f64ee372b60"


Refs #31621 -- Added more tests for test --parallel option.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/31621#comment:15>

Reply all
Reply to author
Forward
0 new messages