From f0676a2433e48ca3ecc76a83535f691f69a9264c Mon Sep 17 00:00:00 2001 From: shibao Date: Sat, 22 Jan 2022 14:54:19 -0500 Subject: [PATCH] add mix format to tests --- config/test.exs | 9 ++++----- mix.exs | 7 ++++++- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/config/test.exs b/config/test.exs index 8023c1d..5835c36 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 c0779fa..2768018 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