[#668] shard/test: Simplify shard construction

newCustomShard() has many parameters but only the first is obligatory.
`enableWriteCache` is left as-is, because it directly affects the
functionality.

Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
This commit is contained in:
Evgenii Stratonikov 2023-09-06 17:32:14 +03:00 committed by Evgenii Stratonikov
parent 429f941cda
commit 268adb79cb
4 changed files with 55 additions and 44 deletions

View file

@ -29,7 +29,7 @@ func Test_GCDropsLockedExpiredSimpleObject(t *testing.T) {
wcOpts := writecacheconfig.Options{
Type: writecacheconfig.TypeBBolt,
}
sh := newCustomShard(t, t.TempDir(), false, wcOpts, nil, []meta.Option{meta.WithEpochState(epoch)})
sh := newCustomShard(t, false, shardOptions{rootPath: t.TempDir(), wcOpts: wcOpts, metaOptions: []meta.Option{meta.WithEpochState(epoch)}})
t.Cleanup(func() {
releaseShard(sh, t)
@ -129,7 +129,7 @@ func Test_GCDropsLockedExpiredComplexObject(t *testing.T) {
wcOpts := writecacheconfig.Options{
Type: writecacheconfig.TypeBBolt,
}
sh := newCustomShard(t, t.TempDir(), false, wcOpts, nil, []meta.Option{meta.WithEpochState(epoch)})
sh := newCustomShard(t, false, shardOptions{rootPath: t.TempDir(), wcOpts: wcOpts, metaOptions: []meta.Option{meta.WithEpochState(epoch)}})
t.Cleanup(func() {
releaseShard(sh, t)