I am trying to configure Postgres user credentials using Travis CI, as I would like to avoid defining existing credentials in the test code.
The test code determines which database should be accessed:
'sqlalchemy.url': 'postgresql://foo:bar@localhost/testing_db'
So I created a file database.travis.yml:
postgresql: &postgresql
adapter: postgresql
username: foo
password: bar
database: testing_db
... and added to my .travis.ymlfollowing:
services:
- postgresql
before_script:
- psql -c 'create database stalker_test;' -U postgres
- mkdir config && cp database.travis.yml config/database.yml
However, I still get this during testing:
OperationalError: (psycopg2.OperationalError) FATAL: role "foo" does not exist
What am I doing wrong?
source
share