Skip to content

Instantly share code, notes, and snippets.

@muhammadghazali
Created April 3, 2013 05:59
Show Gist options
  • Save muhammadghazali/5298786 to your computer and use it in GitHub Desktop.
Save muhammadghazali/5298786 to your computer and use it in GitHub Desktop.
Example of task runner that set up and tear down circle_test database. I use this commands when running test in CircleCI.
test:
npm install --dev
mysql -u ubuntu -e 'CREATE DATABASE IF NOT EXISTS circle_test'
mysql -u ubuntu circle_test < test_database.sql
node_modules/vows/bin/vows some-test/*-spec.js
mysql -u ubuntu circle_test < test_database.sql
node_modules/vows/bin/vows another-test/*-spec.js
mysql -u ubuntu -e 'DROP DATABASE IF EXISTS circle_test'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment