forked from TrueCloudLab/frostfs-node
[#668] shard/test: Move tests to the main package
Semantic patch (also, duplicate definitions are removed): ``` @@ var e identifier @@ -import "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/local_object_storage/shard" -shard.e +e ``` Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
This commit is contained in:
parent
aa23c6a83a
commit
bdecfbc1be
12 changed files with 79 additions and 99 deletions
|
@ -1,4 +1,4 @@
|
|||
package shard_test
|
||||
package shard
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
@ -10,7 +10,6 @@ import (
|
|||
objectCore "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/core/object"
|
||||
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/local_object_storage/internal/testutil"
|
||||
meta "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/local_object_storage/metabase"
|
||||
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/local_object_storage/shard"
|
||||
writecacheconfig "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/local_object_storage/writecache/config"
|
||||
"git.frostfs.info/TrueCloudLab/frostfs-sdk-go/client"
|
||||
cidtest "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/container/id/test"
|
||||
|
@ -55,7 +54,7 @@ func Test_GCDropsLockedExpiredSimpleObject(t *testing.T) {
|
|||
lock.SetAttributes(lockExpirationAttr)
|
||||
lockID, _ := lock.ID()
|
||||
|
||||
var putPrm shard.PutPrm
|
||||
var putPrm PutPrm
|
||||
putPrm.SetObject(obj)
|
||||
|
||||
_, err := sh.Put(context.Background(), putPrm)
|
||||
|
@ -69,9 +68,9 @@ func Test_GCDropsLockedExpiredSimpleObject(t *testing.T) {
|
|||
require.NoError(t, err)
|
||||
|
||||
epoch.Value = 105
|
||||
sh.NotificationChannel() <- shard.EventNewEpoch(epoch.Value)
|
||||
sh.NotificationChannel() <- EventNewEpoch(epoch.Value)
|
||||
|
||||
var getPrm shard.GetPrm
|
||||
var getPrm GetPrm
|
||||
getPrm.SetAddress(objectCore.AddressOf(obj))
|
||||
require.Eventually(t, func() bool {
|
||||
_, err = sh.Get(context.Background(), getPrm)
|
||||
|
@ -141,7 +140,7 @@ func Test_GCDropsLockedExpiredComplexObject(t *testing.T) {
|
|||
lock.SetAttributes(lockExpirationAttr)
|
||||
lockID, _ := lock.ID()
|
||||
|
||||
var putPrm shard.PutPrm
|
||||
var putPrm PutPrm
|
||||
|
||||
for _, child := range children {
|
||||
putPrm.SetObject(child)
|
||||
|
@ -160,7 +159,7 @@ func Test_GCDropsLockedExpiredComplexObject(t *testing.T) {
|
|||
_, err = sh.Put(context.Background(), putPrm)
|
||||
require.NoError(t, err)
|
||||
|
||||
var getPrm shard.GetPrm
|
||||
var getPrm GetPrm
|
||||
getPrm.SetAddress(objectCore.AddressOf(parent))
|
||||
|
||||
_, err = sh.Get(context.Background(), getPrm)
|
||||
|
@ -168,7 +167,7 @@ func Test_GCDropsLockedExpiredComplexObject(t *testing.T) {
|
|||
require.True(t, errors.As(err, &splitInfoError), "split info must be provided")
|
||||
|
||||
epoch.Value = 105
|
||||
sh.NotificationChannel() <- shard.EventNewEpoch(epoch.Value)
|
||||
sh.NotificationChannel() <- EventNewEpoch(epoch.Value)
|
||||
|
||||
require.Eventually(t, func() bool {
|
||||
_, err = sh.Get(context.Background(), getPrm)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue