Skip to content

avoid import to testing helpers outside of tests #3092

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 8, 2025

Conversation

tonistiigi
Copy link
Member

These utilities should not be included in the main build.

This only has a minimal 2.5KB binary size difference atm as there is still import to "testing" via containerd libs atm containerd/containerd#11666 . Removing that one releases more.

@tonistiigi
Copy link
Member Author

This is much more complicated than I would have hoped as some of these helpers are used in integration tests. Tried to separate these into gittestutil subpackage, but it is really hard to understand the scoping difference of these packages. Needs a much bigger refactor and analysis of the intent of a given "gitutils" package.

@tonistiigi tonistiigi closed this Apr 8, 2025
@tonistiigi tonistiigi reopened this Apr 8, 2025
@tonistiigi tonistiigi force-pushed the testing-import-cleanup branch from dadeb4b to 29614f9 Compare April 8, 2025 07:39
Copy link
Member

@crazy-max crazy-max left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Needs a much bigger refactor and analysis of the intent of a given "gitutils" package.

This also reminds of #2005

@crazy-max crazy-max merged commit 98c3abb into docker:master Apr 8, 2025
140 checks passed
@thaJeztah
Copy link
Member

Sometimes I wish Go would allow importing _test.go code from other packages' _test.go files.

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

Successfully merging this pull request may close these issues.

3 participants