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

Describe current test naming conventions in the contributing guidelines #2821

Merged
merged 14 commits into from
Jun 9, 2023
Prev Previous commit
Next Next commit
wip
  • Loading branch information
rumyantseva committed Jun 8, 2023
commit 29d7b3f4d3ca545eb0b4c7cd5ccd6fcf584ef8b9
6 changes: 4 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -237,14 +237,16 @@ Also, we should use driver methods as much as possible instead of testing comman
For example, `find_test.go` for testing the find command.
Test files belonging to the same commands group are organized into folders named after this group,
such as `aggregation`, `operations`, `diagnostic`, etc.
2. If the file contains compatibility tests, add the `_compat` suffix. For example, `find_compat_test.go`.
2. If the file contains compatibility tests, add the `_compat` suffix.
For example, `find_compat_test.go`.
3. Test names should include the name of the command being tested.
For instance, `TestDistinct` for testing the distinct command.
4. Compatibility tests should have `Compat` in the name, following the command.
For example, `TestDistinctCompat`.
5. Test names should be descriptive and provide information about the functionality or condition being tested.
If the test is checking for a specific error scenario, include the error scenario in the name.
6. Keep test names concise, avoiding overly cryptic names. Use abbreviations when appropriate.
6. Keep test names concise, avoiding overly cryptic names.
Use abbreviations when appropriate.
7. Avoid including test data in the name to maintain clarity and prevent excessively long names.
8. Test case names should follow `TitleCase` capitalization style.
9. Test and subtest names should not exceed 64 characters.
Expand Down