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

Test package naming convention #241

Closed
anusha94 opened this issue Nov 12, 2021 · 0 comments · Fixed by #326
Closed

Test package naming convention #241

anusha94 opened this issue Nov 12, 2021 · 0 comments · Fixed by #326
Assignees
Labels
area/code-quality enhancement New feature or request
Milestone

Comments

@anusha94
Copy link
Contributor

anusha94 commented Nov 12, 2021

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.

See some examples -



Why?

  • It enforces blackbox testing - i.e., testing only the exported methods / functions, and that's what an end user would do as well.
  • avoids import cycles

How to test helper functions?
In that case, we can benefit from this Golang trick of export_test.go - Read more here

How to ensure future code is also consistent?
Enable testpackage linter in golangci-lint

References:

@anusha94 anusha94 added the enhancement New feature or request label Nov 12, 2021
@jamiemonserrate jamiemonserrate added this to the v0.1.1 milestone Nov 26, 2021
@anusha94 anusha94 self-assigned this Jan 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/code-quality enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants