]> git.ipfire.org Git - thirdparty/patchwork.git/commitdiff
Enable tox tests in Docker
authorDaniel Axtens <dja@axtens.net>
Tue, 9 Aug 2016 04:55:24 +0000 (14:55 +1000)
committerStephen Finucane <stephenfinucane@hotmail.com>
Sun, 21 Aug 2016 16:00:48 +0000 (17:00 +0100)
Update the entrypoint script to allow you to do --tox and
--quick-tox in the same way as --test and --quick-test.
Update the readme appropriately.

Signed-off-by: Daniel Axtens <dja@axtens.net>
Reviewed-by: Stephen Finucane <stephenfinucane@hotmail.com>
README.md
docker/entrypoint.sh

index 3c25f04d7c8d0ec9d5aec39b6091654a11f9f632..996d5064ec06db89548407f9395370a281f4d4e0 100644 (file)
--- a/README.md
+++ b/README.md
@@ -60,6 +60,8 @@ of community projects.
 
           $ docker-compose run --rm web --test
 
+  * Tox tests can be run with `--quick-tox` and `--tox`.
+
   * To reset the database before beginning, add `--reset` to the command line after `web` and before any other arguments.
 
   * If you want to run non-headless tests, you'll need something like this ugly hack:
index 8efaadad5d398b5f1f8dc30c0e17843c24979795..744ed69076f39b67b24b237468a946a86b8651b5 100755 (executable)
@@ -81,6 +81,13 @@ elif [ "$1" == "--quick-test" ]; then
     python3 manage.py test
 elif [ "$1" == "--test" ]; then
     xvfb-run --server-args='-screen 0, 1024x768x16' python3 manage.py test
+elif [ "$1" == "--quick-tox" ]; then
+    shift
+    export PW_SKIP_BROWSER_TESTS=yes
+    tox $@
+elif [ "$1" == "--tox" ]; then
+    shift
+    xvfb-run --server-args='-screen 0, 1024x768x16' tox $@
 else # run whatever CMD is set to
     $@
 fi