I agree with Craig. The *_test.go files are specifically defined in
the specification for tests. Some details on how and what is here [1]
with even more details in [2].
We do not want to pollute the production code with test code unless we
really need to expose some detail that we cannot otherwise.

Wilfred

[1] https://go.dev/doc/code#Testing
[2] https://pkg.go.dev/cmd/go#hdr-Test_packages

On Thu, 26 May 2022 at 18:15, Craig Condit <[email protected]> wrote:
>
> Go files need to end in _test.go in order to be ignored during the build 
> process. The two examples you gave are testing *libraries* in which case they 
> are named differently so that the test files *are* included in the default go 
> build.
>
> I’m -1 on changing this within YuniKorn, as it is working by design.
>
>
> Craig
>
>
> > On May 26, 2022, at 8:30 AM, Manikandan R <[email protected]> wrote:
> >
> > Hi Community,
> >
> > For some reasons, we have been following *_test.go for test classes. Test
> > methods intended as commons/helpers are not exposed to other test classes
> > because of the naming convention followed to name the test class files.
> >
> > On a quick search around good practices, had come across these well known
> > Go testing libs
> >
> > https://pkg.go.dev/net/http/httptest
> > https://pkg.go.dev/testing/iotest
> >
> > It seems to be a good example of naming the test files. Please share your
> > thoughts on renaming the test files in our repository.
> >
> > Thanks,
> > Mani
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to