test(v3): migrate 6 driver IntegrationTests to RawTags API

Replace pre-declared options.Tags (typed <Driver>TagDefinition lists) with
options.RawTags (IReadOnlyList<RawTagEntry>) across all 6 Docker-gated driver
integration suites so they COMPILE against the v3 driver API.

Each project gets a local <Driver>RawTags helper mirroring the unit-test
project's helper: it serialises a typed def back to its TagConfig blob via the
driver's <Driver>TagDefinitionFactory.ToTagConfig and packages it as a
RawTagEntry (RawPath = def.Name; DeviceName = def.DeviceHostAddress for the
multi-device drivers AbCip/AbLegacy/TwinCAT/FOCAS). Test intent (addresses,
data types, device routing, assertions) is unchanged — only the
tag-authoring/config-delivery shape was migrated.

Docker-gated: these still skip at runtime without fixtures; COMPILE is the gate.
This commit is contained in:
Joseph Doherty
2026-07-15 20:59:42 -04:00
parent 604928b29d
commit a4c61989b2
28 changed files with 249 additions and 104 deletions
@@ -0,0 +1,29 @@
using ZB.MOM.WW.OtOpcUa.Core.Abstractions;
namespace ZB.MOM.WW.OtOpcUa.Driver.S7.IntegrationTests;
/// <summary>
/// Test helper bridging the v2 authoring shape (a typed <see cref="S7TagDefinition"/>) to the v3
/// delivery shape (<see cref="RawTagEntry"/>). Under v3 the driver no longer takes pre-declared
/// definitions — the deploy artifact hands it authored raw tags (RawPath + TagConfig blob), and the
/// driver rebuilds the typed definitions via <see cref="S7TagDefinitionFactory"/>. These integration
/// profiles keep expressing their intent as typed definitions; this helper serialises each back to its
/// TagConfig blob (via <see cref="S7TagDefinitionFactory.ToTagConfig"/>) and packages it as a
/// <see cref="RawTagEntry"/> whose RawPath is the def's <c>Name</c> — so the round-trip through the real
/// mapper reproduces the same definition the profile authored, keyed by the same name the
/// read/write/subscribe call sites use. Mirrors the unit-test project's helper of the same name.
/// </summary>
internal static class S7RawTags
{
/// <summary>Serialises one typed definition into its <see cref="RawTagEntry"/> (RawPath = def.Name).</summary>
/// <param name="def">The typed definition to convert.</param>
/// <returns>The equivalent <see cref="RawTagEntry"/>.</returns>
public static RawTagEntry Entry(S7TagDefinition def)
=> new(def.Name, S7TagDefinitionFactory.ToTagConfig(def), def.WriteIdempotent);
/// <summary>Serialises a sequence of typed definitions into <see cref="RawTagEntry"/> records.</summary>
/// <param name="defs">The typed definitions to convert.</param>
/// <returns>The equivalent raw-tag entries.</returns>
public static IReadOnlyList<RawTagEntry> Entries(params S7TagDefinition[] defs)
=> [.. defs.Select(Entry)];
}
@@ -41,14 +41,12 @@ public static class S7_1500Profile
// gate, injecting flakiness that has nothing to do with the code
// under test.
Probe = new S7ProbeOptions { Enabled = false },
Tags =
[
RawTags = S7RawTags.Entries(
new S7TagDefinition(ProbeTag, "DB1.DBW0", S7DataType.UInt16),
new S7TagDefinition(SmokeI16Tag, "DB1.DBW10", S7DataType.Int16),
new S7TagDefinition(SmokeI32Tag, "DB1.DBD20", S7DataType.Int32),
new S7TagDefinition(SmokeF32Tag, "DB1.DBD30", S7DataType.Float32),
new S7TagDefinition(SmokeBoolTag, "DB1.DBX50.3", S7DataType.Bool),
new S7TagDefinition(WriteScratchTag, "DB1.DBW100", S7DataType.UInt16),
],
new S7TagDefinition(WriteScratchTag, "DB1.DBW100", S7DataType.UInt16)),
};
}