]> git.ipfire.org Git - thirdparty/patchwork.git/commitdiff
tox: Use a range of ports for live servers
authorDamien Lespiau <damien.lespiau@intel.com>
Tue, 22 Sep 2015 16:11:49 +0000 (17:11 +0100)
committerStephen Finucane <stephen.finucane@intel.com>
Thu, 5 Nov 2015 04:21:02 +0000 (04:21 +0000)
From:

    https://docs.djangoproject.com/en/1.8/topics/testing/tools/#liveservertestcase

In the case where the tests are run by multiple processes in parallel
(for example, in the context of several simultaneous continuous
integration builds), the processes will compete for the same address, and
therefore your tests might randomly fail with an "Address already in use"
error. For example:

    Traceback (most recent call last):
      File
      ".../python2.7/site-packages/django/test/testcases.py",
      line 1193, in setUpClass
          raise cls.server_thread.error
          error: [Errno 98] Address already in use

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Acked-by: Stephen Finucane <stephen.finucane@intel.com>
tox.ini

diff --git a/tox.ini b/tox.ini
index 19606e51c6e4a0c215b047e8f1fd9b86600c25d8..e44c884bb0161ac20bfa3159983a4e0f39e058bd 100644 (file)
--- a/tox.ini
+++ b/tox.ini
@@ -14,7 +14,8 @@ deps =
 setenv =
     DJANGO_SETTINGS_MODULE = patchwork.settings.dev
 commands =
-    {toxinidir}/manage.py test --noinput '{posargs:patchwork}'
+    {toxinidir}/manage.py test --noinput --liveserver=localhost:9000-9200 \
+        '{posargs:patchwork}'
 passenv =
     http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY
     PW_TEST_DB_USER PW_TEST_DB_PASS