You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, we have a mix of test package name conventions - same package name and package_test name. We should adhere to a standard practice of using only package_test name.
Currently, we have a mix of test package name conventions - same
package
name andpackage_test
name. We should adhere to a standard practice of using onlypackage_test
name.See some examples -
cluster-api-provider-bringyourownhost/agent/reconciler/reconciler_test.go
Line 4 in b95d6ef
cluster-api-provider-bringyourownhost/agent/installer/bundle_downloader_test.go
Line 4 in b95d6ef
cluster-api-provider-bringyourownhost/agent/cloudinit/file_writer_test.go
Line 4 in b95d6ef
Why?
blackbox testing
- i.e., testing only the exported methods / functions, and that's what an end user would do as well.How to test helper functions?
In that case, we can benefit from this Golang trick of
export_test.go
- Read more hereHow to ensure future code is also consistent?
Enable testpackage linter in
golangci-lint
References:
The text was updated successfully, but these errors were encountered: