Improve testing script

This commit is contained in:
wvengen 2015-05-02 14:22:39 +02:00
parent 27050f8b02
commit c0ae816c77
2 changed files with 9 additions and 3 deletions

View file

@ -1,12 +1,17 @@
#!/bin/sh #!/bin/sh
# Set test variables # We use TEST_DATABASE_URL to make sure we don't accidentaly overwrite dev/prod db
export DATABASE_URL=mysql2://root:secret@mysql/test unset DATABASE_URL; export DATABASE_URL
[ "$TEST_DATABASE_URL" ] && export DATABASE_URL="$TEST_DATABASE_URL"
export RAILS_ENV=test export RAILS_ENV=test
# Start virtuals X environment to allow integration testing via firefox/iceweasel # Start virtuals X environment to allow integration testing via firefox/iceweasel
export DISPLAY=:99 export DISPLAY=:99
Xvfb :99 & Xvfb $DISPLAY -nolisten tcp &
XVFB_PID=$!
# Start tests # Start tests
rspec rspec
# Cleanup
kill $XVFB_PID

View file

@ -13,6 +13,7 @@ app: &app
- DATABASE_URL=mysql2://root:secret@mysql/development - DATABASE_URL=mysql2://root:secret@mysql/development
- REDIS_URL=redis://redis:6379 - REDIS_URL=redis://redis:6379
- QUEUE=foodsoft_notifier - QUEUE=foodsoft_notifier
- TEST_DATABASE_URL=mysql2://root:secret@mysql/test
resque: resque:
<<: *app <<: *app