Test rethinkdb and mongodb in separate travis jobs

This commit is contained in:
Sylvain Bellemare 2016-12-08 17:58:26 +01:00 committed by Sylvain Bellemare
parent b6293702ce
commit 9f57d57f24
7 changed files with 54 additions and 18 deletions

View File

@ -2,6 +2,6 @@
set -e -x
if [ "${TOXENV}" == "py35" ]; then
if [[ -z ${TOXENV} ]]; then
codecov
fi

View File

@ -1,8 +1,6 @@
#!/bin/bash
if [ "${TOXENV}" == "py34" ] || [ "${TOXENV}" == "py35" ]; then
source /etc/lsb-release
echo "deb http://download.rethinkdb.com/apt $DISTRIB_CODENAME main" | tee -a /etc/apt/sources.list.d/rethinkdb.list
wget -qO- https://download.rethinkdb.com/apt/pubkey.gpg | apt-key add -
apt-get update -qq
fi
apt-get update -qq
wget https://github.com/miloyip/rapidjson/archive/v1.1.0.tar.gz -O /tmp/v1.1.0.tar.gz
tar -xvf /tmp/v1.1.0.tar.gz
cp -r $PWD/rapidjson-1.1.0/include/rapidjson /usr/include/

View File

@ -2,6 +2,8 @@
set -e -x
if [ "${TOXENV}" == "py34" ] || [ "${TOXENV}" == "py35" ]; then
if [[ "${TOXENV}" == *-rdb ]]; then
rethinkdb --daemon
elif [[ "${TOXENV}" == *-mdb ]]; then
sudo service mongod start
fi

View File

@ -3,9 +3,10 @@
set -e -x
pip install --upgrade pip
pip install --upgrade tox
if [ "${TOXENV}" == "py34" ] || [ "${TOXENV}" == "py35" ]; then
sudo apt-get install rethinkdb
if [[ -n ${TOXENV} ]]; then
pip install --upgrade tox
else
pip install -e .[test]
pip install --upgrade codecov
fi

9
.ci/travis_script.sh Executable file
View File

@ -0,0 +1,9 @@
#!/bin/bash
set -e -x
if [[ -n ${TOXENV} ]]; then
tox -e ${TOXENV}
else
pytest -v -n auto --cov=bigchaindb
fi

View File

@ -1,19 +1,43 @@
language: python
cache: pip
python:
- 3.4
- 3.5
env:
- TOXENV=py34
- TOXENV=py35
- TOXENV=flake8
- TOXENV=docsroot
- TOXENV=docsserver
matrix:
fast_finish: true
allow_failures:
- env: BIGCHAINDB_DATABASE_BACKEND=mongodb
exclude:
- python: 3.4
env: TOXENV=flake8
- python: 3.4
env: TOXENV=docsroot
- python: 3.4
env: TOXENV=docsserver
include:
- python: 3.4
addons:
rethinkdb: '2.3.5'
env: BIGCHAINDB_DATABASE_BACKEND=rethinkdb
- python: 3.5
services: mongodb
env: BIGCHAINDB_DATABASE_BACKEND=mongodb
- python: 3.5
addons:
rethinkdb: '2.3.5'
env: BIGCHAINDB_DATABASE_BACKEND=rethinkdb
before_install: sudo .ci/travis-before-install.sh
install: .ci/travis-install.sh
before_script: .ci/travis-before-script.sh
script: tox -e ${TOXENV}
script: .ci/travis_script.sh
after_success: .ci/travis-after-success.sh

View File

@ -1,6 +1,6 @@
[tox]
skipsdist = true
envlist = py34, py35, flake8, docsroot, docsserver
envlist = py{34,35}-{rethinkdb,mongodb}, flake8, docsroot, docsserver
[base]
basepython = python3.5
@ -9,7 +9,9 @@ deps = pip>=9.0.1
[testenv]
usedevelop = True
setenv =
PYTHONPATH = {toxinidir}:{toxinidir}/bigchaindb
PYTHONPATH={toxinidir}:{toxinidir}/bigchaindb
rethinkdb: BIGCHAINDB_DATABASE_BACKEND=rethinkdb
mongodb: BIGCHAINDB_DATABASE_BACKEND=mongodb
deps = {[base]deps}
extras = test
commands = pytest -v -n auto --cov=bigchaindb --basetemp={envtmpdir}