|
| 1 | +#!/bin/bash |
| 2 | + |
| 3 | +set -e |
| 4 | +set -x |
| 5 | + |
| 6 | +proj=schema-salad |
| 7 | +repo=https://github.com/common-workflow-language/schema_salad.git |
| 8 | +run_tests="py.test ${proj}" |
| 9 | + |
| 10 | +rm -Rf testenv? || /bin/true |
| 11 | + |
| 12 | +export HEAD=`git rev-parse HEAD` |
| 13 | +virtualenv testenv1 |
| 14 | +virtualenv testenv2 |
| 15 | +virtualenv testenv3 |
| 16 | +virtualenv testenv4 |
| 17 | + |
| 18 | +# First we test the head |
| 19 | +source testenv1/bin/activate |
| 20 | +make install-dependencies |
| 21 | +make test |
| 22 | +pip uninstall -y ${proj} || true; pip uninstall -y ${proj} || true; make install |
| 23 | +mkdir testenv1/not-${proj} |
| 24 | +# if there is a subdir named '${proj}' py.test will execute tests |
| 25 | +# there instead of the installed module's tests |
| 26 | +pushd testenv1/not-${proj}; ../bin/${run_tests}; popd |
| 27 | + |
| 28 | + |
| 29 | +# Secondly we test via pip |
| 30 | + |
| 31 | +cd testenv2 |
| 32 | +source bin/activate |
| 33 | +pip install -U setuptools==3.4.1 |
| 34 | +pip install -e git+${repo}@${HEAD}#egg=${proj} |
| 35 | +cd src/${proj} |
| 36 | +make install-dependencies |
| 37 | +make dist |
| 38 | +make test |
| 39 | +cp dist/${proj}*tar.gz ../../../testenv3/ |
| 40 | +pip uninstall -y ${proj} || true; pip uninstall -y ${proj} || true; make install |
| 41 | +cd ../.. # no subdir named ${proj} here, safe for py.testing the installed module |
| 42 | +bin/${run_tests} |
| 43 | + |
| 44 | +# Is the distribution in testenv2 complete enough to build another |
| 45 | +# functional distribution? |
| 46 | + |
| 47 | +cd ../testenv3/ |
| 48 | +source bin/activate |
| 49 | +pip install -U setuptools==3.4.1 |
| 50 | +pip install ${proj}*tar.gz |
| 51 | +pip install nose |
| 52 | +tar xzf ${proj}*tar.gz |
| 53 | +cd ${proj}* |
| 54 | +make dist |
| 55 | +make test |
| 56 | +pip uninstall -y ${proj} || true; pip uninstall -y ${proj} || true; make install |
| 57 | +mkdir ../not-${proj} |
| 58 | +pushd ../not-${proj} ; ../bin/${run_tests}; popd |
0 commit comments