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.
* add more logs for provider * refactor static provider/integration tests & add tests & fix makefile tests * add tests for viper provider close --------- Co-authored-by: maxim-konovalov <maksim.konovalov@vk.team>
- Loading branch information
1 parent
e02e856
commit aa80045
Showing
9 changed files
with
133 additions
and
9 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,4 +9,7 @@ | |
*.log | ||
|
||
# System | ||
*.pid | ||
*.pid | ||
|
||
# Go output | ||
*.out |
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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
TEST_TIMEOUT?=20s | ||
|
||
test: | ||
go test $(go list ./... | grep -v /tests/) -parallel=10 -timeout=$(TEST_TIMEOUT) -coverprofile=coverage.out | ||
go test ./... -parallel=10 -timeout=$(TEST_TIMEOUT) -coverprofile=coverage.out | ||
|
||
test/integration: | ||
@$(MAKE) -C ./tests/integration test |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
package vshard_router_test | ||
|
||
import ( | ||
"context" | ||
"testing" | ||
"time" | ||
|
||
"github.com/stretchr/testify/require" | ||
|
||
vshardrouter "github.com/KaymeKaydex/go-vshard-router" | ||
) | ||
|
||
var ( | ||
emptyMetrics = vshardrouter.EmptyMetrics{} | ||
stdoutLogger = vshardrouter.StdoutLogger{} | ||
) | ||
|
||
func TestEmptyMetrics_RetryOnCall(t *testing.T) { | ||
require.NotPanics(t, func() { | ||
emptyMetrics.RetryOnCall("") | ||
}) | ||
} | ||
|
||
func TestEmptyMetrics_RequestDuration(t *testing.T) { | ||
require.NotPanics(t, func() { | ||
emptyMetrics.RequestDuration(time.Second, false, false) | ||
}) | ||
} | ||
|
||
func TestEmptyMetrics_CronDiscoveryEvent(t *testing.T) { | ||
require.NotPanics(t, func() { | ||
emptyMetrics.CronDiscoveryEvent(false, time.Second, "") | ||
}) | ||
} | ||
|
||
func TestStdoutLogger(t *testing.T) { | ||
ctx := context.TODO() | ||
|
||
require.NotPanics(t, func() { | ||
stdoutLogger.Error(ctx, "") | ||
}) | ||
require.NotPanics(t, func() { | ||
stdoutLogger.Info(ctx, "") | ||
}) | ||
require.NotPanics(t, func() { | ||
stdoutLogger.Warn(ctx, "") | ||
}) | ||
require.NotPanics(t, func() { | ||
stdoutLogger.Debug(ctx, "") | ||
}) | ||
} |
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