forked from TrueCloudLab/frostfs-s3-gw
[#596] Use zaptest.Logger
Use zaptest to get logs which get printed only if a test fails or if you ran go test -v. Dont use zaptest.Logger for fuzz otherwise ngfuzz/libfuzz crashes Signed-off-by: Denis Kirillov <d.kirillov@yadro.com>
This commit is contained in:
parent
f8852c7626
commit
0fba02aadb
6 changed files with 32 additions and 30 deletions
10
api/cache/objects_test.go
vendored
10
api/cache/objects_test.go
vendored
|
@ -8,14 +8,14 @@ import (
|
|||
oid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object/id"
|
||||
objecttest "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object/test"
|
||||
"github.com/stretchr/testify/require"
|
||||
"go.uber.org/zap"
|
||||
"go.uber.org/zap/zaptest"
|
||||
)
|
||||
|
||||
func getTestConfig() *Config {
|
||||
func getTestConfig(t *testing.T) *Config {
|
||||
return &Config{
|
||||
Size: 10,
|
||||
Lifetime: 5 * time.Second,
|
||||
Logger: zap.NewExample(),
|
||||
Logger: zaptest.NewLogger(t),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -44,7 +44,7 @@ func TestCache(t *testing.T) {
|
|||
}
|
||||
|
||||
t.Run("check get", func(t *testing.T) {
|
||||
cache := New(getTestConfig())
|
||||
cache := New(getTestConfig(t))
|
||||
err := cache.PutObject(extObjInfo)
|
||||
require.NoError(t, err)
|
||||
|
||||
|
@ -53,7 +53,7 @@ func TestCache(t *testing.T) {
|
|||
})
|
||||
|
||||
t.Run("check delete", func(t *testing.T) {
|
||||
cache := New(getTestConfig())
|
||||
cache := New(getTestConfig(t))
|
||||
err := cache.PutObject(extObjInfo)
|
||||
require.NoError(t, err)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue