test(python): pin all four enum sets, and the git_branch actions in use - #85
Closed
CMGS wants to merge 1 commit into
Closed
test(python): pin all four enum sets, and the git_branch actions in use#85CMGS wants to merge 1 commit into
CMGS wants to merge 1 commit into
Conversation
The corpus check covered error_kind and event_kind only. git_branch_action is the one Python hardcodes as literals at four call sites, so a rename on the silkd side would have surfaced as a runtime rejection rather than a failing test - Go and Rust both pin all four. The second test drives the real verbs and asserts the actions they put on the wire are exactly the corpus set.
Contributor
Author
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.
Stacked on #81. Closes the Python half of a wire-corpus drift gap; the Rust half (Response encode paths are never fixture-verified) is left for its own change.
The gap
protocol/wire/fixtures/v1/enums.jsonis the shared anti-drift corpus. Go (TestEnumValueSetsMatchFixture) and Rust (enum_value_sets_match_fixture) both pin all four sets. Python pinned two:error_kindandevent_kind.Of the two missing,
git_branch_actionis load-bearing —sandbox.py:191,194,197,200hardcodes"list","checkout","create","delete"straight into the request. A rename on the silkd side would have reached users as a runtime rejection with nothing in the suite failing first.What is added
test_enum_value_sets_match_corpusnow coversfile_kindandgit_branch_actionalongside the existing two.test_git_branch_actions_come_from_the_corpusdrives the four real verbs through a recording conn and asserts the actions they emit are exactly the corpus set — so the literals stay tied to the contract, not just the constant list.Validation
pytest152 passed,ruff checkcleanaction="checkout"to"switch"insandbox.pyfails the new test