Setting up PostgreSQL with TravisCI

1 Feb

TravisCI is an awesome free continuous integration system that just takes your github repositories and then runs all your tests – it is pure awesomeness and easy as cake.

However when testing a web application you also have to setup a database – they have got good docs for that, but still I ran into problems.

What was my problem? In their description the database name is “myapp_test” and I believed that it would not matter and it could be anything like “Tracketytrack Test” I wanted. I got proven wrong. Apparently it has to be “myapp_test”. Also for some reason I had to add a manual call to “rake db:migrate” – I may check into this later. For your reference, here the relevant parts of my .travis.yml as a gist.

And here they are as well for your reference:

postgres:
  adapter: postgresql
  database: myapp_test
  username: postgres
before_script:
  - "psql -c 'create database myapp_test;' -U postgres"
  - "rake db:migrate"
About these ads

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 700 other followers

%d bloggers like this: