alcionai / corso

Free, Secure, and Open-Source Backup for Microsoft 365
https://corsobackup.io
Apache License 2.0
187 stars 41 forks source link

Allow adding code for tests that's not compiled for releases #2067

Open ashmrtn opened 1 year ago

ashmrtn commented 1 year ago

Mocks and other code meant specifically for testing should not be compiled into binaries or production code. However, adding helper functions to _test.go files means it cannot be used in other packages which leads to either code duplication or compiling the code all the time. It also runs the risk of production code coming to depend on "test" code without realizing it

We should come up with some system (build tags, make rules, or something else) to ensure this sort of code is only available for testing

ryanfkeepers commented 1 year ago

Are we currently building test code into the release binary?

ashmrtn commented 1 year ago

mockconnector may be getting compiled in. I can't say I've actually checked