[#xx] Avoid manual management of files in tests

Signed-off-by: Alejandro Lopez <a.lopez@yadro.com>
This commit is contained in:
Alejandro Lopez 2023-08-14 14:01:39 +03:00
parent 376f03a445
commit ae8be495c8
13 changed files with 17 additions and 79 deletions

View file

@ -2,7 +2,6 @@ package engine
import (
"context"
"fmt"
"os"
"path/filepath"
"sync/atomic"
@ -204,11 +203,10 @@ func testDefaultShardOptions(t testing.TB, id int) []shard.Option {
shard.WithLogger(&logger.Logger{Logger: zap.L()}),
shard.WithBlobStorOptions(
blobstor.WithStorages(
newStorages(filepath.Join(t.Name(), fmt.Sprintf("%d.blobstor", id)),
1<<20))),
shard.WithPiloramaOptions(pilorama.WithPath(filepath.Join(t.Name(), fmt.Sprintf("%d.pilorama", id)))),
newStorages(t.TempDir(), 1<<20))),
shard.WithPiloramaOptions(pilorama.WithPath(filepath.Join(t.TempDir(), "pilorama"))),
shard.WithMetaBaseOptions(
meta.WithPath(filepath.Join(t.Name(), fmt.Sprintf("%d.metabase", id))),
meta.WithPath(filepath.Join(t.TempDir(), "metabase")),
meta.WithPermissions(0700),
meta.WithEpochState(epochState{}),
)}