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
This commit is contained in:
DrSmugleaf
2021-04-04 13:00:58 +02:00
committed by GitHub
parent c4895af81a
commit 3e48f185e6
4 changed files with 31 additions and 9 deletions

View File

@@ -23,8 +23,11 @@ namespace Content.IntegrationTests
{ {
protected sealed override ClientIntegrationInstance StartClient(ClientIntegrationOptions options = null) protected sealed override ClientIntegrationInstance StartClient(ClientIntegrationOptions options = null)
{ {
options ??= new ClientIntegrationOptions(); options ??= new ClientContentIntegrationOption()
// ReSharper disable once RedundantNameQualifier {
FailureLogLevel = LogLevel.Warning
};
options.ContentAssemblies = new[] options.ContentAssemblies = new[]
{ {
typeof(Shared.EntryPoint).Assembly, typeof(Shared.EntryPoint).Assembly,
@@ -61,7 +64,11 @@ namespace Content.IntegrationTests
protected override ServerIntegrationInstance StartServer(ServerIntegrationOptions options = null) protected override ServerIntegrationInstance StartServer(ServerIntegrationOptions options = null)
{ {
options ??= new ServerIntegrationOptions(); options ??= new ServerContentIntegrationOption()
{
FailureLogLevel = LogLevel.Warning
};
options.ContentAssemblies = new[] options.ContentAssemblies = new[]
{ {
typeof(Shared.EntryPoint).Assembly, typeof(Shared.EntryPoint).Assembly,
@@ -217,11 +224,21 @@ namespace Content.IntegrationTests
protected sealed class ClientContentIntegrationOption : ClientIntegrationOptions protected sealed class ClientContentIntegrationOption : ClientIntegrationOptions
{ {
public ClientContentIntegrationOption()
{
FailureLogLevel = LogLevel.Warning;
}
public Action ContentBeforeIoC { get; set; } public Action ContentBeforeIoC { get; set; }
} }
protected sealed class ServerContentIntegrationOption : ServerIntegrationOptions protected sealed class ServerContentIntegrationOption : ServerIntegrationOptions
{ {
public ServerContentIntegrationOption()
{
FailureLogLevel = LogLevel.Warning;
}
public Action ContentBeforeIoC { get; set; } public Action ContentBeforeIoC { get; set; }
} }
} }

View File

@@ -56,7 +56,7 @@ namespace Content.IntegrationTests.Tests.Buckle
{ {
var cOptions = new ClientIntegrationOptions {ExtraPrototypes = Prototypes}; var cOptions = new ClientIntegrationOptions {ExtraPrototypes = Prototypes};
var sOptions = new ServerIntegrationOptions {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 human = null;
IEntity chair = null; IEntity chair = null;
@@ -208,7 +208,7 @@ namespace Content.IntegrationTests.Tests.Buckle
[Test] [Test]
public async Task BuckledDyingDropItemsTest() public async Task BuckledDyingDropItemsTest()
{ {
var options = new ServerIntegrationOptions {ExtraPrototypes = Prototypes}; var options = new ServerContentIntegrationOption {ExtraPrototypes = Prototypes};
var server = StartServer(options); var server = StartServer(options);
IEntity human = null; IEntity human = null;
@@ -294,7 +294,10 @@ namespace Content.IntegrationTests.Tests.Buckle
[Test] [Test]
public async Task ForceUnbuckleBuckleTest() public async Task ForceUnbuckleBuckleTest()
{ {
var options = new ServerIntegrationOptions {ExtraPrototypes = Prototypes}; var options = new ServerContentIntegrationOption
{
ExtraPrototypes = Prototypes
};
var server = StartServer(options); var server = StartServer(options);
IEntity human = null; IEntity human = null;

View File

@@ -6,7 +6,6 @@ using NUnit.Framework;
using Robust.Shared.GameObjects; using Robust.Shared.GameObjects;
using Robust.Shared.Map; using Robust.Shared.Map;
using Robust.Shared.Physics; using Robust.Shared.Physics;
using static Content.Server.GameObjects.Components.Doors.ServerDoorComponent;
namespace Content.IntegrationTests.Tests.Doors namespace Content.IntegrationTests.Tests.Doors
{ {
@@ -107,7 +106,10 @@ namespace Content.IntegrationTests.Tests.Doors
[Test] [Test]
public async Task AirlockBlockTest() public async Task AirlockBlockTest()
{ {
var options = new ServerIntegrationOptions {ExtraPrototypes = Prototypes}; var options = new ServerContentIntegrationOption
{
ExtraPrototypes = Prototypes
};
var server = StartServer(options); var server = StartServer(options);
await server.WaitIdleAsync(); await server.WaitIdleAsync();

View File

@@ -26,7 +26,7 @@ namespace Content.IntegrationTests.Tests.Gravity
[Test] [Test]
public async Task WeightlessStatusTest() public async Task WeightlessStatusTest()
{ {
var options = new ServerIntegrationOptions{ExtraPrototypes = Prototypes}; var options = new ServerContentIntegrationOption {ExtraPrototypes = Prototypes};
var server = StartServer(options); var server = StartServer(options);
await server.WaitIdleAsync(); await server.WaitIdleAsync();