How to set up Travis CI and postgresql using custom db credentials? : <p>I'm trying to set up custom Postgres credentials with Travis CI as I'd like to avoid the existing credentials definition in the code to be tested.</p>

<p>The testing code defines that the database should be accessed on: </p>

<pre><code>'sqlalchemy.url': 'postgresql://foo:bar@localhost/testing_db'
</code></pre>

<p>I've therefore created a <code>database.travis.yml</code> file:</p>

<pre><code>postgresql: &amp;postgresql
adapter: postgresql
username: foo
password: bar
database: testing_db
</code></pre>

<p>...and added the following to my <code>.travis.yml</code>:</p>

<pre><code>services:
  - postgresql

before_script:
  - psql -c 'create database stalker_test;' -U postgres
  - mkdir config &amp;&amp; cp database.travis.yml config/database.yml
</code></pre>

<p>However, I am still getting this during testing:</p>

<pre><code>OperationalError: (psycopg2.OperationalError) FATAL:  role "foo" does not exist
</code></pre>

<p>What am I doing wrong?</p>
