WIP: Use testcontainers to coordinate services in tests #97

Draft
joao.dubas wants to merge 7 commits from jpd-use-testcontainer into main
2 changed files with 12 additions and 4 deletions
Showing only changes of commit dd623a0547 - Show all commits

View File

@ -30,7 +30,14 @@ import Config
config :wabanex, dns_cluster_query: System.get_env("DNS_CLUSTER_QUERY") || :ignore
get_multi_env = fn varnames, default ->
varnames
|> Enum.reduce(nil, &(System.get_env(&1) || &2))
|> Kernel.||(default)
end
config :wabanex, Wabanex.Repo,
username: System.get_env("POSTGRES_USER") || "postgres",
password: System.get_env("POSTGRES_PASS") || "postgres",
hostname: System.get_env("POSTGRES_HOST") || "localhost"
username: multi_get_env.(["DB_USER", "POSTGRES_USER"], "postgres"),
password: multi_get_env.(["DB_PASSWORD", "POSTGRES_PASS"], "postgres"),
hostname: multi_get_env.(["DB_HOST", "POSTGRES_HOST"], "localhost"),
port: System.get_env("DB_PORT") || "5432"

View File

@ -2,7 +2,8 @@ import Config
config :wabanex, Wabanex.Repo,
database: "wabanex_test#{System.get_env("MIX_TEST_PARTITION")}",
pool: Ecto.Adapters.SQL.Sandbox
pool: Ecto.Adapters.SQL.Sandbox,
pool_size: System.schedulers_online() * 2
config :wabanex, WabanexWeb.Endpoint,
http: [port: 4002],