# L3 tests require PostgreSQL — excluded by default # Run with: SHORASHIM_L3=1 mix test --include l3 ExUnit.start(exclude: [:l3]) # The manna ledger resumes a day it finds on disk (ledger.json). A run # that was interrupted could leave one behind; no test should inherit it. if Process.whereis(VavPipeline.MannaLedger), do: VavPipeline.MannaLedger.reset() if System.get_env("SHORASHIM_L3") do # The application already starts the Repo when SHORASHIM_L3 is set # (Application.maybe_add_repo); starting it again here was a MatchError # on {:error, {:already_started, _}} and no L3 test could run. case VavPipeline.Repo.start_link() do # Started here: it is linked to this file's process, which ends when # the file does — unlink, or the Repo dies before the first test. {:ok, pid} -> Process.unlink(pid) {:error, {:already_started, _}} -> :ok end Ecto.Adapters.SQL.Sandbox.mode(VavPipeline.Repo, :manual) end