forked from djangocon/2017.djangocon.eu
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathruntests.sh
executable file
·53 lines (47 loc) · 1.23 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
45
46
47
48
49
50
51
52
53
#!/bin/bash
set -e
# Prerequisites
# npm
# npm install -g grunt grunt-cli
# gem install bundle
# virtualenv
fail=0
if [[ "z$CI_USE_GRUNT" == "z" ]]; then
npm install > /dev/null
bundle install --deployment > /dev/null
echo "===== Frontend tests ====="
grunt ci || fail=1
# if executed with bundle: bundle exec scss-lint
fi
if [[ "z$CI_SERVER" = "zyes" ]]; then
PROJECT_DIR=`pwd`
PROJECT_ID=`basename $PROJECT_DIR`
VENV_DIR="/srv/virtualenvs/$PROJECT_ID"
else
VENV_DIR=".testenv"
fi
if [[ ! -e $VENV_DIR ]]; then
virtualenv --python=/usr/bin/python3.5 $VENV_DIR #> /dev/null
fi
. $VENV_DIR/bin/activate
pip install -U pip setuptools pip-tools > /dev/null
pip install -r requirements-test.txt > /dev/null
pip install coverage > /dev/null
mkdir -p log
echo "===== Flake 8 ====="
flake8 djangocon_europe conference || fail=1
echo "Done"
echo "===== isort ====="
isort -c -rc -df djangocon_europe conference || fail=1
echo "Done"
echo "===== Django tests ====="
coverage erase
coverage run manage.py test --settings=djangocon_europe.settings_tests || fail=1
#if [[ $fail -eq 0 ]]; then
# if [[ "z$CI_SERVER" = "zyes" ]]; then
# coverage report
# else
# coverage report -m
# fi
#fi
exit $fail