Message ID | 20170207214810.31042-1-stephen@that.guru |
---|---|
State | Accepted |
Headers | show |
Hi Stephen, > It's possible to run 'manage.py' commands when using the Docker > container but this is not documented anywhere. Clarify this. Good catch. I normally spawn a shell to do that, but the one-liner is quite handy. > - $ docker-compose run --rm web --quick-test > + $ docker-compose run web --quick-test If you are going to not pass --rm, we should probably let people know that they will occasionally need to run something like: I do: docker rm $(docker ps -a | awk '/Exited/ {print $1}') or, perhaps more properly, using docker's template system: docker rm $(docker ps -a -q -f status=exited) (I haven't tested the 'proper' form.) We should also warn people to occasionally clean up dangling images: docker rmi $(docker images | awk '/<none>/ {print $1}') again, probably more properly: docker rmi $(docker images -q -f dangling=true) (Again, proper form untested.) > +To run specific tox targets or tests, pass arguments to the above: > + > + $ docker-compose run web --quick-tox -e py27-django17 \ > + patchwork.tests.test_bundles This is also a good catch for the docs. Acked-by: Daniel Axtens <dja@axtens.net> Regards, Daniel
diff --git a/docs/development/installation.md b/docs/development/installation.md index cfcc63a..bf1ff5b 100644 --- a/docs/development/installation.md +++ b/docs/development/installation.md @@ -29,25 +29,34 @@ configure Patchwork using Docker: To run a shell within this environment, run: - $ docker-compose run --rm web --shell + $ docker-compose run web --shell + +To run django-manage commands, such as `createsuperuser` or `migrate`, run: + + $ docker-compose run web python manage.py createsuperuser To run unit tests, excluding Selenium UI interaction tests, using only the package versions installed during container initialization, run: - $ docker-compose run --rm web --quick-test + $ docker-compose run web --quick-test To run the same against all supported versions of Django (via tox), run: - $ docker-compose run --rm web --quick-tox + $ docker-compose run web --quick-tox + +To run specific tox targets or tests, pass arguments to the above: + + $ docker-compose run web --quick-tox -e py27-django17 \ + patchwork.tests.test_bundles To run all tests, including Selenium UI interaction tests, using only the package versions installed container initialization, run: - $ docker-compose run --rm web --test + $ docker-compose run web --test To run the same against all supported versions of Django (via tox), run: - $ docker-compose run --rm web --tox + $ docker-compose run web --tox To run all tests, including Selenium UI interaction tests in non-headless mode, run:
It's possible to run 'manage.py' commands when using the Docker container but this is not documented anywhere. Clarify this. Signed-off-by: Stephen Finucane <stephen@that.guru> Cc: Daniel Axtens <dja@axtens.net> --- docs/development/installation.md | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-)