Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

executable file 72 lines (57 sloc) 1.787 kB
#!/bin/sh
# This script makes sure that Jenkins can properly run your tests against your
# codebase.
set -e
DB_HOST="localhost"
DB_USER="hudson"
cd $WORKSPACE
VENV=$WORKSPACE/venv
echo "Starting build on executor $EXECUTOR_NUMBER..."
# Make sure there's no old pyc files around.
find . -name '*.pyc' -exec rm {} \;
if [ ! -d "$VENV/bin" ]; then
echo "No virtualenv found. Making one..."
virtualenv $VENV #--no-site-packages
source $VENV/bin/activate
pip install --upgrade pip
pip install coverage
fi
git submodule sync -q
git submodule update --init --recursive
if [ ! -d "$WORKSPACE/vendor" ]; then
echo "No /vendor... crap."
exit 1
fi
source $VENV/bin/activate
pip install -q --exists-action=w --no-deps -r requirements/compiled.txt
pip install -q --exists-action=w --no-deps -r requirements/test.txt
cat > solitude/settings/local.py <<SETTINGS
from solitude.settings.base import *
DEBUG = True
SECRET_KEY = 'not-blank-honest'
ROOT_URLCONF = 'solitude.urls'
LOG_LEVEL = logging.ERROR
# Database name has to be set because of sphinx
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'HOST': '${DB_HOST}',
'NAME': '${JOB_NAME}',
'USER': 'hudson',
'PASSWORD': '',
'OPTIONS': {'init_command': 'SET storage_engine=InnoDB'},
'TEST_NAME': 'test_${JOB_NAME}',
'TEST_CHARSET': 'utf8',
'TEST_COLLATION': 'utf8_general_ci',
}
}
INSTALLED_APPS += ('django_nose',)
CELERY_ALWAYS_EAGER = True
SETTINGS
echo "Creating database if we need it..."
echo "CREATE DATABASE IF NOT EXISTS ${JOB_NAME}"|mysql -u $DB_USER -h $DB_HOST
echo "Starting tests..."
export FORCE_DB=1
coverage run manage.py test --noinput --with-xunit
coverage xml $(find apps lib -name '*.py')
echo "FIN"
Jump to Line
Something went wrong with that request. Please try again.