-
-
Notifications
You must be signed in to change notification settings - Fork 210
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
Testify getting included in binary builds. #1200
Comments
You mind sending over a PR with your renamed files? |
Let me check into a few things first. I have other changes that are a part of this branch. If they were accepted, it would be great because I could get rid of my fork. |
Let us know if you found any more clues. We'd love to get this fixed up and let you get rid of your fork so you can work on tip of main. |
I think the reason testify gets pulled in is because we export a set of acceptance tests for integrators (people building a database backend, like Dolt) can use to verify their integration. To my knowledge there is no other way to export test acceptance functionality as a library. testify may get pulled in by a build process, but it should never actually make it into a binary because the go compiler should mark it as dead code (unreachable by the main method). Are you saying this isn't the case for you? Can you provide a repro? |
Yes, I was definitely seeing testify get sucked into the build. I used "strings" to see that testify was in the final binary. After renaming the test libraries as _test.go, they were correctly excluded. The final binary shrank significantly in size upon doing this. |
Thank you for bringing this to our attention. We did this analysis for dolt, which depends on go-mysql-server, and found that there was only one test file that had this issue, in the Fixed in this PR: Please try that and let us know if you still see testify getting pulled into your build. |
While pulling in the project, I noticed I was getting somewhat larger builds. One thing I did notice is that testify was getting sucked into the builds (which should never happen). This can happen if you don't use the *_test.go convention for all your test files containing testify. I found maybe 5-6? I renamed them in my fork for now because I'm not sure if the way I renamed them would break any of your automated tests.
Simply renaming this files to _test.go equivalents removed testify from the build.
On another note, I wonder if other things could be getting sucked in as well given the thing with testify was happening.
The text was updated successfully, but these errors were encountered: