Tests/Tox/TravisCI improvements

This commit is contained in:
Axel Haustant 2015-04-17 11:26:47 +02:00
parent aa7bf7af1e
commit 91ee85152c
6 changed files with 29 additions and 32 deletions

View File

@ -8,20 +8,30 @@ python:
- pypy - pypy
- pypy3 - pypy3
env: env:
- PYMONGO=2.7.2 - PYMONGO=2.7 DJANGO=dev
- PYMONGO=2.8 - PYMONGO=2.7 DJANGO=1.8
- PYMONGO=2.7 DJANGO=1.7
- PYMONGO=2.7 DJANGO=1.6
- PYMONGO=2.7 DJANGO=1.5
- PYMONGO=2.8 DJANGO=dev
- PYMONGO=2.8 DJANGO=1.8
- PYMONGO=2.8 DJANGO=1.7
- PYMONGO=2.8 DJANGO=1.6
- PYMONGO=2.8 DJANGO=1.5
matrix: matrix:
exclude: exclude:
- python: '2.6' - python: '2.6'
env: PYMONGO=2.7.2 env: PYMONGO=2.7 DJANGO=dev
- python: '2.6' - python: '2.6'
env: PYMONGO=2.8 env: PYMONGO=2.8
- python: '2.6' - python: '2.6'
env: PYMONGO=2.7.2 env: PYMONGO=2.7 DJANGO=1.7
- python: '2.6' - python: '2.6'
env: PYMONGO=2.8 env: PYMONGO=2.8 DJANGO=1.7
allow_failures: - python: '2.6'
- python: pypy3 env: PYMONGO=2.7 DJANGO=1.8
- python: '2.6'
env: PYMONGO=2.8 DJANGO=1.8
fast_finish: true fast_finish: true
before_install: before_install:
- travis_retry sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10 - travis_retry sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
@ -33,19 +43,9 @@ install:
- sudo apt-get install python-dev python3-dev libopenjpeg-dev zlib1g-dev libjpeg-turbo8-dev - sudo apt-get install python-dev python3-dev libopenjpeg-dev zlib1g-dev libjpeg-turbo8-dev
libtiff4-dev libjpeg8-dev libfreetype6-dev liblcms2-dev libwebp-dev tcl8.5-dev tk8.5-dev libtiff4-dev libjpeg8-dev libfreetype6-dev liblcms2-dev libwebp-dev tcl8.5-dev tk8.5-dev
python-tk python-tk
- if [[ $PYMONGO == 'dev' ]]; then travis_retry pip install https://github.com/mongodb/mongo-python-driver/tarball/master; - travis_retry pip install tox>=1.9
true; fi
- if [[ $PYMONGO != 'dev' ]]; then travis_retry pip install pymongo==$PYMONGO; true;
fi
- travis_retry pip install https://pypi.python.org/packages/source/p/python-dateutil/python-dateutil-2.1.tar.gz#md5=1534bb15cf311f07afaa3aacba1c028b
- travis_retry pip install coveralls
- travis_retry python setup.py install
script: script:
- travis_retry python setup.py test - tox -e $(echo py$TRAVIS_PYTHON_VERSION-mg$PYMONGO-dj$DJANGO | tr -d . | sed -e 's/pypypy/pypy/') -- with-coverage
- if [[ $TRAVIS_PYTHON_VERSION == '3.'* ]]; then 2to3 . -w; fi;
- coverage run --source=mongoengine setup.py test
- coverage report -m
- python benchmark.py
after_script: coveralls --verbose after_script: coveralls --verbose
notifications: notifications:
irc: irc.freenode.org#mongoengine irc: irc.freenode.org#mongoengine

View File

@ -44,7 +44,7 @@ General Guidelines
- Avoid backward breaking changes if at all possible. - Avoid backward breaking changes if at all possible.
- Write inline documentation for new classes and methods. - Write inline documentation for new classes and methods.
- Write tests and make sure they pass (make sure you have a mongod - Write tests and make sure they pass (make sure you have a mongod
running on the default port, then execute ``python setup.py test`` running on the default port, then execute ``python setup.py nosetests``
from the cmd line to run the test suite). from the cmd line to run the test suite).
- Ensure tests pass on every Python and PyMongo versions. - Ensure tests pass on every Python and PyMongo versions.
You can test on these versions locally by executing ``tox`` You can test on these versions locally by executing ``tox``

View File

@ -96,7 +96,7 @@ Some simple examples of what MongoEngine code looks like::
Tests Tests
===== =====
To run the test suite, ensure you are running a local instance of MongoDB on To run the test suite, ensure you are running a local instance of MongoDB on
the standard port, and run: ``python setup.py test``. the standard port, and run: ``python setup.py nosetests``.
To run the test suite on every supported Python version and every supported PyMongo version, To run the test suite on every supported Python version and every supported PyMongo version,
you can use ``tox``. you can use ``tox``.

View File

@ -1,12 +1,9 @@
[nosetests] [nosetests]
verbosity = 3 rednose = 1
verbosity = 2
detailed-errors = 1 detailed-errors = 1
#with-coverage = 1 cover-erase = 1
#cover-erase = 1 cover-branches = 1
#cover-html = 1 cover-package = mongoengine
#cover-html-dir = ../htmlcov
#cover-package = mongoengine
py3where = build py3where = build
#where = tests where = tests
tests = tests
#tests = document/__init__.py

View File

@ -29,7 +29,6 @@ init = os.path.join(os.path.dirname(__file__), 'mongoengine', '__init__.py')
version_line = list(filter(lambda l: l.startswith('VERSION'), open(init)))[0] version_line = list(filter(lambda l: l.startswith('VERSION'), open(init)))[0]
VERSION = get_version(eval(version_line.split('=')[-1])) VERSION = get_version(eval(version_line.split('=')[-1]))
print(VERSION)
CLASSIFIERS = [ CLASSIFIERS = [
'Development Status :: 4 - Beta', 'Development Status :: 4 - Beta',
@ -79,5 +78,6 @@ setup(name='mongoengine',
classifiers=CLASSIFIERS, classifiers=CLASSIFIERS,
install_requires=['pymongo>=2.7.1'], install_requires=['pymongo>=2.7.1'],
test_suite='nose.collector', test_suite='nose.collector',
setup_requires=['nose', 'rednose'], # Allow proper nose usage with setuptols and tox
**extra_opts **extra_opts
) )

View File

@ -5,7 +5,7 @@ envlist =
[testenv] [testenv]
commands = commands =
python setup.py test python setup.py nosetests {posargs}
deps = deps =
mg27: PyMongo<2.8 mg27: PyMongo<2.8
mg28: PyMongo>=2.8,<3.0 mg28: PyMongo>=2.8,<3.0