test: move public-API tests to external _test packages#1167
Closed
cloudnativeninja wants to merge 6 commits into
Closed
test: move public-API tests to external _test packages#1167cloudnativeninja wants to merge 6 commits into
cloudnativeninja wants to merge 6 commits into
Conversation
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
Moves test files that exercise only the public API to external
_testpackages so the type system enforces that boundary. Test files that genuinely exercise unexported behaviour (private types, methods, struct fields, helpers) stay as internalpackage <pkg>tests — no public API surface is widened, no helper code is duplicated.What changed
*_test.gofiles moved topackage <pkg>_test, with the package's own import path added and every package-level reference qualified (e.g.NewLoader()→openapi3.NewLoader()).go.mod/go.sumunchanged.Stay-internal files
openapi3defaultJoin/setRefPath/multiErrorForOneOf/multiErrorForAllOf/compilePattern/intoGoRegexp; 24 cascade throughencoding(),example(),testCasehelpersopenapi3filterheaderCT,validateRequest,decodeBody,decodeStyledParameter,encodeBody,deepGet,deepSet,prefixInvalidCT,toJSONPointer,validateResponseHeader,setupTestRouteropenapi2marsh_test.gocalls unexportedunmarshalrouters/gorillamuxrouter_test.goconstructssrv{schemes,host,base,server,varsUpdater}literals with unexported fieldsTest plan
go test ./...— 5349 passed (matches baseline)go vet ./...— cleangofmt -l .— cleangoimports -l .— clean