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
@@ -25,10 +25,8 @@ namespace ZB.MOM.WW.OtOpcUa.AdminUI.Tests;
/// </para>
/// <para>
/// The skip is an attribute rather than the <c>Assert.Skip(fixture.SkipReason)</c> call the S7
/// integration suite uses, because AdminUI.Tests is one of the three projects pinned to
/// <b>xunit v2</b> by <c>Akka.TestKit.Xunit2</c> (see <c>Directory.Packages.props</c>) and
/// <c>Assert.Skip</c> is xunit v3 only. Overriding <c>FactAttribute.Skip</c> is the v2 equivalent
/// and reports a genuine "skipped", not a vacuous pass. Both the attribute and this fixture read
/// integration suite uses, so that the skip is decided before the test runs and
/// the <c>FactAttribute.Skip</c> override reports a genuine "skipped", not a vacuous pass. Both the attribute and this fixture read
/// the same one-shot probe in <see cref="AdminUiSqlServer"/>, so a session probes once.
/// </para>
/// <para>
@@ -382,14 +380,17 @@ END";
/// <summary>
/// A <see cref="FactAttribute"/> that skips itself when the shared test SQL Server is unreachable.
/// The xunit v2 equivalent of xunit v3's <c>Assert.Skip</c> — see
/// Attribute-level counterpart of xunit v3's <c>Assert.Skip</c> — see
/// <see cref="AdminUiSqlServerFixture"/>'s remarks for why this project cannot use the latter.
/// </summary>
[AttributeUsage(AttributeTargets.Method)]
public sealed class SqlServerFactAttribute : FactAttribute
{
/// <summary>Initializes a new instance of the <see cref="SqlServerFactAttribute"/> class.</summary>
public SqlServerFactAttribute()
public SqlServerFactAttribute(
[System.Runtime.CompilerServices.CallerFilePath] string? sourceFilePath = null,
[System.Runtime.CompilerServices.CallerLineNumber] int sourceLineNumber = -1)
: base(sourceFilePath, sourceLineNumber)
{
if (AdminUiSqlServer.SkipReason is { } reason) Skip = reason;
}