Skip to content

Instantly share code, notes, and snippets.

@winhamwr
Created April 7, 2010 20:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save winhamwr/359405 to your computer and use it in GitHub Desktop.
Save winhamwr/359405 to your computer and use it in GitHub Desktop.
Hudson script for running selenium tests
#!/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
python scripts/run_selenium_tests.py --headless;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment