2020-04-08 14:14:58 +00:00
|
|
|
package storage
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/stretchr/testify/require"
|
|
|
|
)
|
|
|
|
|
2021-10-05 12:13:19 +00:00
|
|
|
func newBadgerDBForTesting(t testing.TB) Store {
|
2021-08-25 19:17:37 +00:00
|
|
|
bdbDir := t.TempDir()
|
2020-04-08 14:14:58 +00:00
|
|
|
dbConfig := DBConfiguration{
|
|
|
|
Type: "badgerdb",
|
|
|
|
BadgerDBOptions: BadgerDBOptions{
|
|
|
|
Dir: bdbDir,
|
|
|
|
},
|
|
|
|
}
|
|
|
|
newBadgerStore, err := NewBadgerDBStore(dbConfig.BadgerDBOptions)
|
|
|
|
require.Nil(t, err, "NewBadgerDBStore error")
|
2021-08-25 19:17:37 +00:00
|
|
|
return newBadgerStore
|
2020-04-08 14:14:58 +00:00
|
|
|
}
|