This commit is contained in:
Mayel de Borniol 2023-10-17 11:21:18 +01:00
parent a8ec6f6fa2
commit 8e7031aab7
4 changed files with 22 additions and 10 deletions

View file

@ -186,9 +186,14 @@ pool_size = String.to_integer(System.get_env("POOL_SIZE", "10"))
database =
case config_env() do
:test -> "bonfire_test#{System.get_env("MIX_TEST_PARTITION")}"
:dev -> System.get_env("POSTGRES_DB", "bonfire_dev")
_ -> System.get_env("POSTGRES_DB", "bonfire")
:test ->
"bonfire_test_#{System.get_env("TEST_INSTANCE")}_#{System.get_env("MIX_TEST_PARTITION")}"
:dev ->
System.get_env("POSTGRES_DB", "bonfire_dev")
_ ->
System.get_env("POSTGRES_DB", "bonfire")
end
config :bonfire, ecto_repos: repos

View file

@ -144,10 +144,10 @@ prepare-prod:
MIX_ENV=dev just dev-run {{args}}
@dev-extra:
iex --sname extra --remsh dev
iex --sname extra --remsh localenv
dev-run *args='': init
{{ if WITH_DOCKER == "total" { "just dev-docker $args" } else { "iex --sname dev -S mix phx.server $args" } }}
{{ if WITH_DOCKER == "total" { "just dev-docker $args" } else { "iex --sname localenv -S mix phx.server $args" } }}
# TODO: pass args to docker as well
@dev-remote: init
@ -158,7 +158,7 @@ dev-proxied: docker-stop-web
docker logs bonfire_web -f
dev-proxied-iex:
docker compose --profile proxy exec web iex --sname extra --remsh dev
docker compose --profile proxy exec web iex --sname extra --remsh localenv
dev-federate:
FEDERATE=yes HOSTNAME=$(just local-tunnel-hostname) PUBLIC_PORT=443 just dev

View file

@ -46,7 +46,7 @@ defmodule Bonfire.Umbrella.MixProject do
# {:phoenix_profiler, "~> 0.2.0"},
# "~> 0.1.0", path: "forks/one_plus_n_detector",
# {:one_plus_n_detector, git: "https://github.com/bonfire-networks/one_plus_n_detector", only: :dev},
{:observer_cli, "~> 1.7", only: :dev},
{:observer_cli, "~> 1.7", only: [:dev, :test]},
# tests
# {:floki, ">= 0.0.0", only: [:dev, :test]},

View file

@ -42,12 +42,19 @@ if chromedriver_path && File.exists?(chromedriver_path),
do: {:ok, _} = Application.ensure_all_started(:wallaby),
else: IO.inspect("Note: Wallaby UI tests will not run because the chromedriver is missing")
# insert fixtures in test instance's repo on startup
if System.get_env("TEST_INSTANCE") == "yes",
do: Bonfire.Common.TestInstanceRepo.apply(&Bonfire.Boundaries.Fixtures.insert/0)
IO.puts("""
Testing shows the presence, not the absence of bugs.
- Edsger W. Dijkstra
""")
# insert fixtures in test instance's repo on startup
if System.get_env("TEST_INSTANCE") == "yes",
do: Bonfire.Common.TestInstanceRepo.apply(&Bonfire.Boundaries.Fixtures.insert/0)
if System.get_env("OBSERVE") do
Mix.ensure_application!(:wx)
Mix.ensure_application!(:runtime_tools)
Mix.ensure_application!(:observer)
:observer.start()
end