Skip to content

Commit

Permalink
Disable logging in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
aalda committed Nov 25, 2019
1 parent b716686 commit 0bc919f
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions badger_store_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,12 @@ func testBadgerStore(t testing.TB) (*BadgerStore, string) {
os.RemoveAll(path)

// Successfully creates and returns a store
store, err := New(Options{Path: path, NoSync: true})
badgerOpts := badger.DefaultOptions(path).WithLogger(nil)
store, err := New(Options{
Path: path,
NoSync: true,
BadgerOptions: &badgerOpts,
})
if err != nil {
t.Fatalf("err: %s", err)
}
Expand Down Expand Up @@ -73,7 +78,7 @@ func TestBadgerOptionsReadOnly(t *testing.T) {
}
store.Close()

defaultOpts := badger.DefaultOptions(path)
defaultOpts := badger.DefaultOptions(path).WithLogger(nil)
options := Options{
Path: path,
BadgerOptions: &defaultOpts,
Expand Down Expand Up @@ -119,7 +124,7 @@ func TestNewBadgerStore(t *testing.T) {
}

// Ensure our files were created
opts := badger.DefaultOptions(path)
opts := badger.DefaultOptions(path).WithLogger(nil)
db, err := badger.Open(opts)
if err != nil {
t.Fatalf("err: %s", err)
Expand Down

0 comments on commit 0bc919f

Please sign in to comment.