From 3e48f185e6c026ad02d5306f1c5cc348a657d26a Mon Sep 17 00:00:00 2001 From: DrSmugleaf Date: Sun, 4 Apr 2021 13:00:58 +0200 Subject: [PATCH] Make warnings the default log failure level in content (#3799) * Make warnings the default log failure level in content * Move the default to the constructor * Remove old changes --- .../ContentIntegrationTest.cs | 23 ++++++++++++++++--- .../Tests/Buckle/BuckleTest.cs | 9 +++++--- .../Tests/Doors/AirlockTest.cs | 6 +++-- .../Tests/Gravity/WeightlessStatusTests.cs | 2 +- 4 files changed, 31 insertions(+), 9 deletions(-) diff --git a/Content.IntegrationTests/ContentIntegrationTest.cs b/Content.IntegrationTests/ContentIntegrationTest.cs index c957b78499..17b1bf5da4 100644 --- a/Content.IntegrationTests/ContentIntegrationTest.cs +++ b/Content.IntegrationTests/ContentIntegrationTest.cs @@ -23,8 +23,11 @@ namespace Content.IntegrationTests { protected sealed override ClientIntegrationInstance StartClient(ClientIntegrationOptions options = null) { - options ??= new ClientIntegrationOptions(); - // ReSharper disable once RedundantNameQualifier + options ??= new ClientContentIntegrationOption() + { + FailureLogLevel = LogLevel.Warning + }; + options.ContentAssemblies = new[] { typeof(Shared.EntryPoint).Assembly, @@ -61,7 +64,11 @@ namespace Content.IntegrationTests protected override ServerIntegrationInstance StartServer(ServerIntegrationOptions options = null) { - options ??= new ServerIntegrationOptions(); + options ??= new ServerContentIntegrationOption() + { + FailureLogLevel = LogLevel.Warning + }; + options.ContentAssemblies = new[] { typeof(Shared.EntryPoint).Assembly, @@ -217,11 +224,21 @@ namespace Content.IntegrationTests protected sealed class ClientContentIntegrationOption : ClientIntegrationOptions { + public ClientContentIntegrationOption() + { + FailureLogLevel = LogLevel.Warning; + } + public Action ContentBeforeIoC { get; set; } } protected sealed class ServerContentIntegrationOption : ServerIntegrationOptions { + public ServerContentIntegrationOption() + { + FailureLogLevel = LogLevel.Warning; + } + public Action ContentBeforeIoC { get; set; } } } diff --git a/Content.IntegrationTests/Tests/Buckle/BuckleTest.cs b/Content.IntegrationTests/Tests/Buckle/BuckleTest.cs index db2c86a507..0f3a5e519d 100644 --- a/Content.IntegrationTests/Tests/Buckle/BuckleTest.cs +++ b/Content.IntegrationTests/Tests/Buckle/BuckleTest.cs @@ -56,7 +56,7 @@ namespace Content.IntegrationTests.Tests.Buckle { var cOptions = new ClientIntegrationOptions {ExtraPrototypes = Prototypes}; var sOptions = new ServerIntegrationOptions {ExtraPrototypes = Prototypes}; - var (client, server) = await StartConnectedServerClientPair(cOptions, sOptions); + var (_, server) = await StartConnectedServerClientPair(cOptions, sOptions); IEntity human = null; IEntity chair = null; @@ -208,7 +208,7 @@ namespace Content.IntegrationTests.Tests.Buckle [Test] public async Task BuckledDyingDropItemsTest() { - var options = new ServerIntegrationOptions {ExtraPrototypes = Prototypes}; + var options = new ServerContentIntegrationOption {ExtraPrototypes = Prototypes}; var server = StartServer(options); IEntity human = null; @@ -294,7 +294,10 @@ namespace Content.IntegrationTests.Tests.Buckle [Test] public async Task ForceUnbuckleBuckleTest() { - var options = new ServerIntegrationOptions {ExtraPrototypes = Prototypes}; + var options = new ServerContentIntegrationOption + { + ExtraPrototypes = Prototypes + }; var server = StartServer(options); IEntity human = null; diff --git a/Content.IntegrationTests/Tests/Doors/AirlockTest.cs b/Content.IntegrationTests/Tests/Doors/AirlockTest.cs index 25bd35bd2d..38176568f5 100644 --- a/Content.IntegrationTests/Tests/Doors/AirlockTest.cs +++ b/Content.IntegrationTests/Tests/Doors/AirlockTest.cs @@ -6,7 +6,6 @@ using NUnit.Framework; using Robust.Shared.GameObjects; using Robust.Shared.Map; using Robust.Shared.Physics; -using static Content.Server.GameObjects.Components.Doors.ServerDoorComponent; namespace Content.IntegrationTests.Tests.Doors { @@ -107,7 +106,10 @@ namespace Content.IntegrationTests.Tests.Doors [Test] public async Task AirlockBlockTest() { - var options = new ServerIntegrationOptions {ExtraPrototypes = Prototypes}; + var options = new ServerContentIntegrationOption + { + ExtraPrototypes = Prototypes + }; var server = StartServer(options); await server.WaitIdleAsync(); diff --git a/Content.IntegrationTests/Tests/Gravity/WeightlessStatusTests.cs b/Content.IntegrationTests/Tests/Gravity/WeightlessStatusTests.cs index a2b2723b64..7c7ce168c0 100644 --- a/Content.IntegrationTests/Tests/Gravity/WeightlessStatusTests.cs +++ b/Content.IntegrationTests/Tests/Gravity/WeightlessStatusTests.cs @@ -26,7 +26,7 @@ namespace Content.IntegrationTests.Tests.Gravity [Test] public async Task WeightlessStatusTest() { - var options = new ServerIntegrationOptions{ExtraPrototypes = Prototypes}; + var options = new ServerContentIntegrationOption {ExtraPrototypes = Prototypes}; var server = StartServer(options); await server.WaitIdleAsync();