-
Notifications
You must be signed in to change notification settings - Fork 1
/
runtests.sh
executable file
·44 lines (34 loc) · 1.02 KB
/
runtests.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/bash
###
# Setup virtualenv
###
virtualenv --python=python2.7 /home/jenkins/.virtualenvs/jenkins
wrapper=
for file in "/usr/share/virtualenvwrapper/virtualenvwrapper.sh" "/usr/local/bin/virtualenvwrapper.sh"
do
echo -n "Does \`${file}' exists ? "
[ -f "${file}" ] && { wrapper="$file" ; echo "yes" ; } || { echo "no" ; }
[ -n "${wrapper}" ] && break
done
[ -z "${wrapper}" ] && { echo "Please install virtualenvwrapper" 1>&2 ; exit 1 ; }
venv_name="jenkins"
export WORKON_HOME="/home/jenkins/.virtualenvs"
source "${wrapper}"
[ -d "$HOME/.virtualenvs/${venv_name}" ] || { mkvirtualenv -a . "${venv_name}" ; }
workon "${venv_name}" 2> /dev/null
if [ "0" != "$?" ]
then
echo "Please setup a virtualenv named \`${venv_name}' for this test-runner."
exit 1
fi
set -x
###
# Intalling/updating dependencies and package
###
wget https://bootstrap.pypa.io/get-pip.py && python get-pip.py
pip install --upgrade -r dev-requirements.txt
pip install -e .
###
# Environment is set. Start the real work
###
nosetests -v --stop