diff options
author | Alex Grönholm <alex.gronholm@nextday.fi> | 2017-10-21 15:09:49 +0300 |
---|---|---|
committer | Alex Grönholm <alex.gronholm@nextday.fi> | 2017-10-21 15:09:49 +0300 |
commit | d1e75fe2ddf1a3c248cb0654b18c6d4d393bcfe8 (patch) | |
tree | 66fe083ba7f3224bbfece69d3fc62406fd2d46b1 | |
parent | 7263f9d4fd595478c918981b3deb391df6b191eb (diff) | |
download | apscheduler-d1e75fe2ddf1a3c248cb0654b18c6d4d393bcfe8.tar.gz |
Added docker-compose configuration to facilitate testing
-rw-r--r-- | .travis.yml | 8 | ||||
-rw-r--r-- | docker-compose.yml | 21 | ||||
-rw-r--r-- | docs/contributing.rst | 31 |
3 files changed, 41 insertions, 19 deletions
diff --git a/.travis.yml b/.travis.yml index 3619cff..233ba34 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,9 +1,6 @@ sudo: required language: python -services: - - redis - matrix: include: - env: TOXENV=py27 @@ -28,6 +25,7 @@ matrix: - env: TOXENV=flake8 python: "3.5" + before_install: skip after_success: skip - stage: deploy to PyPI @@ -47,9 +45,7 @@ matrix: repo: agronholm/apscheduler before_install: - - docker run -d -p 127.0.0.1:27017:27017 mongo - - docker run -d -p 127.0.0.1:28015:28015 rethinkdb - - docker run -d -p 127.0.0.1:2181:2181 zookeeper + - docker-compose up -d install: pip install tox diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..001e048 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,21 @@ +version: "2" +services: + redis: + image: redis + ports: + - 127.0.0.1:6379:6379 + + mongodb: + image: mongo + ports: + - 127.0.0.1:27017:27017 + + rethinkdb: + image: rethinkdb + ports: + - 127.0.0.1:28015:28015 + + zookeeper: + image: zookeeper + ports: + - 127.0.0.1:2181:2181 diff --git a/docs/contributing.rst b/docs/contributing.rst index fdb0660..bd68e60 100644 --- a/docs/contributing.rst +++ b/docs/contributing.rst @@ -49,16 +49,21 @@ for this. If in doubt, just follow the surrounding code style as closely as poss Testing ======= -Running the test suite is done using the tox utility. This will test the code base against all -supported Python versions and checks for PEP 8 violations as well. - -Since running the tests on every supported Python version can take quite a long time, it is -recommended that during the development cycle py.test is used directly. Before finishing, tox -should however be used to make sure the code works on all supported Python versions. - -Any nontrivial code changes must be accompanied with the appropriate tests. -The tests should not only maintain the coverage, but should test any new functionality or bug fixes -reasonably well. If you're fixing a bug, first make sure you have a test which fails against the -unpatched codebase and succeeds against the fixed version. Naturally, the test suite has to pass on -every Python version. If setting up all the required Python interpreters seems like too much -trouble, make sure that it at least passes on the lowest supported versions of both Python 2 and 3. +Running the test suite is done using the tox_ utility. This will test the code base against all +supported Python versions and performs some code quality checks using flake8_ as well. + +Some tests require the presence of external services (in practice, database servers). To help with +that, there is a docker-compose_ configuration included. Running ``docker-compose up -d`` will +start all the necessary services for the tests to work. + +Any nontrivial code changes must be accompanied with the appropriate tests. The tests should not +only maintain the coverage, but should test any new functionality or bug fixes reasonably well. +If you're fixing a bug, first make sure you have a test which fails against the unpatched codebase +and succeeds against the fixed version. Naturally, the test suite has to pass on every Python +version. If setting up all the required Python interpreters seems like too much trouble, make sure +that it at least passes on the lowest supported versions of both Python 2 and 3. The full test +suite is always run against each pull request, but it's a good idea to run the tests locally first. + +.. _tox: https://tox.readthedocs.io/ +.. _flake8: http://flake8.pycqa.org/ +.. _docker-compose: https://docs.docker.com/compose/ |