Skip to content

Instantly share code, notes, and snippets.

@jlward
Forked from winhamwr/gist:359405
Created July 26, 2010 17:50
Show Gist options
  • Save jlward/490916 to your computer and use it in GitHub Desktop.
Save jlward/490916 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Located at: http://gist.github.com/359405
source $WORKSPACE/../../../virtualenvs/$JOB_NAME/bin/activate
./scripts/clean.sh;
# Delete the database so Django doesn't prompt us yes/no to continue
echo "CREATE DATABASE IF NOT EXISTS $JOB_NAME DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;" | mysql -u root;
echo "DROP DATABASE IF EXISTS test_$JOB_NAME;" | mysql -u root;
# Kill any hung nose live servers
fuser -n tcp 8001 -k;
# Kill any hung XVFB displays
ps aux | grep "Xvfb :" | awk '{print $2}' | xargs kill -s 9
# Clear out the old failure screenshots and add a blank png so hudson doesn't freak out
rm -r -f $WORKSPACE/failure_ss
mkdir $WORKSPACE/failure_ss
touch $WORKSPACE/failure_ss/calm_hudson.png
# Deleted the previous noestests results file so that this build fails if tests aren't created
rm $WORKSPACE/pstat/nosetests.xml
export DISPLAY=:99
Xvfb :99 -ac -screen 0 1024x768x24
python scripts/run_selenium_tests.py
ps aux | grep "Xvfb :" | awk '{print $2}' | xargs kill -s 9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment