bonfire-app/test/test_helper.exs
Mayel de Borniol 78a3549f40 conf
2022-12-09 00:55:54 +13:00

52 lines
1.4 KiB
Elixir
Executable file

import Bonfire.Common.Config, only: [repo: 0]
ExUnit.configure(
formatters:
[ExUnit.CLIFormatter, ExUnitNotifier] ++
[Bonfire.Common.TestSummary]
)
# ++ [Bonfire.UI.Kanban.TestDrivenCoordination]
# Code.put_compiler_option(:nowarn_unused_vars, true)
ExUnit.start(
timeout: 200_000,
exclude: Bonfire.Common.RuntimeConfig.skip_test_tags(),
# only show log for failed tests (Can be overridden for individual tests via `@tag capture_log: false`)
capture_log: true
)
# Mix.Task.run("ecto.create")
# Mix.Task.run("ecto.migrate")
# Ecto.Adapters.SQL.Sandbox.mode(repo(), :manual)
# if System.get_env("START_SERVER") !="yes" do
Ecto.Adapters.SQL.Sandbox.mode(repo(), :auto)
# end
# ExUnit.after_suite(fn results ->
# # do stuff
# IO.inspect(test_results: results)
# :ok
# end)
Application.put_env(:wallaby, :base_url, Bonfire.Web.Endpoint.url())
chromedriver_path = Bonfire.Common.Config.get([:wallaby, :chromedriver, :path])
if chromedriver_path && File.exists?(chromedriver_path),
do: {:ok, _} = Application.ensure_all_started(:wallaby),
else: IO.inspect("Note: Wallaby will not run because the chromedriver is missing")
IO.puts("""
Testing shows the presence, not the absence of bugs.
- Edsger W. Dijkstra
""")
# insert fixtures on startup (because running them as part of migrations inserts in primary repo)
if System.get_env("TEST_INSTANCE") == "yes",
do: Bonfire.Common.TestInstanceRepo.apply(&Bonfire.Boundaries.Fixtures.insert/0)