From 513c35e135bf515a104f35d5ede43d066db2836b Mon Sep 17 00:00:00 2001 From: FaDeOkno Date: Wed, 21 Aug 2024 20:48:08 +0400 Subject: [PATCH] =?UTF-8?q?=D0=A4=D0=B8=D0=BA=D1=81=D1=8B=20=D0=B1=D0=B8?= =?UTF-8?q?=D0=BB=D0=B4=20=D1=82=D0=B5=D1=81=D1=82=D0=B5=D1=80=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Components/Mobs/AlertsComponentTests.cs | 20 +++++++++++++++++-- .../Tests/GameRules/NukeOpsTest.cs | 18 +++++++++++------ 2 files changed, 30 insertions(+), 8 deletions(-) diff --git a/Content.IntegrationTests/Tests/GameObjects/Components/Mobs/AlertsComponentTests.cs b/Content.IntegrationTests/Tests/GameObjects/Components/Mobs/AlertsComponentTests.cs index ef4e6326cda..429884e7d96 100644 --- a/Content.IntegrationTests/Tests/GameObjects/Components/Mobs/AlertsComponentTests.cs +++ b/Content.IntegrationTests/Tests/GameObjects/Components/Mobs/AlertsComponentTests.cs @@ -87,7 +87,15 @@ static AlertsUI FindAlertsUI(Control control) Assert.That(clientAlertsUI.AlertContainer.ChildCount, Is.GreaterThanOrEqualTo(3)); var alertControls = clientAlertsUI.AlertContainer.Children.Select(c => (AlertControl) c); var alertIDs = alertControls.Select(ac => ac.Alert.ID).ToArray(); - var expectedIDs = new[] { "HumanHealth", "Debug1", "Debug2" }; + var expectedIDs = new[] { "Debug1", "Debug2" }; // ADT Fix IPC from failing tests + + // ADT Fix IPC from failing tests start + var categories = alertControls.Select(ac => ac.Alert.Category); + var expectedCategories = new[] { "Health" }; + + Assert.That(categories, Is.SupersetOf(expectedCategories)); + // ADT Fix IPC from failing tests end + Assert.That(alertIDs, Is.SupersetOf(expectedIDs)); }); @@ -104,7 +112,15 @@ await client.WaitAssertion(() => Assert.That(clientAlertsUI.AlertContainer.ChildCount, Is.GreaterThanOrEqualTo(2)); var alertControls = clientAlertsUI.AlertContainer.Children.Select(c => (AlertControl) c); var alertIDs = alertControls.Select(ac => ac.Alert.ID).ToArray(); - var expectedIDs = new[] { "HumanHealth", "Debug2" }; + var expectedIDs = new[] { "Debug2" }; // ADT Fix IPC from failing tests + + // ADT Fix IPC from failing tests start + var categories = alertControls.Select(ac => ac.Alert.Category); + var expectedCategories = new[] { "Health" }; + + Assert.That(categories, Is.SupersetOf(expectedCategories)); + // ADT Fix IPC from failing tests end + Assert.That(alertIDs, Is.SupersetOf(expectedIDs)); }); diff --git a/Content.IntegrationTests/Tests/GameRules/NukeOpsTest.cs b/Content.IntegrationTests/Tests/GameRules/NukeOpsTest.cs index 0ccb5e314b9..1b1bf71ad12 100644 --- a/Content.IntegrationTests/Tests/GameRules/NukeOpsTest.cs +++ b/Content.IntegrationTests/Tests/GameRules/NukeOpsTest.cs @@ -222,14 +222,20 @@ void CheckDummy(int i) var totalSeconds = 30; var totalTicks = (int) Math.Ceiling(totalSeconds / server.Timing.TickPeriod.TotalSeconds); var increment = 5; - var resp = entMan.GetComponent(player); - var damage = entMan.GetComponent(player); - for (var tick = 0; tick < totalTicks; tick += increment) + + // ADT Fix IPC from failing tests start + if (entMan.TryGetComponent(player, out var resp)) { - await pair.RunTicksSync(increment); - Assert.That(resp.SuffocationCycles, Is.LessThanOrEqualTo(resp.SuffocationCycleThreshold)); - Assert.That(damage.TotalDamage, Is.EqualTo(FixedPoint2.Zero)); + // var resp = entMan.GetComponent(player); + var damage = entMan.GetComponent(player); + for (var tick = 0; tick < totalTicks; tick += increment) + { + await pair.RunTicksSync(increment); + Assert.That(resp.SuffocationCycles, Is.LessThanOrEqualTo(resp.SuffocationCycleThreshold)); + Assert.That(damage.TotalDamage, Is.EqualTo(FixedPoint2.Zero)); + } } + // ADT Fix IPC from failing tests end // Check that the round does not end prematurely when agents are deleted in the outpost var nukies = dummyEnts.Where(entMan.HasComponent).Append(player).ToArray();