Cloned databases for running tests in parallel.

This commit is contained in:
Aymeric Augustin 2015-02-09 22:00:09 +01:00
parent cd9fcd4e80
commit 0586c061f0
8 changed files with 208 additions and 11 deletions

View file

@ -1270,6 +1270,10 @@ By default ``--parallel`` runs one process per core according to
either by providing it as the option's value, e.g. ``--parallel=4``, or by
setting the ``DJANGO_TEST_PROCESSES`` environment variable.
Each process gets its own database. You must ensure that different test cases
don't access the same resources. For instance, test cases that touch the
filesystem should create a temporary directory for their own use.
This option requires the third-party ``tblib`` package to display tracebacks
correctly:

View file

@ -131,6 +131,10 @@ Running tests in parallel
The :djadmin:`test` command now supports a :djadminopt:`--parallel` option to
run a project's tests in multiple processes in parallel.
Each process gets its own database. You must ensure that different test cases
don't access the same resources. For instance, test cases that touch the
filesystem should create a temporary directory for their own use.
Minor features
~~~~~~~~~~~~~~
@ -681,6 +685,10 @@ Database backend API
before 1.0, but hasn't been overridden by any core backend in years
and hasn't been called anywhere in Django's code or tests.
* In order to support test parallelization, you must implement the
``DatabaseCreation._clone_test_db()`` method. You may have to adjust
``DatabaseCreation.get_test_db_clone_settings()``.
Default settings that were tuples are now lists
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~