Skip to content

Commit 609ab35

Browse files
committed
fix to allow travis tests for different RAILS_ENV
updated test database config to support development and production environments
1 parent 3fac8df commit 609ab35

File tree

4 files changed

+26
-1
lines changed

4 files changed

+26
-1
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ before_install:
2929

3030
before_script:
3131
- sh -c "if [ '$SUITE' = 'rake teaspoon' ]; then sh -e /etc/init.d/xvfb start && sleep 60; fi"
32-
- sh -c "if [ '$DB_TYPE' = 'pgsql' ]; then psql -c 'create database travis_ci_test;' -U postgres; fi"
32+
- sh -c "if [ '$DB_TYPE' = 'pgsql' ]; then psql -c 'create database travis_ci_test; create database travis_ci_dev; create database travis_ci_prod;' -U postgres; fi"
3333
- cp test/database.travis.$DB_TYPE.yml config/database.yml
3434
- RAILS_ENV=test bundle exec rake db:create
3535
- RAILS_ENV=test bundle exec rake db:schema:load

test/database.travis.mysql.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@ test:
33
database: seek_test
44
username: root
55

6+
development:
7+
adapter: mysql2
8+
database: seek_dev
9+
username: root
10+
611
production:
712
adapter: mysql2
813
database: seek_prod

test/database.travis.postgres.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,13 @@ test:
22
adapter: postgresql
33
database: travis_ci_test
44
username: postgres
5+
6+
development:
7+
adapter: postgresql
8+
database: travis_ci_dev
9+
username: postgres
10+
11+
production:
12+
adapter: postgresql
13+
database: travis_ci_prod
14+
username: postgres

test/database.travis.sqlite3.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,14 @@
11
test:
22
adapter: sqlite3
33
database: db/test.sqlite3
4+
timeout: 5000
5+
6+
development:
7+
adapter: sqlite3
8+
database: db/dev.sqlite3
9+
timeout: 5000
10+
11+
production:
12+
adapter: sqlite3
13+
database: db/prod.sqlite3
414
timeout: 5000

0 commit comments

Comments
 (0)