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

@@ -11,7 +11,7 @@ namespace Content.IntegrationTests.Tests
// i.e. the interaction between uniforms and the pocket/ID slots.
// and also how big items don't fit in pockets.
[TestFixture]
public sealed class HumanInventoryUniformSlotsTest : ContentIntegrationTest
public sealed class HumanInventoryUniformSlotsTest
{
private const string Prototypes = @"
- type: entity
@@ -56,8 +56,8 @@ namespace Content.IntegrationTests.Tests
[Test]
public async Task Test()
{
var options = new ServerIntegrationOptions{ExtraPrototypes = Prototypes};
var server = StartServer(options);
await using var pairTracker = await PoolManager.GetServerClient(new PoolSettings{NoClient = true, ExtraPrototypes = Prototypes});
var server = pairTracker.Pair.Server;
EntityUid human = default;
EntityUid uniform = default;
@@ -66,7 +66,7 @@ namespace Content.IntegrationTests.Tests
InventorySystem invSystem = default!;
server.Assert(() =>
await server.WaitAssertion(() =>
{
invSystem = IoCManager.Resolve<IEntitySystemManager>().GetEntitySystem<InventorySystem>();
var mapMan = IoCManager.Resolve<IMapManager>();
@@ -102,9 +102,9 @@ namespace Content.IntegrationTests.Tests
Assert.That(invSystem.TryUnequip(human, "jumpsuit"));
});
server.RunTicks(2);
await server.WaitRunTicks(2);
server.Assert(() =>
await server.WaitAssertion(() =>
{
// Items have been dropped!
Assert.That(IsDescendant(uniform, human), Is.False);
@@ -117,7 +117,7 @@ namespace Content.IntegrationTests.Tests
Assert.That(!invSystem.TryGetSlotEntity(human, "pocket1", out _));
});
await server.WaitIdleAsync();
await pairTracker.CleanReturnAsync();
}
private static bool IsDescendant(EntityUid descendant, EntityUid parent)