Skip to content

Commit

Permalink
Increase codecov
Browse files Browse the repository at this point in the history
Signed-off-by: Ashmita Bohara <ashmita.bohara152@gmail.com>
  • Loading branch information
Ashmita152 committed Jun 19, 2021
1 parent ed1bd04 commit e9cd89d
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions plugin/storage/badger/factory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,20 +189,23 @@ func TestBadgerMetrics(t *testing.T) {
assert.NoError(t, err)
}

func TestInitFromDefaultOptions(t *testing.T) {
func TestInitFromOptions(t *testing.T) {
f := NewFactory()
opts := Options{}
f.InitFromOptions(opts)
assert.Equal(t, &opts, f.Options)
}

func TestInitFromCustomOptions(t *testing.T) {
func TestTruncateCodecov(t *testing.T) {
f := NewFactory()
opts := Options{
Primary: NamespaceConfig{
Truncate: true,
},
}
f.InitFromOptions(opts)
assert.Equal(t, &opts, f.Options)
v, command := config.Viperize(f.AddFlags)
command.ParseFlags([]string{
"--badger.truncate",
})
f.InitFromViper(v)
mFactory := metricstest.NewFactory(0)
f.Initialize(mFactory, zap.NewNop())
defer f.Close()

assert.True(t, f.Options.Primary.Truncate)
}

0 comments on commit e9cd89d

Please sign in to comment.