Skip to content
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

Exclude fake components from build process #224

Closed
danielsuguimoto opened this issue Dec 15, 2020 · 6 comments
Closed

Exclude fake components from build process #224

danielsuguimoto opened this issue Dec 15, 2020 · 6 comments
Assignees
Labels
good first issue Good for newcomers help wanted Extra attention is needed

Comments

@danielsuguimoto
Copy link
Contributor

As discussed with the team, we don't need to compile the fake components, which are used only for testing, into the final binary files

@fabriciojs
Copy link
Member

Another idea, other than build tag conditionals, we could suffix files with _test, not sure about any possible downsides.

@danielsuguimoto
Copy link
Contributor Author

@fabriciojs build tags won't work at all, because the fake structs and interface are under the same package of the real ones, so the compiler understand that they must be available to entire package, so you cannot ignore them on building process. But we could use build tags if we put all tests and fakers in separated packages, keeping in the original packages only the code that will be built.

@danielsuguimoto
Copy link
Contributor Author

Another idea, other than build tag conditionals, we could suffix files with _test, not sure about any possible downsides.

I'm not sure, but I guess that unnecessary code will be executed on our tests, if golang executes any function inside *_test.go files as test cases...

@fabriciojs
Copy link
Member

fabriciojs commented Jan 12, 2021 via email

@fabriciojs
Copy link
Member

This is not something pressing, nor causing any noticeable downsides. Can we close this?

@danielsuguimoto
Copy link
Contributor Author

@fabriciojs yep, for me it's ok closing it...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants