Fixed #31621 -- Added support for '--parallel auto' to test management command.

This commit is contained in:
Adam Johnson 2020-05-23 19:32:22 +01:00 committed by Mariusz Felisiak
parent 7e38a8d66f
commit ae89daf46f
5 changed files with 67 additions and 22 deletions

View file

@ -1467,10 +1467,12 @@ Enables :ref:`SQL logging <django-db-logger>` for failing tests. If
Runs tests in separate parallel processes. Since modern processors have
multiple cores, this allows running tests significantly faster.
By default ``--parallel`` runs one process per core according to
:func:`multiprocessing.cpu_count()`. You can adjust the number of processes
either by providing it as the option's value, e.g. ``--parallel=4``, or by
setting the :envvar:`DJANGO_TEST_PROCESSES` environment variable.
Using ``--parallel`` without a value, or with the value ``auto``, runs one test
process per core according to :func:`multiprocessing.cpu_count()`. You can
override this by passing the desired number of processes, e.g.
``--parallel 4``. You can also enable ``--parallel`` without passing the flag
by setting the :envvar:`DJANGO_TEST_PROCESSES` environment variable to the
desired number of processes.
Django distributes test cases — :class:`unittest.TestCase` subclasses — to
subprocesses. If there are fewer test cases than configured processes, Django
@ -1511,6 +1513,10 @@ don't.
in order to exchange them between processes. See
:ref:`python:pickle-picklable` for details.
.. versionchanged:: 4.0
Support for the value ``auto`` was added.
.. option:: --tag TAGS
Runs only tests :ref:`marked with the specified tags <topics-tagging-tests>`.