From 16bbfbb4e278f12801bc8ccb451cac54d811b418 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Mon, 20 Apr 2026 13:37:53 +0200 Subject: [PATCH] Disable sentry during test runs Exposed to be running by 48434dd683d095c42c01def8ff7cb95ce0a85ce4 which caused test failures. You'd think that the `IsDeployedBuild` check would catch it but it doesn't. `IsDeployedBuild` is `AssemblyVersion.Major > 0`, and the assembly version is taken from the entry assembly. In tests the entry assembly is either resharper or nunit. --- osu.Game/Utils/SentryLogger.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/osu.Game/Utils/SentryLogger.cs b/osu.Game/Utils/SentryLogger.cs index 873533bf2d..cf6c93a45b 100644 --- a/osu.Game/Utils/SentryLogger.cs +++ b/osu.Game/Utils/SentryLogger.cs @@ -14,6 +14,7 @@ using osu.Framework; using osu.Framework.Allocation; using osu.Framework.Bindables; using osu.Framework.Configuration; +using osu.Framework.Development; using osu.Framework.Logging; using osu.Framework.Platform; using osu.Framework.Statistics; @@ -49,6 +50,9 @@ namespace osu.Game.Utils if (Environment.GetEnvironmentVariable("OSU_DISABLE_ERROR_REPORTING") == "1") return; + if (DebugUtils.IsNUnitRunning) + return; + if (!game.IsDeployedBuild || !game.CreateEndpoints().WebsiteUrl.EndsWith(@".ppy.sh", StringComparison.Ordinal)) return;