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
23 changes: 23 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,29 @@ Writing separate tests might be much better than making a single test that check

Also, we should use driver methods as much as possible instead of testing commands directly via `RunCommand`.

#### Integration tests naming guidelines

1. Test names should include the name of the command being tested.
For instance, `TestDistinct` for testing the distinct command.
2. Compatibility tests should have `Compat` in the name, following the command.
For example, `TestDistinctCompat`.
3. If the test doesn't use driver method but runs a command directly via `RunCommand`,
the suffix `Command` should be added.
For example, `TestDistinctCommand`.
4. If the test is both compat and runs a command, the suffix `CommandCompat` should be added.
For example, `TestInsertCommandCompat`.
5. If the file consists of compatibility tests, add the `_compat` suffix.
For example, `distinct_compat_test.go`.
6. 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.
7. Keep test names concise, avoiding overly cryptic names.
Use abbreviations when appropriate.
8. Avoid including test data in the name to maintain clarity and prevent excessively long names.
9. Test case names should follow `TitleCase` capitalization style.
No spaces, dashes or underscores should be used neither for test names nor for test case names.
10. Keep the concatenation of test name segments (test, subtests, and handler) within 64 characters
to satisfy the maximum limit for database names.

### Submitting code changes

#### Before submitting PR
Expand Down
6 changes: 3 additions & 3 deletions integration/indexes_compat_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -287,8 +287,8 @@ func TestIndexesCompatCreate(t *testing.T) {
}
}

// TestIndexesCreateRunCommand tests specific behavior for index creation that can be only provided through RunCommand.
func TestIndexesCompatCreateRunCommand(t *testing.T) {
// TestCreateIndexesCommandCompat tests specific behavior for index creation that can be only provided through RunCommand.
func TestCreateIndexesCommandCompat(t *testing.T) {
setup.SkipForTigrisWithReason(t, "Indexes creation is not supported for Tigris")

t.Parallel()
Expand Down Expand Up @@ -559,7 +559,7 @@ func TestIndexesCompatDrop(t *testing.T) {
}
}

func TestIndexesCompatDropRunCommand(t *testing.T) {
func TestDropIndexesCommandCompat(t *testing.T) {
setup.SkipForTigrisWithReason(t, "Indexes are not supported for Tigris")

t.Parallel()
Expand Down