2011-03-31 23:13:07 +04:00
|
|
|
# This script should be called from within Hudson
|
|
|
|
|
|
|
|
|
|
|
|
cd $WORKSPACE
|
|
|
|
VENV=$WORKSPACE/venv
|
|
|
|
VENDOR=$WORKSPACE/vendor
|
|
|
|
LOCALE=$WORKSPACE/locale
|
2011-04-03 23:13:27 +04:00
|
|
|
LOG=$WORKSPACE/jstests-runserver.log
|
2011-03-31 23:13:07 +04:00
|
|
|
|
|
|
|
echo "Starting build on executor $EXECUTOR_NUMBER..." `date`
|
|
|
|
|
|
|
|
if [ -z $1 ]; then
|
|
|
|
echo "Warning: You should provide a unique name for this job to prevent database collisions."
|
|
|
|
echo "Usage: $0 <name>"
|
|
|
|
echo "Continuing, but don't say you weren't warned."
|
|
|
|
fi
|
|
|
|
|
|
|
|
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
|
|
|
|
fi
|
|
|
|
|
|
|
|
source $VENV/bin/activate
|
|
|
|
|
2012-09-15 02:02:05 +04:00
|
|
|
pip install -q -r requirements/compiled.txt -r requirements/test.txt
|
2011-03-31 23:13:07 +04:00
|
|
|
|
|
|
|
# Create paths we want for addons
|
|
|
|
if [ ! -d "/tmp/warez" ]; then
|
|
|
|
mkdir /tmp/warez
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ ! -d "$LOCALE" ]; then
|
|
|
|
echo "No locale dir? Cloning..."
|
|
|
|
svn co http://svn.mozilla.org/addons/trunk/site/app/locale/ $LOCALE
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ ! -d "$VENDOR" ]; then
|
|
|
|
echo "No vendor lib? Cloning..."
|
2011-10-18 01:08:01 +04:00
|
|
|
git clone --recursive git://github.com/mozilla/zamboni-lib.git $VENDOR
|
2011-03-31 23:13:07 +04:00
|
|
|
fi
|
|
|
|
|
|
|
|
# Update the vendor lib.
|
|
|
|
echo "Updating vendor..."
|
2011-12-28 00:50:10 +04:00
|
|
|
git submodule --quiet foreach 'git submodule --quiet sync'
|
2011-09-28 03:05:12 +04:00
|
|
|
git submodule --quiet sync && git submodule update --init --recursive
|
2011-03-31 23:13:07 +04:00
|
|
|
|
2011-05-03 22:03:34 +04:00
|
|
|
cp -f docs/settings/settings_local.dev.py settings_local.py
|
|
|
|
cat >> settings_local.py <<SETTINGS
|
2011-05-03 22:11:32 +04:00
|
|
|
|
2012-02-01 05:35:34 +04:00
|
|
|
ROOT_URLCONF = 'lib.urls_base'
|
2011-03-31 23:13:07 +04:00
|
|
|
LOG_LEVEL = logging.ERROR
|
2011-05-03 22:11:32 +04:00
|
|
|
|
|
|
|
DATABASES = {
|
|
|
|
'default': {
|
|
|
|
'NAME': 'zamboni_$1',
|
|
|
|
'HOST': 'localhost',
|
|
|
|
'ENGINE': 'django.db.backends.mysql',
|
|
|
|
'USER': 'hudson',
|
|
|
|
'OPTIONS': {'init_command': 'SET storage_engine=InnoDB'},
|
|
|
|
'TEST_NAME': 'test_zamboni_$1',
|
|
|
|
'TEST_CHARSET': 'utf8',
|
|
|
|
'TEST_COLLATION': 'utf8_general_ci',
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
2011-03-31 23:13:07 +04:00
|
|
|
CACHE_BACKEND = 'caching.backends.locmem://'
|
|
|
|
CELERY_ALWAYS_EAGER = True
|
|
|
|
ADDONS_PATH = '/tmp/warez'
|
|
|
|
|
|
|
|
# Activate Qunit:
|
|
|
|
INSTALLED_APPS += (
|
|
|
|
'django_qunit',
|
|
|
|
)
|
|
|
|
|
|
|
|
SETTINGS
|
|
|
|
|
|
|
|
|
2011-04-01 02:11:06 +04:00
|
|
|
# All DB tables need to exist so that runserver can start up.
|
2011-04-01 02:27:43 +04:00
|
|
|
python manage.py syncdb --noinput
|
2011-04-01 02:11:06 +04:00
|
|
|
|
2011-03-31 23:13:07 +04:00
|
|
|
echo "Starting JS tests..." `date`
|
|
|
|
|
2011-04-03 23:13:27 +04:00
|
|
|
rm $LOG
|
2011-03-31 23:13:07 +04:00
|
|
|
cd scripts
|
2011-09-21 06:57:55 +04:00
|
|
|
# Some of these env vars are set in the Jenkins build step.
|
|
|
|
BROWSERS=firefox
|
2011-09-28 03:14:29 +04:00
|
|
|
XARGS="-v --with-xunit --with-django-serv --django-host $DJANGO_HOST --django-port $DJANGO_PORT --django-log $LOG --django-startup-uri /robots.txt --django-root-dir $WORKSPACE --with-jstests --jstests-server http://jstestnet.farmdev.com/ --jstests-suite zamboni --jstests-token $JSTESTS_TOKEN --jstests-browsers $BROWSERS --debug nose.plugins.jstests"
|
2011-09-21 06:57:55 +04:00
|
|
|
python run_jstests.py --jstests-url http://$DJANGO_HOST:$DJANGO_PORT/en-US/qunit/ --xunit-file=nosetests.xml $XARGS
|
2011-03-31 23:13:07 +04:00
|
|
|
|
|
|
|
echo 'shazam!'
|