diff --git a/config/test.exs b/config/test.exs index 8023c1df..5835c361 100644 --- a/config/test.exs +++ b/config/test.exs @@ -6,17 +6,16 @@ import Config # to provide built-in test partitioning in CI environment. # Run `mix help test` for more information. config :lokal, Lokal.Repo, - username: "postgres", - password: "postgres", - hostname: "localhost", - database: "lokal_test#{System.get_env("MIX_TEST_PARTITION")}", + url: + System.get_env("TEST_DATABASE_URL") || + "ecto://postgres:postgres@localhost/lokal_test#{System.get_env("MIX_TEST_PARTITION")}", pool: Ecto.Adapters.SQL.Sandbox, pool_size: 10 # We don't run a server during test. If one is required, # you can enable the server option below. config :lokal, LokalWeb.Endpoint, - http: [ip: {0, 0, 0, 1}, port: 4002], + http: [ip: {0, 0, 0, 0}, port: 4002], secret_key_base: "T4DkRImgeMNCcPcTWBCZyKYp3KQ8yyPD33VT4wj6ogbP8fIGUsqmOTNX3clTMrLo", server: false diff --git a/mix.exs b/mix.exs index c0779fa6..27680187 100644 --- a/mix.exs +++ b/mix.exs @@ -68,7 +68,12 @@ defmodule Lokal.MixProject do setup: ["deps.get", "compile", "ecto.setup", "cmd npm install --prefix assets"], "ecto.setup": ["ecto.create", "ecto.migrate", "run priv/repo/seeds.exs"], "ecto.reset": ["ecto.drop", "ecto.setup"], - test: ["ecto.create --quiet", "ecto.migrate --quiet", "test"], + test: [ + "format --check-formatted", + "ecto.create --quiet", + "ecto.migrate --quiet", + "test" + ] ] end end