Make tests faster (#8737)

* Test changes

* Make finding the test tile a little smarter
This commit is contained in:
wrexbe
2022-06-19 20:22:28 -07:00
committed by GitHub
parent bd54b8de25
commit 81e3b2da88
80 changed files with 1769 additions and 1788 deletions

View File

@@ -14,7 +14,7 @@ namespace Content.IntegrationTests.Tests.Chemistry
{
[TestFixture]
[TestOf(typeof(ReactionPrototype))]
public sealed class TryAllReactionsTest : ContentIntegrationTest
public sealed class TryAllReactionsTest
{
private const string Prototypes = @"
- type: entity
@@ -24,19 +24,16 @@ namespace Content.IntegrationTests.Tests.Chemistry
solutions:
beaker:
maxVol: 50";
[Test]
public async Task TryAllTest()
{
var options = new ServerContentIntegrationOption{ExtraPrototypes = Prototypes};
var server = StartServer(options);
await server.WaitIdleAsync();
await using var pairTracker = await PoolManager.GetServerClient(new PoolSettings{NoClient = true, ExtraPrototypes = Prototypes});
var server = pairTracker.Pair.Server;
var entityManager = server.ResolveDependency<IEntityManager>();
var prototypeManager = server.ResolveDependency<IPrototypeManager>();
var mapManager = server.ResolveDependency<IMapManager>();
var coordinates = GetMainEntityCoordinates(mapManager);
var coordinates = PoolManager.GetMainEntityCoordinates(mapManager);
foreach (var reactionPrototype in prototypeManager.EnumeratePrototypes<ReactionPrototype>())
{
@@ -46,7 +43,7 @@ namespace Content.IntegrationTests.Tests.Chemistry
EntityUid beaker;
Solution component = null;
server.Assert(() =>
await server.WaitAssertion(() =>
{
beaker = entityManager.SpawnEntity("TestSolutionContainer", coordinates);
Assert.That(EntitySystem.Get<SolutionContainerSystem>()
@@ -63,7 +60,7 @@ namespace Content.IntegrationTests.Tests.Chemistry
await server.WaitIdleAsync();
server.Assert(() =>
await server.WaitAssertion(() =>
{
//you just got linq'd fool
//(i'm sorry)
@@ -78,8 +75,9 @@ namespace Content.IntegrationTests.Tests.Chemistry
Assert.That(foundProductsMap.All(x => x.Value));
});
}
}
await pairTracker.CleanReturnAsync();
}
}