Add --metadata mode to InteropTest sample for metadata date/time and compression interop#31
Merged
Merged
Conversation
Adds an "InteropTest HOSTNAME PORT --metadata" mode to the InteropTest-gsf sample so it can serve as the C# subscriber side of a cross-language harness that verifies the STTP Python publisher's xs:dateTime metadata serialization interoperates with the .NET DataSet parser. Existing measurement-export behavior is unchanged when the flag is absent. On connect the mode calls RefreshMetadata(), then on MetaDataReceived writes metadata-received.xml, prints every DateTime column value, and exits 0; on a ProcessException (a malformed xs:dateTime makes DataSet.ReadXml throw) or a 15s timeout it exits non-zero. It requests CompressionModes.GZip so the metadata handshake stays consistent with the Python publisher, which GZip-compresses metadata whenever the CompressMetadata operational mode is set. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Replace the always-on CompressionModes.GZip request with an optional --gzip flag. Without it the subscriber uses the .NET-default operational modes (CompressMetadata without GZip), exercising the uncompressed metadata path; with --gzip the compressed path is exercised. This lets the interop harness verify a publisher that correctly compresses metadata only when GZip is negotiated. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a
--metadatamode to theInteropTest-gsfsample so it can act as the C# subscriber side of a cross-language harness that verifies the STTP Python publisher's metadata interop — both XMLxs:dateTimeserialization and the GZip compression handshake — against the .NETDataSetparser.Companion to sttp/pyapi#10 (the Python-side fixes + orchestrator).
What changed
src/samples/InteropTest-gsf/Program.cs(existing measurement-export behavior is unchanged when the flag is absent):InteropTest HOSTNAME PORT --metadata [--gzip]mode. On connect it callsRefreshMetadata(), then:MetaDataReceived— writesmetadata-received.xml, prints everyDateTimecolumn value, and exits0;ProcessException(a malformedxs:dateTime, or an unexpectedly gzip-compressed payload, makesDataSet.ReadXmlthrow) — exits non-zero;--gzipadvertisesCompressionModes.GZip(compressed-metadata path). Without it, the.NET-default operational modes are used (CompressMetadatawithout GZip → uncompressed path) — the path a correctly-behaving publisher must serve uncompressed.How it was verified
Driven by the harness in sttp/pyapi (
test/interop/run_metadata_interop.py) against a live Python publisher, in both compression negotiations:DeviceDetail.UpdatedOn = 2033-03-03T03:33:33.123and exits0(uncompressed and GZip);'2033-03-03T03:33:33.123+00:Z' is not a valid AllXsd value;hexadecimal value 0x1F, is an invalid character.Reviewer notes
sttp.gsf.slnbuild fails because the bundleddepends\GSF\GSF.Core.dllis out of sync with the source (a[Label]attribute-target mismatch); the harness compiles this sample against the prebuiltbuild\output\*\libassemblies instead.🤖 Generated with Claude Code