Improve testing script
This commit is contained in:
parent
27050f8b02
commit
c0ae816c77
2 changed files with 9 additions and 3 deletions
11
bin/test
11
bin/test
|
@ -1,12 +1,17 @@
|
|||
#!/bin/sh
|
||||
|
||||
# Set test variables
|
||||
export DATABASE_URL=mysql2://root:secret@mysql/test
|
||||
# We use TEST_DATABASE_URL to make sure we don't accidentaly overwrite dev/prod db
|
||||
unset DATABASE_URL; export DATABASE_URL
|
||||
[ "$TEST_DATABASE_URL" ] && export DATABASE_URL="$TEST_DATABASE_URL"
|
||||
export RAILS_ENV=test
|
||||
|
||||
# Start virtuals X environment to allow integration testing via firefox/iceweasel
|
||||
export DISPLAY=:99
|
||||
Xvfb :99 &
|
||||
Xvfb $DISPLAY -nolisten tcp &
|
||||
XVFB_PID=$!
|
||||
|
||||
# Start tests
|
||||
rspec
|
||||
|
||||
# Cleanup
|
||||
kill $XVFB_PID
|
||||
|
|
|
@ -13,6 +13,7 @@ app: &app
|
|||
- DATABASE_URL=mysql2://root:secret@mysql/development
|
||||
- REDIS_URL=redis://redis:6379
|
||||
- QUEUE=foodsoft_notifier
|
||||
- TEST_DATABASE_URL=mysql2://root:secret@mysql/test
|
||||
|
||||
resque:
|
||||
<<: *app
|
||||
|
|
Loading…
Reference in a new issue