forked from MongoEngine/extras-mongoengine
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Tests] Add Travis CI + Coveralls.io code coverage
Adds the files `.travis.yml` and `.coveragerc` enabling testing on Travis CI and code coverage statistics on Coveralls.io, similar to the parent MongoEngine repo (https://github.com/MongoEngine/mongoengine). Should fix issue MongoEngine#4. (Somebody may have to login to travis-ci.org to get things going)
- Loading branch information
1 parent
e46de91
commit 2d99072
Showing
4 changed files
with
62 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Test coverage configuration. | ||
# Usage: | ||
# pip install coverage | ||
# coverage erase # clears previous data if any | ||
# coverage run -m unittest2 | ||
# coverage html # creates ./htmlcov/*.html (check index.html) | ||
[run] | ||
branch = true | ||
source = extras_mongoengine |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
*.pyc | ||
build/ | ||
venv/ | ||
|
||
# Coverage | ||
/htmlcov | ||
/.coverage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
language: python | ||
python: | ||
- '2.6' | ||
- '2.7' | ||
- '3.2' | ||
- '3.3' | ||
- '3.4' | ||
- pypy | ||
- pypy3 | ||
env: | ||
- PYMONGO=2.7 | ||
- PYMONGO=2.8 | ||
- PYMONGO=3.0 | ||
- PYMONGO=dev | ||
matrix: | ||
fast_finish: true | ||
before_install: | ||
# Install MongoDB | ||
- travis_retry sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10 | ||
- echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' | | ||
sudo tee /etc/apt/sources.list.d/mongodb.list | ||
- travis_retry sudo apt-get update | ||
- travis_retry sudo apt-get install mongodb-org-server | ||
install: | ||
# 1. Install Python | ||
- sudo apt-get install python-dev python3-dev | ||
# 2. Install general requirements (Python packages) | ||
- pip install -r requirements.txt | ||
# 3. Enums in Python only became available in 3.4. | ||
# The package `enum34` listed in `requirements-python<3.4.txt` is a backport. | ||
- if [[ $TRAVIS_PYTHON_VERSION == 2* ]]; then pip install -r 'requirements-python<3.4.txt'; fi | ||
- if [[ $TRAVIS_PYTHON_VERSION == 3.2* ]]; then pip install -r 'requirements-python<3.4.txt'; fi | ||
- if [[ $TRAVIS_PYTHON_VERSION == 3.3* ]]; then pip install -r 'requirements-python<3.4.txt'; fi | ||
- if [[ $TRAVIS_PYTHON_VERSION == pypy* ]]; then pip install -r 'requirements-python<3.4.txt'; fi | ||
# Coverage 4.0 doesn't support Python 3.2. Install an older version | ||
# before coveralls tries to install the latest. (pypy3 is really Python 3.2) | ||
- if [[ $TRAVIS_PYTHON_VERSION == '3.2' ]]; then travis_retry pip install 'coverage<4.0'; fi | ||
- if [[ $TRAVIS_PYTHON_VERSION == 'pypy3' ]]; then travis_retry pip install 'coverage<4.0'; fi | ||
- travis_retry pip install tox>=1.9 coveralls | ||
#- travis_retry tox -e $(echo py$TRAVIS_PYTHON_VERSION-mg$PYMONGO | tr -d . | sed -e 's/pypypy/pypy/') -- -e test | ||
script: | ||
#- tox -e $(echo py$TRAVIS_PYTHON_VERSION-mg$PYMONGO | tr -d . | sed -e 's/pypypy/pypy/') -- --with-coverage | ||
# Run tests with coverage (similar to `python -m unittest2` | ||
# or `unit2` on Python 2.6. | ||
- coverage run -m unittest2 | ||
after_script: | ||
# Submit coverage to coverall.io | ||
- coveralls --verbose |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
enum34 |