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

@@ -10,7 +10,7 @@ namespace Content.IntegrationTests.Tests.Utility
{
[TestFixture]
[TestOf(typeof(EntityWhitelist))]
public sealed class EntityWhitelistTest : ContentIntegrationTest
public sealed class EntityWhitelistTest
{
private const string InvalidComponent = "Sprite";
private const string ValidComponent = "Physics";
@@ -60,16 +60,15 @@ namespace Content.IntegrationTests.Tests.Utility
[Test]
public async Task Test()
{
var serverOptions = new ServerContentIntegrationOption {ExtraPrototypes = Prototypes};
var server = StartServer(serverOptions);
await using var pairTracker = await PoolManager.GetServerClient(new PoolSettings{NoClient = true, ExtraPrototypes = Prototypes});
var server = pairTracker.Pair.Server;
await server.WaitIdleAsync();
var mapManager = server.ResolveDependency<IMapManager>();
var sEntities = server.ResolveDependency<IEntityManager>();
await server.WaitAssertion(() =>
{
var mapId = GetMainMapId(mapManager);
var mapId = PoolManager.GetMainGrid(mapManager).ParentMapId;
var mapCoordinates = new MapCoordinates(0, 0, mapId);
var validComponent = sEntities.SpawnEntity("ValidComponentDummy", mapCoordinates);
@@ -110,6 +109,7 @@ namespace Content.IntegrationTests.Tests.Utility
Assert.That(whitelistSer.IsValid(invalidComponent), Is.False);
Assert.That(whitelistSer.IsValid(invalidTag), Is.False);
});
await pairTracker.CleanReturnAsync();
}
}
}