chore: rename test_utils.go to test_utils_test.go#8
Merged
Conversation
The file contains only test helpers (referenced solely by _test.go files). Naming it test_utils.go made it part of the regular package build, which leaks test-only dependencies into production import paths. This unblocks consumers that import github.com/github/gh-ost/go/logic together with newer versions of testcontainers-go, whose Port type no longer exposes Int().
RainbowDashy
approved these changes
May 9, 2026
`ifshort` is fully inactivated in golangci-lint v1.61.0 and causes the runner to exit with code 7. `execinquery` is also archived. Remove both so the lint job can complete.
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
go/logic/test_utils.go→go/logic/test_utils_test.go. The file contains only test helpers (referenced solely from*_test.gofiles), but its name kept it in the regular package build.Why
When a downstream consumer imports
github.com/github/gh-ost/go/logictogether withtestcontainers-gov0.42.0+, the build fails:testcontainers-gov0.42.0 changedMappedPortto returngithub.com/moby/moby/api/types/network.Port, which exposesNum() uint16instead of thenat.Port.Int()method that existed before. Becausetest_utils.gois not a_test.gofile, it is compiled into the regular package and breaks any consumer that pulls in a newer testcontainers-go via MVS — even though gh-ost2 itself still pins v0.37.0 and only uses these helpers from tests.Renaming makes the file a test-only translation unit, so it is no longer compiled when the package is imported as a library. gh-ost2's own tests are unaffected (they already share the
_test.gobuild context).Test plan
go build ./...succeedsgo vet ./go/logic/...succeeds