forked from TrueCloudLab/frostfs-node
f037022a7a
Make it store its internal `zap.Logger`'s level. Also, make all the components to accept internal `logger.Logger` instead of `zap.Logger`; it will simplify future refactor. Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
30 lines
694 B
Go
30 lines
694 B
Go
package writecache
|
|
|
|
import (
|
|
"os"
|
|
"path/filepath"
|
|
"strconv"
|
|
"testing"
|
|
|
|
"github.com/nspcc-dev/neofs-node/pkg/local_object_storage/internal/storagetest"
|
|
"github.com/nspcc-dev/neofs-node/pkg/util/logger"
|
|
"github.com/stretchr/testify/require"
|
|
"go.uber.org/zap/zaptest"
|
|
)
|
|
|
|
func TestGeneric(t *testing.T) {
|
|
defer func() { _ = os.RemoveAll(t.Name()) }()
|
|
|
|
var n int
|
|
newCache := func(t *testing.T) storagetest.Component {
|
|
n++
|
|
dir := filepath.Join(t.Name(), strconv.Itoa(n))
|
|
require.NoError(t, os.MkdirAll(dir, os.ModePerm))
|
|
return New(
|
|
WithLogger(&logger.Logger{Logger: zaptest.NewLogger(t)}),
|
|
WithFlushWorkersCount(2),
|
|
WithPath(dir))
|
|
}
|
|
|
|
storagetest.TestAll(t, newCache)
|
|
}
|