forked from mozilla/webpay
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run_ci_tests.sh
executable file
·57 lines (46 loc) · 1.34 KB
/
run_ci_tests.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
54
55
56
57
# This script should be called from within Jenkins
cd $WORKSPACE
VENV=$WORKSPACE/venv
SETTINGS=mkt
echo "Starting build on executor $EXECUTOR_NUMBER..." `date`
echo "Setup..." `date`
# Make sure there's no old pyc files around.
find . -name '*.pyc' | xargs rm
if [ ! -d "$VENV/bin" ]; then
echo "No virtualenv found. Making one..."
virtualenv $VENV --system-site-packages
fi
source $VENV/bin/activate
pip --log-file ./pip.log install -U --exists-action=w --no-deps -q -r requirements/test.txt
cat > webpay/settings/local.py <<SETTINGS
from webpay.settings.base import *
LOG_LEVEL = logging.ERROR
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'zamboni_mkt',
'TEST_NAME': 'test_zamboni_webpay',
'USER': 'hudson',
'PASSWORD': '',
'HOST': '',
'PORT': '',
'OPTIONS': {
'init_command': 'SET storage_engine=InnoDB',
'charset' : 'utf8',
'use_unicode' : True,
},
'TEST_CHARSET': 'utf8',
'TEST_COLLATION': 'utf8_general_ci',
},
}
CELERY_ALWAYS_EAGER = True
STATIC_URL = ''
DEBUG = True
SECRET_KEY = 'cheese will make you live forever'
SETTINGS
echo "Starting tests..." `date`
export FORCE_DB='yes sir'
python manage.py test -v 2 --noinput --logging-clear-handlers --with-xunit
rv=$?
echo 'shazam!'
exit $rv