I am trying to build a CI/CD and testing pipeline for my Elixir/Phoenix application. I’m running Elixir 1.8.2 atop Erlang 21.0 (Erlang 20.0 works too), with postgresql 10.9 for my database. I am currently failing all of my tests because the Travis server is not able to create the database. The error I get is below, and has to do with a failed database connection but I haven’t found anything related to why it is. Is this a postgresql error or have I not configured my travis.yml file correctly? Here is a link to my repository hosted on github. Thank you for your help!
Generated rankings app
** (Mix) The database for Rankings.Repo couldn't be created: killed
11:48:00.674 [error] GenServer #PID<0.3004.0> terminating
** (DBConnection.ConnectionError) tcp connect (localhost:5432): connection refused - :econnrefused
(db_connection) lib/db_connection/connection.ex:84: DBConnection.Connection.connect/2
(connection) lib/connection.ex:622: Connection.enter_connect/5
(stdlib) proc_lib.erl:247: :proc_lib.init_p_do_apply/3
Last message: nil
State: Postgrex.Protocol
The command "mix ecto.create" exited with 1.
language: elixir
elixir:
- 1.8.2
addons:
postgresql: '10.9'
service:
- postgresql
before script:
- psql -c 'create database rankings_test;' -U postgres
# - cp config/test.exs config/travis.exs
script:
- mix deps.get --only test
- mix ecto.create
- mix ecto.migrate
- mix test