From 4d7203a1d2442154d4fe3e8be8f282b70dc1f0a6 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Mon, 8 Feb 2021 11:52:16 +0100 Subject: [PATCH] Disable Sentry in test mode Signed-off-by: Thomas Citharel --- lib/web/endpoint.ex | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/web/endpoint.ex b/lib/web/endpoint.ex index 1cc9bdd82..ef5b9eb61 100644 --- a/lib/web/endpoint.ex +++ b/lib/web/endpoint.ex @@ -2,7 +2,10 @@ defmodule Mobilizon.Web.Endpoint do @moduledoc """ Endpoint for Mobilizon app """ - use Sentry.PlugCapture + if Application.fetch_env!(:mobilizon, :env) !== :test do + use Sentry.PlugCapture + end + use Phoenix.Endpoint, otp_app: :mobilizon use Absinthe.Phoenix.Endpoint @@ -83,5 +86,7 @@ defmodule Mobilizon.Web.Endpoint do String.replace_leading(url(), "http", "ws") end - plug(Sentry.PlugContext) + if Application.fetch_env!(:mobilizon, :env) !== :test do + plug(Sentry.PlugContext) + end end