Skip to content

Commit

Permalink
Improve documentation on how to run tests
Browse files Browse the repository at this point in the history
Also update gitignore / dockerignore
  • Loading branch information
wil93 committed May 14, 2023
1 parent a775792 commit 3896952
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 0 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
Dockerfile
docker-compose*.yml
.vagrant/
codecov/
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ cache/
lib/
log/
.vagrant/
codecov/
Empty file added codecov/.gitkeep
Empty file.
34 changes: 34 additions & 0 deletions docs/Docker image.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
Docker image
************

We provide a docker image (defined in :gh_blob:`Dockerfile`) that can be used to
easily get an instance of CMS running locally with all the necessary
dependencies. We also provide a :gh_blob:`docker-compose.test.yml` files that
uses said docker image to run the tests.

.. _docker-image_running-tests:

Running tests
=============

First you need to build the image:

.. sourcecode:: bash

sudo docker-compose -f docker-compose.test.yml build cms_test

Then you can run the tests:

.. sourcecode:: bash

sudo docker-compose -f docker-compose.test.yml run --rm cms_test

This command will create a ``cms_test_db`` container for the database which
**will not** be automatically deleted, and a ``cms_test`` container for CMS
which will be automatically deleted (because of the ``--rm`` flag) upon exiting.

To delete the ``cms_test_db`` container after testing you can run:

.. sourcecode:: bash

sudo docker rm -f cms_test_db
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Welcome to CMS's documentation!
:maxdepth: 2

Introduction
Docker image
Installation
Running CMS
Data model
Expand Down

0 comments on commit 3896952

Please sign in to comment.