Merge pull request #334 from jannero/test-docs

Document how to run tests on your computer
This commit is contained in:
Ilan Steemers
2019-01-27 18:33:37 +01:00
committed by GitHub
2 changed files with 51 additions and 1 deletions

View File

@@ -186,7 +186,40 @@ For more info check the `Schedules <https://django-q.readthedocs.org/en/latest/s
Testing
~~~~~~~
To run the tests you will need `py.test <http://pytest.org/latest/>`__ and `pytest-django <https://github.com/pytest-dev/pytest-django>`__
To run the tests you will need the following in addition to install requirements:
* `py.test <http://pytest.org/latest/>`__
* `pytest-django <https://github.com/pytest-dev/pytest-django>`__
* disque from https://github.com/antirez/disque.git
* Redis
* MongoDB
The following commands can be used to run the tests:
```
# Create virtual environment
python -m venv venv
# Install requirements
venv/bin/pip install -r requirements.txt
# Install test dependencies
venv/bin/pip install pytest pytest-django
# Install django-q
venv/bin/python setup.py develop
# Run required services (you need to have docker-compose installed)
docker-compose -f test-services-docker-compose.yaml up -d
# Run tests
venv/bin/pytest
# Stop the services required by tests (when you no longer plan to run tests)
docker-compose -f test-services-docker-compose.yaml down
```
Locale

View File

@@ -0,0 +1,17 @@
version: '2.2'
services:
disque:
image: efrecon/disque:1.0-rc1
ports:
- '7711:7711/tcp'
redis:
image: redis:latest
ports:
- '6379:6379/tcp'
mongo:
image: mongo:4
ports:
- '27017:27017/tcp'