mirror of
https://github.com/django-q2/django-q2.git
synced 2026-10-04 20:58:12 +08:00
Document how to run tests on your computer
This commit is contained in:
+34
-1
@@ -186,7 +186,40 @@ For more info check the `Schedules <https://django-q.readthedocs.org/en/latest/s
|
|||||||
Testing
|
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
|
Locale
|
||||||
|
|||||||
@@ -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'
|
||||||
Reference in New Issue
Block a user