summaryrefslogtreecommitdiff
path: root/unit-test.sh
diff options
context:
space:
mode:
Diffstat (limited to 'unit-test.sh')
-rwxr-xr-xunit-test.sh34
1 files changed, 14 insertions, 20 deletions
diff --git a/unit-test.sh b/unit-test.sh
index 3590e90..031e55b 100755
--- a/unit-test.sh
+++ b/unit-test.sh
@@ -7,40 +7,34 @@ VENV_DIR="${VENV_DIR-$HERE/.venv}"
if [ -z $VIRTUAL_ENV ] ; then
echo "creating venv: $VENV_DIR ..."
- virtualenv --python=`which python2` $VENV_DIR
+ virtualenv --python=`which python3` $VENV_DIR
. $VENV_DIR/bin/activate
- pip install Django==1.8.10
- pip install djangorestframework==3.5
- pip install django-filter==1.0
- pip install sqlparse==0.2.2
- pip install dulwich
- pip install mock
- pip install flake8
+ pip install -r requirements.txt
+ wget -q https://git.linaro.org/infrastructure/linaro-git-tools.git/plain/linaro_ldap.py
fi
if [ -z $PYTHONPATH ] ; then
- git clone https://github.com/getpatchwork/patchwork.git $VENV_DIR/patchwork
- cd $VENV_DIR/patchwork
- git checkout -b production v2.0.1
- cd $HERE
+ if [ ! -d $VENV_DIR/patchwork ]; then
+ git clone https://github.com/getpatchwork/patchwork.git $VENV_DIR/patchwork
+ cd $VENV_DIR/patchwork
+ git checkout -b production v2.0.1
+ cd $HERE
+ fi
export PYTHONPATH=$VENV_DIR/patchwork
fi
echo
echo "== Running flake8 checks..."
echo
-FLAKE_EXCLUDE="linaro_metrics/migrations"
-if echo $VENV_DIR | grep $HERE ; then
- # make sure we don't run tests on the venv if its in our source tree
- FLAKE_EXCLUDE="$VENV_DIR,$FLAKE_EXCLUDE"
-fi
-flake8 --ignore=E402 --show-source --exclude=$FLAKE_EXCLUDE ./
+flake8 --show-source ./
echo
echo "== Running test suite..."
echo
-git config --global user.email "citestbot@example.com"
-git config --global user.name "ci test bot"
+if [ ! -f ~/.gitconfig ] ; then
+ git config --global user.email "citestbot@example.com"
+ git config --global user.name "ci test bot"
+fi
export DJANGO_SETTINGS_MODULE=linaro_metrics.settings
export PYTHONPATH=./:./tests:$PYTHONPATH