Skip to content

Instantly share code, notes, and snippets.

@kcurtin
Created December 16, 2014 20:29
Show Gist options
  • Save kcurtin/71c9773c2a1db501f43f to your computer and use it in GitHub Desktop.
Save kcurtin/71c9773c2a1db501f43f to your computer and use it in GitHub Desktop.
Travis
before_script:
- ./script/travis/setup_db.sh
script: bundle exec rspec spec/ --tag $TEST_TAG
env:
matrix:
- TEST_TAG=js DB_TEST=1
- TEST_TAG=~js DB_TEST=2
#!/bin/sh
cp config/travis_database.yml config/database.yml
echo "checkpoint_segments='9'\ncheckpoint_timeout='30min'\nfsync='off'\nfull_page_writes='off'\nsynchronous_commit='off'" | sudo tee -a /etc/postgresql/9.3/main/postgresql.conf
psql -c 'create database my_test_1' -U postgres
psql -c "create extension hstore;" "my_test_1"
psql -U postgres -q -d my_test_1 -f db/structure.sql
echo "checkpoint_segments='9'\ncheckpoint_timeout='30min'\nfsync='off'\nfull_page_writes='off'\nsynchronous_commit='off'" | sudo tee -a /etc/postgresql/9.3/main/postgresql.conf
psql -c 'create database my_test_2' -U postgres
psql -c "create extension hstore;" "my_test_2"
psql -U postgres -q -d my_test_2 -f db/structure.sql
sudo /etc/init.d/postgresql restart
test:
adapter: postgresql
database: my_test_<%= ENV['DB_TEST'] %>
username: postgres
pool: 10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment