diff mbox

[6/7] Enable tox tests in Docker

Message ID 1470718525-32603-7-git-send-email-dja@axtens.net
State Accepted
Headers show

Commit Message

Daniel Axtens Aug. 9, 2016, 4:55 a.m. UTC
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>
---
 README.md            | 2 ++
 docker/entrypoint.sh | 7 +++++++
 2 files changed, 9 insertions(+)

Comments

Stephen Finucane Aug. 21, 2016, 3:23 p.m. UTC | #1
On 09 Aug 14:55, Daniel Axtens wrote:
> 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>
diff mbox

Patch

diff --git a/README.md b/README.md
index 3c25f04d7c8d..996d5064ec06 100644
--- 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:
diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh
index 0966cf2ec432..dcdf2ddb43d3 100755
--- a/docker/entrypoint.sh
+++ b/docker/entrypoint.sh
@@ -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