mirror of
https://github.com/plausible/analytics.git
synced 2024-09-11 09:56:02 +03:00
Don't rely on Mix.env check in runtime (#2703)
This commit is contained in:
parent
043e3ed572
commit
7dec454a23
@ -96,8 +96,7 @@ defmodule PlausibleWeb.StatsController do
|
||||
query = Query.from(site, params) |> Filters.add_prefix()
|
||||
|
||||
visits_metric_enabled =
|
||||
FunWithFlags.enabled?(:visits_metric, for: conn.assigns[:current_user]) ||
|
||||
Mix.env() == :test
|
||||
FunWithFlags.enabled?(:visits_metric, for: conn.assigns[:current_user])
|
||||
|
||||
metrics =
|
||||
if visits_metric_enabled && !query.filters["event:goal"] do
|
||||
|
@ -1,6 +1,7 @@
|
||||
{:ok, _} = Application.ensure_all_started(:ex_machina)
|
||||
Plausible.Test.ClickhouseSetup.run()
|
||||
Mox.defmock(Plausible.HTTPClient.Mock, for: Plausible.HTTPClient.Interface)
|
||||
FunWithFlags.enable(:visits_metric)
|
||||
ExUnit.start(exclude: :slow)
|
||||
Application.ensure_all_started(:double)
|
||||
Ecto.Adapters.SQL.Sandbox.mode(Plausible.Repo, :manual)
|
||||
|
Loading…
Reference in New Issue
Block a user