test: migrate AdminUI/ControlPlane/Runtime/Host tests to xunit.v3 (#756)
v2-ci / unit-tests (push) Failing after 13m22s

Akka.TestKit.Xunit2 -> Akka.TestKit.Xunit 1.5.62 (xunit.v3 TestKit; needs xunit.v3 3.2.2, set via
VersionOverride on the four projects). Removes the xunit 2.9.3 pin. IAsyncLifetime returns ValueTask,
SqlServerFactAttribute gains the source-info ctor, and xUnit1051 call sites pass
TestContext.Current.CancellationToken. Test counts unchanged.

Claude-Session: https://claude.ai/code/session_01GT67AEHd2Acv1YPwGfXEoV
This commit is contained in:
Joseph Doherty
2026-11-10 08:57:33 -05:00
parent 2a8e2981fe
commit b211911f98
191 changed files with 2161 additions and 2166 deletions
@@ -1,5 +1,5 @@
using Akka.Actor;
using Akka.TestKit.Xunit2;
using Akka.TestKit.Xunit;
using Shouldly;
using Xunit;
using ZB.MOM.WW.OtOpcUa.Commons.Messages.Deploy;
@@ -56,7 +56,7 @@ public class EventStreamCommandDeliveryTests : RuntimeActorTestBase
// EventStream subscription. Without this the relay below races the subscription.
var warmup = NewDispatch();
driverHost.Tell(warmup);
ackRouter.ExpectMsg<ApplyAck>(TimeSpan.FromSeconds(15)).DeploymentId.ShouldBe(warmup.DeploymentId);
ackRouter.ExpectMsg<ApplyAck>(TimeSpan.FromSeconds(15), cancellationToken: TestContext.Current.CancellationToken).DeploymentId.ShouldBe(warmup.DeploymentId);
// Now the real assertion — relayed exactly as central would send it. The comm actor only
// publishes node-locally, so the host must be subscribed for this to arrive at all.
@@ -66,7 +66,7 @@ public class EventStreamCommandDeliveryTests : RuntimeActorTestBase
// The deployment id does not exist, so the host answers Failed. That is the stronger
// assertion, not a weaker one: an ack at all proves the command was received and handled,
// and only PreStart's EventStream subscription can have delivered it.
ackRouter.ExpectMsg<ApplyAck>(TimeSpan.FromSeconds(15)).DeploymentId.ShouldBe(relayed.DeploymentId);
ackRouter.ExpectMsg<ApplyAck>(TimeSpan.FromSeconds(15), cancellationToken: TestContext.Current.CancellationToken).DeploymentId.ShouldBe(relayed.DeploymentId);
}
[Fact]
@@ -83,7 +83,7 @@ public class EventStreamCommandDeliveryTests : RuntimeActorTestBase
var dispatch = NewDispatch();
driverHost.Tell(dispatch);
ackRouter.ExpectMsg<ApplyAck>(TimeSpan.FromSeconds(15)).DeploymentId.ShouldBe(dispatch.DeploymentId);
ackRouter.ExpectMsg<ApplyAck>(TimeSpan.FromSeconds(15), cancellationToken: TestContext.Current.CancellationToken).DeploymentId.ShouldBe(dispatch.DeploymentId);
}
}
@@ -150,12 +150,12 @@ akka {
// Tell INSIDE the assertion window alongside the relay, which made the test vacuous — the
// direct Tell alone produced the log the assertion was waiting for.
EventFilter.Debug(contains: "ignoring AlarmCommand")
.ExpectOne(TimeSpan.FromSeconds(15), () => host.Tell(cmd));
.ExpectOne(TimeSpan.FromSeconds(15), () => host.Tell(cmd), TestContext.Current.CancellationToken);
// The real assertion: relayed ONLY through the comm actor, which publishes node-locally.
// The host owns no alarms, so it logs and stops — still a positive delivery signal, because
// that line is only reached if the message arrived.
EventFilter.Debug(contains: "ignoring AlarmCommand")
.ExpectOne(TimeSpan.FromSeconds(15), () => comm.Tell(cmd));
.ExpectOne(TimeSpan.FromSeconds(15), () => comm.Tell(cmd), TestContext.Current.CancellationToken);
}
}