test(grpc-data): A2a — rig --conditions overlay (AlarmSubscribe exports + ScalarHigh scripted alarm), probe conditions scenario, conditions_smoke.py; X0/H2 tests move the 'future' bit off 64
This commit is contained in:
+2
-1
@@ -34,7 +34,8 @@ public sealed class GrpcDataHistoryClientTests
|
||||
var results = await connection.ReadHistoryAsync(Request(), TestContext.Current.CancellationToken);
|
||||
results.Single().StatusCode.ShouldBe(0x80720000u);
|
||||
a.HistoryCalls.ShouldBe(0);
|
||||
a.Headers.ShouldAllBe(x => x.Path.EndsWith("/GetCapabilities", StringComparison.Ordinal) && x.Features == "history");
|
||||
// A2a: the probe asks for every feature this consumer understands (history, conditions).
|
||||
a.Headers.ShouldAllBe(x => x.Path.EndsWith("/GetCapabilities", StringComparison.Ordinal) && x.Features == "history,conditions");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
||||
+4
-4
@@ -36,7 +36,7 @@ public sealed class GrpcDataUnknownOperationToleranceTests
|
||||
await using var runtime = new DataConnectionDeploymentRuntime("node-a", "owner", new Security(), activator, 4);
|
||||
var history = Definition("history", DataOperations.Read | DataOperations.Browse | DataOperations.AlarmConfirm | DataOperations.AlarmShelve);
|
||||
var plain = Definition("plain", DataOperations.Read | DataOperations.Subscribe);
|
||||
var future = Definition("future", (DataOperations)(1 << 30) | DataOperations.AlarmSubscribe);
|
||||
var future = Definition("future", (DataOperations)(1 << 30) | DataOperations.AlarmAcknowledge); // A2a: 64 is understood
|
||||
|
||||
// The pre-X0 runtime threw ArgumentException("Unknown operation.") here for the whole snapshot.
|
||||
Should.NotThrow(() => runtime.Apply(new(1, "artifact-1", [history, plain, future])));
|
||||
@@ -50,14 +50,14 @@ public sealed class GrpcDataUnknownOperationToleranceTests
|
||||
runtime.DroppedUnknownOperations.ShouldBe(new Dictionary<string, DataOperations>(StringComparer.OrdinalIgnoreCase)
|
||||
{
|
||||
["history"] = DataOperations.AlarmConfirm | DataOperations.AlarmShelve,
|
||||
["future"] = (DataOperations)(1 << 30) | DataOperations.AlarmSubscribe,
|
||||
["future"] = (DataOperations)(1 << 30) | DataOperations.AlarmAcknowledge,
|
||||
});
|
||||
runtime.UnknownOperationRowsDropped.ShouldBe(2);
|
||||
// The production reader: the node diagnostics snapshot carries each row's dropped bits.
|
||||
var diagnostics = runtime.CaptureDiagnostics().ToDictionary(x => x.ConnectionId);
|
||||
diagnostics["history"].DroppedUnknownOperations.ShouldBe(DataOperations.AlarmConfirm | DataOperations.AlarmShelve);
|
||||
diagnostics["plain"].DroppedUnknownOperations.ShouldBe(DataOperations.None);
|
||||
diagnostics["future"].DroppedUnknownOperations.ShouldBe((DataOperations)(1 << 30) | DataOperations.AlarmSubscribe);
|
||||
diagnostics["future"].DroppedUnknownOperations.ShouldBe((DataOperations)(1 << 30) | DataOperations.AlarmAcknowledge);
|
||||
diagnostics["plain"].MappingsWithDroppedOperations.ShouldBeNull("no mapping evidence was supplied");
|
||||
// The input rows are not mutated: the drop is the node's reading, not a rewrite of the artifact.
|
||||
history.AllowedOperations.ShouldBe(DataOperations.Read | DataOperations.Browse | DataOperations.AlarmConfirm | DataOperations.AlarmShelve);
|
||||
@@ -129,7 +129,7 @@ public sealed class GrpcDataUnknownOperationToleranceTests
|
||||
new() { DataExportId = "history", ClusterId = "cluster", Enabled = true, Realm = DataRealm.Raw, RootKind = "Cluster",
|
||||
RootEntityId = "cluster", PrincipalId = "peer", AllowedOperations = DataOperations.Browse | DataOperations.Read | DataOperations.AlarmConfirm },
|
||||
new() { DataExportId = "alarms-only", ClusterId = "cluster", Enabled = true, Realm = DataRealm.Uns, RootKind = "Cluster",
|
||||
RootEntityId = "cluster", PrincipalId = "other", AllowedOperations = DataOperations.AlarmSubscribe | DataOperations.AlarmAcknowledge },
|
||||
RootEntityId = "cluster", PrincipalId = "other", AllowedOperations = DataOperations.AlarmConfirm | DataOperations.AlarmAcknowledge }, // A2a: 64 is understood
|
||||
],
|
||||
};
|
||||
DataConnectionValidator.Validate(snapshot).ShouldContain(x => x.Code == "DataExportOperationsInvalid", "authoring still rejects reserved bits");
|
||||
|
||||
Reference in New Issue
Block a user