This repository has been archived by the owner on Dec 23, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature/tests: add more tests and refactor Makefile for race tests
* Makefile refactored for racetests * Tests coverage up
- Loading branch information
Maksim Konovalov
committed
Aug 30, 2024
1 parent
cf02580
commit 910ca35
Showing
9 changed files
with
155 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package vshard_router // nolint: revive | ||
|
||
import ( | ||
"context" | ||
"testing" | ||
|
||
"github.com/stretchr/testify/require" | ||
) | ||
|
||
var emptyRouter = &Router{ | ||
cfg: Config{ | ||
TotalBucketCount: uint64(10), | ||
Logger: &EmptyLogger{}, | ||
}, | ||
} | ||
|
||
func TestVshardMode_String_NotEmpty(t *testing.T) { | ||
t.Parallel() | ||
require.NotEmpty(t, ReadMode.String()) | ||
require.NotEmpty(t, WriteMode.String()) | ||
} | ||
|
||
func TestRouter_RouterRouteAll(t *testing.T) { | ||
t.Parallel() | ||
m := emptyRouter.RouterRouteAll() | ||
require.Empty(t, m) | ||
} | ||
|
||
func TestRouter_RouterCallImpl(t *testing.T) { | ||
t.Parallel() | ||
ctx := context.TODO() | ||
|
||
_, _, err := emptyRouter.RouterCallImpl(ctx, 100, CallOpts{}, "test", []byte("test")) | ||
require.Errorf(t, err, "bucket id is out of range") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters