test(v3): migrate OpcUaServer.Tests + Host.IntegrationTests to v3 dark address space

Migrate the server composer/applier + 2-node harness tests off the retired
Namespace/NamespaceKind + equipment→driver/device binding schema onto the v3
greenfield shape (raw-only Tag; DriverInstance-RawFolderId; equipment via UnsLine).

OpcUaServer.Tests (134 build errors -> green, 335 pass / 4 skip):
- LIVE (migrated, passing): VirtualTag-historize + ScriptedAlarm composition,
  composer purity/hierarchy, applier MaterialiseHierarchy + MaterialiseEquipmentTags
  idempotency (hand-fed applier, not dark).
- SKIP dark-until-Batch-4: {{equip}} token expansion, applier equipment-namespace
  E2E (equipment-tag variable materialization).
- RETIRE-with-comment / skip: alias-tag (Tag.EquipmentId binding gone) + device-host
  equipment binding (architecturally removed).
- Add local DarkAddressSpaceReasons Skip-reason constants (mirrors Runtime.Tests).

Host.IntegrationTests (green, in-memory): drop deleted-Namespace seeds from
MultiClusterScoping + DriverReconnect; reshape EquipmentNamespaceMaterialization to
assert the DARK contract (folder nodes decode, EquipmentTags empty despite a seeded
v3 raw tag) with the full raw-tag->EquipmentTag materialization kept as a
Batch-4-pending Skip.

Tests-only; no src/ changes.
This commit is contained in:
Joseph Doherty
2026-07-15 21:41:04 -04:00
parent aaba2ebd66
commit 2c7fc65bae
11 changed files with 186 additions and 282 deletions
@@ -120,17 +120,15 @@ public sealed class MultiClusterScopingTests
NewCluster(MainCluster, "Main Cluster", "central"),
NewCluster(SiteACluster, "Site A Cluster", "site-a"));
db.Namespaces.AddRange(
NewNamespace(MainCluster, "MAIN-equipment", "urn:zb:central:equipment"),
NewNamespace(SiteACluster, "SITE-A-equipment", "urn:zb:site-a:equipment"));
// v3: the Namespace entity is deleted (DriverInstance no longer binds a Namespace). Cluster
// scoping filters by NodeId/ClusterId, so the namespace seed is dropped here.
db.ClusterNodes.AddRange(
NewNode(mainNodeId, MainCluster, "urn:zb:central:node-a"),
NewNode(siteANodeId, SiteACluster, "urn:zb:site-a:node-b"));
db.DriverInstances.AddRange(
NewDriver(MainDriverId, MainCluster, "MAIN-equipment"),
NewDriver(SiteADriverId, SiteACluster, "SITE-A-equipment"));
NewDriver(MainDriverId, MainCluster),
NewDriver(SiteADriverId, SiteACluster));
await db.SaveChangesAsync(Ct);
}
@@ -146,14 +144,6 @@ public sealed class MultiClusterScopingTests
CreatedBy = "test",
};
private static Namespace NewNamespace(string clusterId, string namespaceId, string uri) => new()
{
NamespaceId = namespaceId,
ClusterId = clusterId,
Kind = NamespaceKind.Equipment,
NamespaceUri = uri,
};
private static ClusterNode NewNode(string nodeId, string clusterId, string applicationUri) => new()
{
NodeId = nodeId,
@@ -163,11 +153,10 @@ public sealed class MultiClusterScopingTests
CreatedBy = "test",
};
private static DriverInstance NewDriver(string driverInstanceId, string clusterId, string namespaceId) => new()
private static DriverInstance NewDriver(string driverInstanceId, string clusterId) => new()
{
DriverInstanceId = driverInstanceId,
ClusterId = clusterId,
NamespaceId = namespaceId,
Name = driverInstanceId,
DriverType = "Modbus",
Enabled = true,