Fix test, add test helper script

This commit is contained in:
Daniel 2019-08-20 15:42:46 +02:00
parent 1cf51f683b
commit a2d6bc974c
9 changed files with 90 additions and 175 deletions

View file

@ -26,9 +26,7 @@ func init() {
// NewBadger opens/creates a badger database.
func NewBadger(name, location string) (storage.Interface, error) {
opts := badger.DefaultOptions
opts.Dir = location
opts.ValueDir = location
opts := badger.DefaultOptions(location)
db, err := badger.Open(opts)
if err == badger.ErrTruncateNeeded {

View file

@ -46,7 +46,7 @@ func (s *Sinkhole) Delete(key string) error {
}
// Query returns a an iterator for the supplied query.
func (s *Sinkhole) Query(q *query.Query) (*iterator.Iterator, error) {
func (s *Sinkhole) Query(q *query.Query, local, internal bool) (*iterator.Iterator, error) {
return nil, errors.New("query not implemented by sinkhole")
}
@ -55,6 +55,11 @@ func (s *Sinkhole) ReadOnly() bool {
return false
}
// Injected returns whether the database is injected.
func (s *Sinkhole) Injected() bool {
return false
}
// Maintain runs a light maintenance operation on the database.
func (s *Sinkhole) Maintain() error {
return nil