mirror of
https://github.com/plausible/analytics.git
synced 2024-09-11 09:56:02 +03:00
- `:verification` flag is no longer needed, however we'll keep the old "awaiting first pageview" flow for Community Edition where verification is not available by default - `:traffic_drop_notifications` have been tested and should be enabled for everyone
30 lines
1020 B
Elixir
30 lines
1020 B
Elixir
if not Enum.empty?(Path.wildcard("lib/**/*_test.exs")) do
|
|
raise "Oops, test(s) found in `lib/` directory. Move them to `test/`."
|
|
end
|
|
|
|
{:ok, _} = Application.ensure_all_started(:ex_machina)
|
|
Mox.defmock(Plausible.HTTPClient.Mock, for: Plausible.HTTPClient.Interface)
|
|
Application.ensure_all_started(:double)
|
|
|
|
# Temporary flag to test `experimental_reduced_joins` flag on all tests.
|
|
if System.get_env("TEST_EXPERIMENTAL_REDUCED_JOINS") == "1" do
|
|
FunWithFlags.enable(:experimental_reduced_joins)
|
|
else
|
|
FunWithFlags.disable(:experimental_reduced_joins)
|
|
end
|
|
|
|
Ecto.Adapters.SQL.Sandbox.mode(Plausible.Repo, :manual)
|
|
|
|
# warn about minio if it's included in tests but not running
|
|
if :minio in Keyword.fetch!(ExUnit.configuration(), :include) do
|
|
Plausible.TestUtils.ensure_minio()
|
|
end
|
|
|
|
if Mix.env() == :ce_test do
|
|
IO.puts("Test mode: Community Edition")
|
|
ExUnit.configure(exclude: [:slow, :minio, :ee_only])
|
|
else
|
|
IO.puts("Test mode: Enterprise Edition")
|
|
ExUnit.configure(exclude: [:slow, :minio, :ce_build_only])
|
|
end
|