]> git.ipfire.org Git - thirdparty/patchwork.git/commitdiff
Add parallel testing
authorStephen Finucane <stephen@that.guru>
Thu, 1 Oct 2020 15:28:58 +0000 (16:28 +0100)
committerStephen Finucane <stephen@that.guru>
Sun, 29 Nov 2020 12:14:52 +0000 (12:14 +0000)
This saves us a good deal of time, even allowing for process startup and
general overhead. Before:

  real    6m39.103s
  user    1m9.561s
  sys     0m2.705s

After:

  real    4m5.267s
  user    1m24.527s
  sys     0m3.828s

This requires N databases, where N is the N of processors on the host.
We need to update the docker configuration for this.

Signed-off-by: Stephen Finucane <stephen@that.guru>
tools/docker/entrypoint.sh
tox.ini

index 6314f1b64eb978c59a3668b70dd0b4b769fae223..8f7ea4f70219ef9ce0e84a72ffb70dee1fa686ec 100755 (executable)
@@ -26,7 +26,7 @@ reset_data_mysql() {
 DROP DATABASE IF EXISTS patchwork;
 CREATE DATABASE patchwork CHARACTER SET utf8;
 GRANT ALL ON patchwork.* TO 'patchwork' IDENTIFIED BY 'password';
-GRANT ALL PRIVILEGES ON test_patchwork.* TO 'patchwork'@'%';
+GRANT ALL ON 'test_patchwork\_%'.* to 'patchwork'@'%';
 FLUSH PRIVILEGES;
 EOF
 }
diff --git a/tox.ini b/tox.ini
index 0849b0597d2f87f8ec180b173a4350711740c4f8..28f29f6dc49c8e86241e63552e5ae1dca04caef0 100644 (file)
--- a/tox.ini
+++ b/tox.ini
@@ -28,7 +28,7 @@ passenv =
     PW_TEST_DB_TYPE PW_TEST_DB_USER PW_TEST_DB_PASS PW_TEST_DB_HOST
     PW_TEST_DB_PORT
 commands =
-    python {toxinidir}/manage.py test --noinput {posargs:patchwork}
+    python {toxinidir}/manage.py test --noinput --parallel -- {posargs:patchwork}
 
 [testenv:bashate]
 deps = bashate