Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Run the Travis tests on MySQL, Postgres and sqlite #170

Closed
wants to merge 2 commits into from

3 participants

@andyw8

No description provided.

@andyw8

Odd error from Travis, it's complaining the Gemfile is invalid, but it hasn't changed.

@mvz
Owner

That probably means there's a syntax error in the database.yml file instead.

@andyw8 andyw8 referenced this pull request from a commit
@yaf yaf Move comment queries to scopes fa14aac
@andyw8

Ok I just saw there is some custom code in the Gemfile which parses the database.yml. As the configuration uses an environment variable on Travis, I'm trying to think how this will work.

@mvz
Owner
mvz commented

One way to solve this may be to add a special Gemfile.travis.

@andyw8

I'd be worried about that getting out of sync with the main Gemfile.

@fdv
Owner
fdv commented
@fdv
Owner

We now run Travis build on the 3 database engines, so I'm closing that pull request. Thank you for submitting.

@fdv fdv closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 30, 2013
  1. @andyw8
Commits on Mar 31, 2013
  1. @andyw8

    Missing semicolon?

    andyw8 authored
This page is out of date. Refresh to see the latest.
Showing with 34 additions and 2 deletions.
  1. +9 −2 .travis.yml
  2. +25 −0 config/database.yml.travis
View
11 .travis.yml
@@ -1,7 +1,14 @@
language: ruby
rvm:
- 1.9.3
+env:
+ - DB=sqlite
+ - DB=mysql
+ - DB=postgresql
before_install:
- - cp config/database.yml.pgsql config/database.yml
+ - cp config/database.yml.travis config/database.yml
before_script:
- - rake db:create db:migrate
+ - mysql -e 'create database typo_test;'
+ - psql -c 'create database typo_test;' -U postgres
+script:
+ - bundle exec rake db:migrate test
View
25 config/database.yml.travis
@@ -0,0 +1,25 @@
+sqlite: &sqlite
+ adapter: sqlite3
+ database: db/<%= Rails.env %>.sqlite3
+
+mysql: &mysql
+ adapter: mysql2
+ username: root
+ password:
+ database: typo_<%= Rails.env %>
+
+postgresql: &postgresql
+ adapter: postgresql
+ username: postgres
+ password:
+ database: typo_<%= Rails.env %>
+ min_messages: ERROR
+
+defaults: &defaults
+ pool: 5
+ timeout: 5000
+ host: localhost
+ <<: *<%= ENV['DB'] || "postgresql" %>
+
+test:
+ <<: *defaults
Something went wrong with that request. Please try again.