Add NukeOps Test (#27207)

* Add NukeOps Test

* Update EvacShuttleTest to also check mapinit

* Update RuleMaxTimeRestartTest

* Fix cvar cleanup

* A

* Revert some changes

* comments

* Add MappingTests

* Finally fix the test

* A
This commit is contained in:
Leon Friedrich
2024-04-24 17:38:43 +12:00
committed by GitHub
parent 49f1c8b197
commit 91aa16f08a
16 changed files with 355 additions and 31 deletions

View File

@@ -1,5 +1,4 @@
#nullable enable
using Robust.Shared.Timing;
namespace Content.IntegrationTests.Pair;
@@ -19,6 +18,22 @@ public sealed partial class TestPair
}
}
/// <summary>
/// Convert a time interval to some number of ticks.
/// </summary>
public int SecondsToTicks(float seconds)
{
return (int) Math.Ceiling(seconds / Server.Timing.TickPeriod.TotalSeconds);
}
/// <summary>
/// Run the server & client in sync for some amount of time
/// </summary>
public async Task RunSeconds(float seconds)
{
await RunTicksSync(SecondsToTicks(seconds));
}
/// <summary>
/// Runs the server-client pair in sync, but also ensures they are both idle each tick.
/// </summary>
@@ -59,4 +74,4 @@ public sealed partial class TestPair
delta = cTick - sTick;
Assert.That(delta, Is.EqualTo(targetDelta));
}
}
}