test(ab): run the ab_server integration suites on both transports

This commit is contained in:
Joseph Doherty
2026-10-07 17:35:31 -04:00
parent 2171fc8ce3
commit 8c68694df1
8 changed files with 156 additions and 43 deletions
@@ -0,0 +1,35 @@
namespace ZB.MOM.WW.OtOpcUa.Driver.AbLegacy.IntegrationTests;
/// <summary>
/// Crosses the PCCC compose profiles with both AbLegacy transports so each integration test runs
/// once on libplctag and once on the native managed stack.
/// </summary>
/// <remarks>
/// Preserves the <c>AB_LEGACY_COMPOSE_PROFILE</c> filter the smoke theory always applied: when set,
/// <see cref="KnownProfiles.All"/> is narrowed to that profile <b>before</b> it is crossed with the
/// transports, so the rows match the running container.
/// </remarks>
public static class TransportMatrix
{
/// <summary>Both transports, for tests that are not parameterised by profile.</summary>
public static IReadOnlyList<AbLegacyTransport> AllTransports { get; } =
[AbLegacyTransport.Libplctag, AbLegacyTransport.Native];
/// <summary>Gets <c>(profile, transport)</c> rows for every selected profile × both transports.</summary>
public static IEnumerable<object[]> Profiles
{
get
{
var only = Environment.GetEnvironmentVariable("AB_LEGACY_COMPOSE_PROFILE");
return from p in KnownProfiles.All
where string.IsNullOrEmpty(only) ||
string.Equals(p.ComposeProfile, only, StringComparison.OrdinalIgnoreCase)
from t in AllTransports
select new object[] { p, t };
}
}
/// <summary>Gets one row per transport.</summary>
public static IEnumerable<object[]> Transports =>
AllTransports.Select(t => new object[] { t });
}