Skip to content

test(sdk): add a cross-language parser differential harness - #1350

Closed
kvinwang wants to merge 1 commit into
nextfrom
test/sdk-parser-differential
Closed

kvinwang wants to merge 1 commit into
nextfrom
test/sdk-parser-differential

Conversation

@kvinwang

Copy link
Copy Markdown
Collaborator

Feeds the same malformed guest-agent responses (39 v1, 20 v0 cases) to the Rust, Go, Python and JS SDKs and tabulates which accept or reject each. Used to find the issues fixed in the sibling PRs split out of #1281.

Standalone under sdk/compat/parser-differential/; not wired into sdk/run-tests.sh or CI. See its README for usage.

Four implementations of one protocol is the shape that produces parser
differentials, and the only way to find them is to feed the same bytes to all
four. This serves one canned guest-agent response over a unix socket and
tabulates what Rust, Python, Go and JavaScript each do with it.

It found the three bugs fixed in this branch, and it is what says the v1
surface agrees on all 39 of its cases -- a negative result worth being able to
re-derive.

Not wired into `sdk/run-tests.sh`: it needs all four toolchains, and it answers
"do these agree?" rather than asserting a fixed expectation. Run it by hand
when the wire format changes or when one SDK's decoding is touched.

It does not use `sdk/simulator`, deliberately. The simulator is the real guest
agent with one trait swapped, which is exactly what makes it trustworthy -- a
test that passes against it cannot be rejected by a real agent on validation
grounds. A fault-injection mode would put test-only branches in the production
handler and cost that property.
@kvinwang

Copy link
Copy Markdown
Collaborator Author

Closing: exploratory harness, not wired into CI and asserts nothing. Regression coverage for the issues it found lives in #1347, #1348 and #1349.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant