WIP: Morph: Add unit tests #2

Closed
dstepanov-yadro wants to merge 233 commits from TrueCloudLab/frostfs-node:master into object-3608-morph-unit-tests
12 changed files with 37 additions and 0 deletions
Showing only changes of commit 4578d00619 - Show all commits

View file

@ -43,6 +43,8 @@ type objAddr struct {
}
func TestShardOpen(t *testing.T) {
t.Parallel()
dir := t.TempDir()
metaPath := filepath.Join(dir, "meta")
@ -111,6 +113,8 @@ func TestShardOpen(t *testing.T) {
}
func TestRefillMetabaseCorrupted(t *testing.T) {
t.Parallel()
dir := t.TempDir()
fsTree := fstree.New(
@ -164,6 +168,8 @@ func TestRefillMetabaseCorrupted(t *testing.T) {
}
func TestRefillMetabase(t *testing.T) {
t.Parallel()
p := t.Name()
defer os.RemoveAll(p)

View file

@ -13,11 +13,15 @@ import (
)
func TestShard_Delete(t *testing.T) {
t.Parallel()
t.Run("without write cache", func(t *testing.T) {
t.Parallel()
testShardDelete(t, false)
})
t.Run("with write cache", func(t *testing.T) {
t.Parallel()
testShardDelete(t, true)
})
}

View file

@ -25,6 +25,8 @@ import (
)
func Test_GCDropsLockedExpiredObject(t *testing.T) {
t.Parallel()
var sh *shard.Shard
epoch := &epochState{

View file

@ -17,11 +17,15 @@ import (
)
func TestShard_Get(t *testing.T) {
t.Parallel()
t.Run("without write cache", func(t *testing.T) {
t.Parallel()
testShardGet(t, false)
})
t.Run("with write cache", func(t *testing.T) {
t.Parallel()
testShardGet(t, true)
})
}

View file

@ -15,11 +15,15 @@ import (
)
func TestShard_Head(t *testing.T) {
t.Parallel()
t.Run("without write cache", func(t *testing.T) {
t.Parallel()
testShardHead(t, false)
})
t.Run("with write cache", func(t *testing.T) {
t.Parallel()
testShardHead(t, true)
})
}

View file

@ -13,11 +13,15 @@ import (
)
func TestShard_Inhume(t *testing.T) {
t.Parallel()
t.Run("without write cache", func(t *testing.T) {
t.Parallel()
testShardInhume(t, false)
})
t.Run("with write cache", func(t *testing.T) {
t.Parallel()
testShardInhume(t, true)
})
}

View file

@ -14,6 +14,8 @@ import (
)
func TestShard_List(t *testing.T) {
t.Parallel()
t.Run("without write cache", func(t *testing.T) {
t.Parallel()
sh := newShard(t, false)

View file

@ -23,6 +23,8 @@ import (
)
func TestShard_Lock(t *testing.T) {
t.Parallel()
var sh *shard.Shard
rootPath := t.TempDir()

View file

@ -72,6 +72,8 @@ const physical = "phy"
const logical = "logic"
func TestCounters(t *testing.T) {
t.Parallel()
dir := t.TempDir()
sh, mm := shardWithMetrics(t, dir)

View file

@ -22,11 +22,14 @@ import (
)
func TestShard_GetRange(t *testing.T) {
t.Parallel()
t.Run("without write cache", func(t *testing.T) {
t.Parallel()
testShardGetRange(t, false)
})
t.Run("with write cache", func(t *testing.T) {
t.Parallel()
testShardGetRange(t, true)
})
}

View file

@ -24,6 +24,8 @@ import (
)
func TestShardReload(t *testing.T) {
t.Parallel()
p := t.Name()
defer os.RemoveAll(p)

View file

@ -16,6 +16,8 @@ import (
)
func TestWriteCacheObjectLoss(t *testing.T) {
t.Parallel()
const (
smallSize = 1024
objCount = 100