From 7adbe90b5394110e0698471d652ba6b06d638e43 Mon Sep 17 00:00:00 2001 From: CJ_Clippy Date: Thu, 13 Feb 2025 00:24:05 -0800 Subject: [PATCH] test env uses ENV db conf --- .gitea/workflows/tests.yaml | 1 - apps/bright/config/test.exs | 18 +++++------------- 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/.gitea/workflows/tests.yaml b/.gitea/workflows/tests.yaml index b3d17c3..8eb8eb5 100644 --- a/.gitea/workflows/tests.yaml +++ b/.gitea/workflows/tests.yaml @@ -127,7 +127,6 @@ jobs: mix compile --warnings-as-errors working-directory: ./apps/bright - # @blocking @see https://github.com/nektos/act/issues/2529 - name: Unit tests run: | mix test --only=unit diff --git a/apps/bright/config/test.exs b/apps/bright/config/test.exs index 14b9181..3686ce5 100644 --- a/apps/bright/config/test.exs +++ b/apps/bright/config/test.exs @@ -9,19 +9,11 @@ config :bcrypt_elixir, :log_rounds, 1 # to provide built-in test partitioning in CI environment. # Run `mix help test` for more information. config :bright, Bright.Repo, - username: "postgres", - password: "password", - # hostname: - # System.cmd("docker", [ - # "inspect", - # "--format", - # "{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}", - # "futureporn-db" - # ]) - # |> elem(0) - # |> String.trim(), - hostname: "localhost", - database: "bright_test#{System.get_env("MIX_TEST_PARTITION")}", + database: System.get_env("DB_NAME", "bright"), + hostname: System.get_env("DB_HOST", "db"), + username: System.get_env("DB_USER", "postgres"), + password: System.get_env("DB_PASS", "password"), + # database: "bright_test#{System.get_env("MIX_TEST_PARTITION")}", pool: Ecto.Adapters.SQL.Sandbox, pool_size: System.schedulers_online() * 4