OLD | NEW |
(Empty) | |
| 1 #!/bin/bash |
| 2 # |
| 3 # This script assumes that the project 'ptyprocess' is |
| 4 # available in the parent of the project's folder. |
| 5 set -e |
| 6 set -o pipefail |
| 7 |
| 8 if [ -z $1 ]; then |
| 9 echo "$0 (2.6|2.7|3.3|3.4)" |
| 10 exit 1 |
| 11 fi |
| 12 |
| 13 export PYTHONIOENCODING=UTF8 |
| 14 export LANG=en_US.UTF-8 |
| 15 |
| 16 pyversion=$1 |
| 17 shift |
| 18 here=$(cd `dirname $0`; pwd) |
| 19 osrel=$(uname -s) |
| 20 venv=teamcity-pexpect |
| 21 venv_wrapper=$(which virtualenvwrapper.sh) |
| 22 |
| 23 if [ -z $venv_wrapper ]; then |
| 24 echo "virtualenvwrapper.sh not found in PATH." >&2 |
| 25 exit 1 |
| 26 fi |
| 27 |
| 28 . ${venv_wrapper} |
| 29 rmvirtualenv ${venv} || true |
| 30 mkvirtualenv -p `which python${pyversion}` ${venv} || true |
| 31 workon ${venv} |
| 32 |
| 33 # install ptyprocess |
| 34 cd $here/../../ptyprocess |
| 35 pip uninstall --yes ptyprocess || true |
| 36 python setup.py install |
| 37 |
| 38 # install all test requirements |
| 39 pip install --upgrade pytest-cov coverage coveralls pytest-capturelog |
| 40 |
| 41 # run tests |
| 42 cd $here/.. |
| 43 ret=0 |
| 44 py.test \ |
| 45 --cov pexpect \ |
| 46 --cov-config .coveragerc \ |
| 47 --junit-xml=results.${osrel}.py${pyversion}.xml \ |
| 48 --verbose \ |
| 49 --verbose \ |
| 50 "$@" || ret=$? |
| 51 |
| 52 if [ $ret -ne 0 ]; then |
| 53 # we always exit 0, preferring instead the jUnit XML |
| 54 # results to be the dominate cause of a failed build. |
| 55 echo "py.test returned exit code ${ret}." >&2 |
| 56 echo "the build should detect and report these failing tests." >&2 |
| 57 fi |
| 58 |
| 59 # combine all coverage to single file, report for this build, |
| 60 # then move into ./build-output/ as a unique artifact to allow |
| 61 # the final "Full build" step to combine and report to coveralls.io |
| 62 `dirname $0`/teamcity-coverage-report.sh |
| 63 mkdir -p build-output |
| 64 mv .coverage build-output/.coverage.${osrel}.py{$pyversion}.$RANDOM.$$ |
OLD | NEW |