Skip to content

Commit

Permalink
test: fix storage backups (dragonflyoss#1270)
Browse files Browse the repository at this point in the history
Signed-off-by: Gaius <[email protected]>
  • Loading branch information
gaius-qi authored Apr 21, 2022
1 parent b056eef commit 5efaf23
Showing 1 changed file with 0 additions and 28 deletions.
28 changes: 0 additions & 28 deletions scheduler/storage/storage_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -585,34 +585,6 @@ func TestStorage_backups(t *testing.T) {
assert.Error(err)
},
},
{
name: "get backups",
baseDir: os.TempDir(),
options: []Option{WithMaxSize(0), WithBufferSize(1)},
mock: func(t *testing.T, s Storage) {
if err := s.Create(Record{ID: "1"}); err != nil {
t.Fatal(err)
}

if err := s.Create(Record{ID: "2"}); err != nil {
t.Fatal(err)
}

if err := s.Create(Record{ID: "3"}); err != nil {
t.Fatal(err)
}
},
expect: func(t *testing.T, s Storage, baseDir string) {
assert := assert.New(t)
backups, err := s.(*storage).backups()
assert.NoError(err)
assert.Equal(len(backups), 3)
assert.Equal(backups[2].Name(), fmt.Sprintf("%s.%s", RecordFilePrefix, RecordFileExt))
if err := s.Clear(); err != nil {
t.Fatal(err)
}
},
},
}

for _, tc := range tests {
Expand Down

0 comments on commit 5efaf23

Please sign in to comment.