Repository navigation
[TST-E4] test: fourteen Vcs and Worktrees declared-error doors become table rows; two enum duplicates go - #467
Merged
Conversation
…ws; two enum duplicates go
…moved, and the tests ceiling falls to 5.5%
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.
📝 Description
What does this PR do?
It is TST-E4a's P05a: fourteen more declared-error door methods become rows of the door table (Vcs 8, Worktrees 6), and the two genuine enum duplicates L1 and L2 are deleted in favour of their named survivors. Each converted method proved only "door D answers declared status S with error type T" on one spine.
OpenCodeApiException, the exact status and the exact type. On the NoThrow spine it assertsIsError, the exact status and the exact type. The one-way guard checks every row against its declaration in the pinnedspec/openapi.json.Vcs/VcsDeclaredErrors.csis new, with a 67-lineRows(). The Worktrees rows are appended toWorktrees/WorktreesDeclaredErrors.cs, whose existing field and case stay byte-identical.DeclaredErrorTests.EveryDoor()appends the Vcs slice.GetDiffAsyncmethods call it withMode = VcsMode.BranchandMode = VcsMode.Working, so they are two fields,GetDiffBranchDoorandGetDiffWorkingDoor. No argument is normalized. The worktree.create:401 row reuses the existingCreateWorktreeDoor, because the deleted method'sCreateRequest()has the same two values.OpenCodeJsonContextTests) are deleted with named survivors inExtensibleEnumContractTests:Deserialize_Should_Refuse_A_Token_That_Is_Not_A_String. Its numeric fixture case expects aJsonException.Deserialize_Should_Read_A_Pinned_Value_As_Its_Static_Property. It reads the same known fixture and expectsModified, plusIsKnown.Data, and Vcs's 501 initialization test.CloneScopes, its two Tools tests and the canon sentence change together.--threshold 5.5was tested on the real path: 4.8 fails at 4.87%, and 5.5 passes.Net line delta: +184 / −198 = −14 in Sdk test code. Over the whole PR it is +189 / −218, including the baseline and the ceiling.
🔄 Type of Change
🎯 Protocol & API Surface
external/,spec/orsrc/was touched🧪 Testing
Test mapping (mechanical:
e4_test_map.pyovergit diff 67b45833 5e006ecf, the worker's commit; the conversion commit here has identical files)tests/OpenCode.Sdk.Tests/Serialization/OpenCodeJsonContextTests.csDeserialize_Should_Reject_A_Numeric_String_Enum_ValueDeserialize_Should_Refuse_A_Token_That_Is_Not_A_Stringtests/OpenCode.Sdk.Tests/Serialization/OpenCodeJsonContextTests.csDeserialize_Should_Map_A_Known_String_Enum_Wire_ValueDeserialize_Should_Read_A_Pinned_Value_As_Its_Static_Propertytests/OpenCode.Sdk.Tests/Vcs/VcsClientContractTests.csGetStatusAsync_Should_Throw_The_Declared_400_Errorvcs.status:400:InvalidRequestErrortests/OpenCode.Sdk.Tests/Vcs/VcsClientContractTests.csGetStatusAsync_Should_Return_The_401_Error_On_The_NoThrow_Spinevcs.status:401:UnauthorizedErrortests/OpenCode.Sdk.Tests/Vcs/VcsClientContractTests.csListBranchesAsync_Should_Throw_The_Declared_400_Errorvcs.branch.list:400:InvalidRequestErrortests/OpenCode.Sdk.Tests/Vcs/VcsClientContractTests.csListBranchesAsync_Should_Return_The_401_Error_On_The_NoThrow_Spinevcs.branch.list:401:UnauthorizedErrortests/OpenCode.Sdk.Tests/Vcs/VcsClientContractTests.csGetBaseAsync_Should_Throw_The_Declared_503_Errorvcs.base:503:ServiceUnavailableErrortests/OpenCode.Sdk.Tests/Vcs/VcsClientContractTests.csGetBaseAsync_Should_Return_The_401_Error_On_The_NoThrow_Spinevcs.base:401:UnauthorizedErrortests/OpenCode.Sdk.Tests/Vcs/VcsClientContractTests.csGetDiffAsync_Should_Throw_The_Declared_503_Errorvcs.diff:503:ServiceUnavailableErrortests/OpenCode.Sdk.Tests/Vcs/VcsClientContractTests.csGetDiffAsync_Should_Return_The_401_Error_On_The_NoThrow_Spinevcs.diff:401:UnauthorizedErrortests/OpenCode.Sdk.Tests/Worktrees/WorktreesClientContractTests.csCreateWorktreeAsync_Should_Return_The_401_Error_On_The_NoThrow_Spineworktree.create:401:UnauthorizedErrortests/OpenCode.Sdk.Tests/Worktrees/WorktreesClientContractTests.csRemoveWorktreeAsync_Should_Return_The_401_Error_On_The_NoThrow_Spineworktree.remove:401:UnauthorizedErrortests/OpenCode.Sdk.Tests/Worktrees/WorktreesClientContractTests.csRefreshWorktreesAsync_Should_Throw_The_Declared_400_Worktree_Errorworktree.refresh:400:WorktreeErrortests/OpenCode.Sdk.Tests/Worktrees/WorktreesClientContractTests.csRefreshWorktreesAsync_Should_Return_The_401_Error_On_The_NoThrow_Spineworktree.refresh:401:UnauthorizedErrortests/OpenCode.Sdk.Tests/Worktrees/WorktreesClientContractTests.csListWorktreesAsync_Should_Throw_The_Declared_400_Errorworktree.list:400:InvalidRequestErrortests/OpenCode.Sdk.Tests/Worktrees/WorktreesClientContractTests.csListWorktreesAsync_Should_Return_The_401_Error_On_The_NoThrow_Spineworktree.list:401:UnauthorizedErrorUnmapped: 0
tests/OpenCode.Sdk.Tests/Common/Errors/DeclaredErrorTests.cstests/OpenCode.Sdk.Tests/Serialization/OpenCodeJsonContextTests.cstests/OpenCode.Sdk.Tests/Vcs/VcsClientContractTests.cstests/OpenCode.Sdk.Tests/Vcs/VcsDeclaredErrors.cstests/OpenCode.Sdk.Tests/Worktrees/WorktreesClientContractTests.cstests/OpenCode.Sdk.Tests/Worktrees/WorktreesDeclaredErrors.csThe negative deltas are the deleted methods' assertions. The rows assert the same status and exact type on both spines, and the L survivors assert at least what L1 and L2 did.
Equivalence and row mutants (scratch only; restored from saved bytes; net10.0, analyzers on)
src/OpenCode.Sdk/Vcs/Internal/VcsStatusResponseAdapter.cs:9GetStatusAsync_Should_Throw_The_Declared_400_Errorredvcs.status:400:InvalidRequestErrorred on both spinessrc/OpenCode.Sdk/Worktrees/Internal/WorktreeRefreshResponseAdapter.cs:9RefreshWorktreesAsync_Should_Throw_The_Declared_400_Worktree_Errorredworktree.refresh:400:WorktreeErrorred on both spinessrc/OpenCode.Sdk/Vcs/Internal/FileDiffInfoStatusJsonConverter.cs:15Deserialize_Should_Refuse_A_Token_That_Is_Not_A_String(numeric case) red"modified"as"added"Deserialize_Should_Read_A_Pinned_Value_As_Its_Static_PropertyredVcs/VcsDeclaredErrors.cs:53vcs.status:400red on both spinesVcs/VcsDeclaredErrors.cs:54Review
_tagand pointer againstspec/openapi.json.CreateRequest()andRemoveRequest()values exactly, includingForce = false.Local check (Windows, on master df25ea5, which carries #465's 2.0.32 spec)
dotnet build -c Release: 0 warnings, 0 errors.dotnet formatwhitespace and style: clean.[(Category!=ServiceElection)&(Category!=NativeAot)]: net10.0 2905 / 2905, net472 2910 / 2910 passed. The guard passes against the new pin.[Category!=NativeAot]: 2086 / 2086 passed, after the ceiling change.Need help on this PR? Tag
@codesmith-botwith what you need.