mirror of
https://github.com/OPCFoundation/UA-.NETStandard.git
synced 2026-10-18 22:55:08 +08:00
333de8305b
# Description Regression fence for the NodeSet2 import + code-generation surface. This adds a single, purpose-authored "kitchen-sink" NodeSet2 (`Opc.Ua.CoverageTest.NodeSet2.xml`) plus a small dependent secondary model that deliberately flip a broad set of the knobs defined by `UANodeSet.xsd` (every node class, every `Definition` shape, custom reference types, all five modelling rules, scalar/array/matrix values, a deep branching instance tree, and a wide set of reference relations). The same bytes are then loaded into **real** servers (`ServerFixture<T>` + `ReferenceServer`) through three independent pipelines and validated node-by-node, attribute-by-attribute, reference-by-reference: 1. **Source-generation, hand-written manager** - the XML is consumed at compile time via `<AdditionalFiles ModelSourceGeneratorPrefix="Opc.Ua.CoverageTest">`; the generated `AddOpcUaCoverageTest(context)` composes the predefined nodes inside a `CustomNodeManager2`, so every node materialises as its generated `NodeState` subclass. 2. **Runtime import** - the identical XML is imported at startup through `RuntimeNodeSetNodeManagerFactory` / `AddRuntimeNodeSet`. 3. **Source-generation, generated fluent manager** - a `[NodeManager]`-attributed partial makes the generator emit the whole `FluentNodeManagerBase` manager, factory and typed fluent-builder surface. A shared, data-driven `[TestCaseSource]` battery runs the identical assertions against all three servers, and a cross-pipeline equivalence fixture asserts the three address spaces agree. A dependent **second namespace** (`.../Secondary/`) exercises cross-namespace `HasTypeDefinition`, `HasSubtype` and `HasComponent` references in every pipeline. Authoring the model surfaced two latent source-generator bugs, both fixed here: - `NodeSetToModelDesign` crashed on a top-level `<ServerUris>` table (`StringTable.Append(null)` for the reserved local-server slot). Added a null guard plus a focused regression test (`NodesetServerUrisTests`). - `FluentBuilderGenerator` emitted colliding typed-builder accessors for any model with more than one structure encoding, because `DataTypeEncoding` objects hang off their `DataType` and surfaced as parent-less "root" instances sharing the reserved `DefaultBinary`/`DefaultXml`/`DefaultJson` symbolic names. They are encoding metadata, never fluent-wired, so they are now excluded from the typed builder. A few edges are intentionally not asserted for cross-pipeline equivalence because the pipelines legitimately differ (documented in `CoverageNodeSet/README.md`): type-dictionary / `DataTypeDescription` nodes (the generator regenerates schema rather than emitting them), a handful of ambiguous duplicate-hierarchical / View-`Organizes` edges, and runtime structure stand-ins (structure definitions are validated via the `DataTypeDefinition` round-trip instead). ## Related Issues - Fixes #4251 ## Checklist _Put an `x` in the boxes that apply. You can complete these step by step after opening the PR._ - [ ] I have signed the [CLA](https://opcfoundation.org/license/cla/ContributorLicenseAgreementv1.0.pdf) and read the [CONTRIBUTING](https://github.com/OPCFoundation/UA-.NETStandard/blob/master/CONTRIBUTING.md) doc. - [x] I have added tests that prove my fix is effective or that my feature works and increased code coverage. - [x] I have added all necessary documentation. - [x] I have verified that my changes do not introduce (new) build or analyzer warnings. - [x] I ran **all** tests locally using the **UA.slnx** solution against at least .net **framework** and .net **10**, and all passed. - [ ] I fixed **all** failing and flaky tests in the CI pipelines and **all** CodeQL warnings. - [ ] I have addressed **all** PR feedback received. --------- Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: romanett <7413710+romanett@users.noreply.github.com>
2.8 KiB
2.8 KiB
| 1 | CoverageHierarchicalReference | 5001 | ReferenceType |
|---|---|---|---|
| 2 | CoverageSymmetricReference | 5002 | ReferenceType |
| 3 | CoverageAbstractReference | 5003 | ReferenceType |
| 4 | CoverageConcreteReference | 5004 | ReferenceType |
| 5 | CoverageEnumeration | 5100 | DataType |
| 6 | CoverageEnumeration_EnumValues | 5101 | Variable |
| 7 | CoverageOptionSet | 5110 | DataType |
| 8 | CoverageOptionSet_OptionSetValues | 5111 | Variable |
| 9 | CoverageAbstractStructure | 5120 | DataType |
| 10 | CoverageStructure | 5130 | DataType |
| 11 | CoverageStructure_DefaultBinary | 5131 | Object |
| 12 | CoverageStructure_DefaultXml | 5132 | Object |
| 13 | CoverageStructure_DefaultJson | 5133 | Object |
| 14 | CoverageOptionalStructure | 5140 | DataType |
| 15 | CoverageOptionalStructure_DefaultBinary | 5141 | Object |
| 16 | CoverageUnion | 5150 | DataType |
| 17 | CoverageUnion_DefaultBinary | 5151 | Object |
| 18 | CoverageAbstractObjectType | 5200 | ObjectType |
| 19 | CoverageObjectType | 5210 | ObjectType |
| 20 | CoverageObjectType_MandatoryVariable | 5211 | Variable |
| 21 | CoverageObjectType_OptionalVariable | 5212 | Variable |
| 22 | CoverageObjectType_MandatoryPlaceholder | 5213 | Object |
| 23 | CoverageObjectType_OptionalPlaceholder | 5214 | Object |
| 24 | CoverageObjectType_ExposesArrayVariable | 5215 | Variable |
| 25 | CoverageObjectType_MandatoryMethod | 5216 | Method |
| 26 | CoverageObjectType_MandatoryMethod_InputArguments | 5217 | Variable |
| 27 | CoverageObjectType_MandatoryMethod_OutputArguments | 5218 | Variable |
| 28 | CoverageEventType | 5230 | ObjectType |
| 29 | CoverageInterfaceType | 5240 | ObjectType |
| 30 | CoverageVariableType | 5300 | VariableType |
| 31 | CoverageRoot | 5400 | Object |
| 32 | CoverageRoot_TypedObject | 5402 | Object |
| 33 | CoverageRoot_TypedObject_MandatoryVariable | 5403 | Variable |
| 34 | CoverageRoot_TypedObject_MandatoryMethod | 5404 | Method |
| 35 | CoverageRoot_TypedObject_MandatoryMethod_InputArguments | 5405 | Variable |
| 36 | CoverageRoot_TypedObject_MandatoryMethod_OutputArguments | 5406 | Variable |
| 37 | CoverageRoot_EventSource | 5410 | Object |
| 38 | CoverageRoot_EventSource_SubNotifier | 5411 | Object |
| 39 | CoverageRoot_EventSource_CoverageCondition | 5412 | Object |
| 40 | CoverageRoot_BooleanValue | 5420 | Variable |
| 41 | CoverageRoot_Int32Value | 5421 | Variable |
| 42 | CoverageRoot_StringArrayValue | 5422 | Variable |
| 43 | CoverageRoot_DoubleMatrixValue | 5423 | Variable |
| 44 | CoverageRoot_DateTimeValue | 5424 | Variable |
| 45 | CoverageRoot_EnumerationValue | 5425 | Variable |
| 46 | CoverageRoot_OrderedValue | 5426 | Variable |
| 47 | CoverageRoot_AddNumbers | 5450 | Method |
| 48 | CoverageRoot_LockedMethod | 5451 | Method |
| 49 | CoverageRoot_AddNumbers_InputArguments | 5452 | Variable |
| 50 | CoverageRoot_AddNumbers_OutputArguments | 5453 | Variable |
| 51 | CoverageView | 5460 | View |
| 52 | CoverageRoot_CoverageStateMachine | 5470 | Object |
| 53 | CoverageRoot_CoverageStateMachine_StateA | 5471 | Object |
| 54 | CoverageRoot_CoverageStateMachine_StateB | 5472 | Object |
| 55 | CoverageRoot_CoverageStateMachine_TransitionAB | 5473 | Object |
| 56 | CoveragePlainStructure | 5160 | DataType |
| 57 | CoveragePlainStructure_DefaultBinary | 5161 | Object |
| 58 | CoverageRoot_TreeRoot | 5490 | Object |
| 59 | CoverageRoot_TreeRoot_BranchA | 5491 | Object |
| 60 | CoverageRoot_TreeRoot_BranchA_LeafA1 | 5492 | Variable |
| 61 | CoverageRoot_TreeRoot_BranchA_SubBranchA | 5493 | Object |
| 62 | CoverageRoot_TreeRoot_BranchA_SubBranchA_LeafA2 | 5494 | Variable |
| 63 | CoverageRoot_TreeRoot_BranchB | 5495 | Object |
| 64 | CoverageRoot_TreeRoot_BranchB_LeafB1 | 5496 | Variable |