From 1a6eb7efe688490af6813d2ea08b2e907ad71d28 Mon Sep 17 00:00:00 2001 From: Joseph Doherty Date: Fri, 26 Jun 2026 17:09:45 -0400 Subject: [PATCH] test(historian-gateway): cover MaxTieClusterOverfetch warning + refresh AddServerHistorian doc Addresses Task 9 review: add the enabled+nonpositive MaxTieClusterOverfetch warning test; update the AddServerHistorian XML doc to describe the gateway-backed data source (the alarm-path Wonderware doc stays until T13). Claude-Session: https://claude.ai/code/session_012SDSQ3AcaXqPcBtDESBRii --- .../ServiceCollectionExtensions.cs | 10 +++++----- .../Historian/ServerHistorianOptionsTests.cs | 9 +++++++++ 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/Server/ZB.MOM.WW.OtOpcUa.Runtime/ServiceCollectionExtensions.cs b/src/Server/ZB.MOM.WW.OtOpcUa.Runtime/ServiceCollectionExtensions.cs index 8c873d7a..1be91b43 100644 --- a/src/Server/ZB.MOM.WW.OtOpcUa.Runtime/ServiceCollectionExtensions.cs +++ b/src/Server/ZB.MOM.WW.OtOpcUa.Runtime/ServiceCollectionExtensions.cs @@ -104,17 +104,17 @@ public static class ServiceCollectionExtensions /// /// Config-gated server-side HistoryRead backend. When the ServerHistorian section has /// Enabled=true, registers the -supplied - /// (the read-only Wonderware client) overriding the - /// default from . Otherwise + /// (the read-only HistorianGateway-backed data source) overriding + /// the default from . Otherwise /// a no-op (the Null default stays and the node manager's HistoryRead returns - /// GoodNoData-empty). The data source is injected so the Wonderware client can be supplied - /// by the Host, which is the only project that references it. + /// GoodNoData-empty). The data source is injected so the gateway-backed client can be supplied + /// by the Host, which is the only project that references the driver. /// /// The service collection to register with. /// The configuration carrying the ServerHistorian section. /// /// Factory the Host supplies to build the concrete read - /// (the Wonderware client) from the bound options + the resolving provider. + /// (the gateway-backed data source) from the bound options + the resolving provider. /// /// The same instance for chaining. public static IServiceCollection AddServerHistorian( diff --git a/tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/Historian/ServerHistorianOptionsTests.cs b/tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/Historian/ServerHistorianOptionsTests.cs index f653931e..d4e2eb04 100644 --- a/tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/Historian/ServerHistorianOptionsTests.cs +++ b/tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/Historian/ServerHistorianOptionsTests.cs @@ -31,4 +31,13 @@ public sealed class ServerHistorianOptionsTests [Fact] public void Valid_config_is_clean() => Assert.Empty(new ServerHistorianOptions { Enabled = true, Endpoint = "https://h:5222", ApiKey = "histgw_x_y" }.Validate()); + + [Fact] + public void Enabled_with_nonpositive_MaxTieClusterOverfetch_warns() + { + var w = new ServerHistorianOptions + { Enabled = true, Endpoint = "https://h:5222", ApiKey = "histgw_x_y", MaxTieClusterOverfetch = 0 } + .Validate(); + Assert.Contains(w, m => m.Contains("MaxTieClusterOverfetch")); + } }