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)
{
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; }
}
}

View File

@@ -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;

View File

@@ -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();

View File

@@ -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();