Task #135 — update integration-test NodeIds for path-based scheme

7 integration tests in Server.Tests were left behind by the path-based
NodeId rename (#134). Each was constructing test NodeIds in the old
"FullReference" shape ("TestFolder.Var1", "raw.var", "AlphaFolder.Var1",
"plcaddr-temperature"), which the node manager no longer mints — the new
shape is `{driverId}/{folder-path}/{browseName}` per OPC UA Part 3 §5.2.2
NodeId immutability.

Fixed by re-deriving each test NodeId from the actual browse path the test
fixture's driver registers:

- OpcUaServerIntegrationTests: "TestFolder.Var1" → "fake/TestFolder/Var1"
- HistoryReadIntegrationTests (4 tests): "raw.var" → "history-driver/raw",
  "proc.var" → "history-driver/proc" (×2), "atTime.var" → "history-driver/atTime"
- MultipleDriverInstancesIntegrationTests: "AlphaFolder.Var1" →
  "alpha/AlphaFolder/Var1"; "BetaFolder.Var1" → "beta/BetaFolder/Var1"
- OpcUaEquipmentWalkerIntegrationTests: "plcaddr-temperature" →
  "galaxy-prod/warsaw/line-a/oven-3/Temperature" (the walker uses Tag.Name
  as the browseName; the FullReference lives in TagConfig but no longer
  surfaces in the NodeId path)

Server.Tests now 277/277 green excluding LiveLdap. Clears the regression
flagged during the #124 verification run.
This commit is contained in:
Joseph Doherty
2026-04-24 22:03:03 -04:00
parent 75c07149d4
commit fb760bc465
4 changed files with 17 additions and 8 deletions

View File

@@ -66,7 +66,9 @@ public sealed class HistoryReadIntegrationTests : IAsyncLifetime
{
using var session = await OpenSessionAsync();
var nsIndex = (ushort)session.NamespaceUris.GetIndex("urn:OtOpcUa:history-driver");
var nodeId = new NodeId("raw.var", nsIndex);
// Path-based NodeId per #134 — `{driverId}/{browseName}` since DiscoverAsync registers
// variables at the driver root rather than under a folder.
var nodeId = new NodeId("history-driver/raw", nsIndex);
// The Opc.Ua client exposes HistoryRead via Session.HistoryRead. We construct a
// ReadRawModifiedDetails (IsReadModified=false → raw path) and a single
@@ -97,7 +99,7 @@ public sealed class HistoryReadIntegrationTests : IAsyncLifetime
{
using var session = await OpenSessionAsync();
var nsIndex = (ushort)session.NamespaceUris.GetIndex("urn:OtOpcUa:history-driver");
var nodeId = new NodeId("proc.var", nsIndex);
var nodeId = new NodeId("history-driver/proc", nsIndex);
var details = new ReadProcessedDetails
{
@@ -123,7 +125,7 @@ public sealed class HistoryReadIntegrationTests : IAsyncLifetime
{
using var session = await OpenSessionAsync();
var nsIndex = (ushort)session.NamespaceUris.GetIndex("urn:OtOpcUa:history-driver");
var nodeId = new NodeId("proc.var", nsIndex);
var nodeId = new NodeId("history-driver/proc", nsIndex);
var details = new ReadProcessedDetails
{
@@ -148,7 +150,7 @@ public sealed class HistoryReadIntegrationTests : IAsyncLifetime
{
using var session = await OpenSessionAsync();
var nsIndex = (ushort)session.NamespaceUris.GetIndex("urn:OtOpcUa:history-driver");
var nodeId = new NodeId("atTime.var", nsIndex);
var nodeId = new NodeId("history-driver/atTime", nsIndex);
var t1 = new DateTime(2024, 3, 1, 10, 0, 0, DateTimeKind.Utc);
var t2 = new DateTime(2024, 3, 1, 10, 0, 30, DateTimeKind.Utc);

View File

@@ -108,8 +108,9 @@ public sealed class MultipleDriverInstancesIntegrationTests : IAsyncLifetime
var alphaNs = (ushort)session.NamespaceUris.GetIndex("urn:OtOpcUa:alpha");
var betaNs = (ushort)session.NamespaceUris.GetIndex("urn:OtOpcUa:beta");
var alphaValue = session.ReadValue(new NodeId("AlphaFolder.Var1", alphaNs));
var betaValue = session.ReadValue(new NodeId("BetaFolder.Var1", betaNs));
// Path-based NodeId per #134 — `{driverId}/{folder}/{browseName}`.
var alphaValue = session.ReadValue(new NodeId("alpha/AlphaFolder/Var1", alphaNs));
var betaValue = session.ReadValue(new NodeId("beta/BetaFolder/Var1", betaNs));
alphaValue.Value.ShouldBe(42, "alpha driver's ReadAsync returns 42 — a misroute would surface as 99");
betaValue.Value.ShouldBe(99, "beta driver's ReadAsync returns 99 — a misroute would surface as 42");

View File

@@ -90,7 +90,10 @@ public sealed class OpcUaEquipmentWalkerIntegrationTests : IAsyncLifetime
using var session = await OpenSessionAsync();
var nsIndex = (ushort)session.NamespaceUris.GetIndex($"urn:OtOpcUa:{DriverId}");
var tagNode = new NodeId("plcaddr-temperature", nsIndex);
// Path-based NodeId per #134 — `{driverId}/{areaName}/{lineName}/{equipmentName}/{tagName}`.
// The walker uses Tag.Name as the browseName, so the FullReference (TagConfig content
// "plcaddr-temperature") does not appear in the NodeId path.
var tagNode = new NodeId($"{DriverId}/warsaw/line-a/oven-3/Temperature", nsIndex);
var equipmentFolder = new NodeId($"{DriverId}/warsaw/line-a/oven-3", nsIndex);
BrowseChildren(session, equipmentFolder).ShouldContain(r => r.BrowseName.Name == "Temperature");

View File

@@ -73,7 +73,10 @@ public sealed class OpcUaServerIntegrationTests : IAsyncLifetime
using var session = await OpenSessionAsync();
var nsIndex = (ushort)session.NamespaceUris.GetIndex("urn:OtOpcUa:fake");
var varNodeId = new NodeId("TestFolder.Var1", nsIndex);
// Path-based NodeId per #134 — `{driverId}/{folder-path}/{browseName}`. The driver-side
// FullReference ("TestFolder.Var1") is now decoupled from the NodeId so a backend rename
// doesn't shift the identifier seen by clients (OPC UA Part 3 §5.2.2 immutability).
var varNodeId = new NodeId("fake/TestFolder/Var1", nsIndex);
var dv = session.ReadValue(varNodeId);
dv.ShouldNotBeNull();