Skip to content

Commit

Permalink
test: fix config test for windows
Browse files Browse the repository at this point in the history
  • Loading branch information
observeralone committed Jun 17, 2022
1 parent d947ac7 commit 579ae4b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
15 changes: 13 additions & 2 deletions config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,22 @@ func TestConfig_LoadSingleInput(t *testing.T) {

func TestConfig_ignoreErrorInput(t *testing.T) {
c := NewConfig()
c.InputFilters = []string{"memcached"}
err := c.LoadConfig("./testdata/ignore_error_input.toml")
require.NoError(t, err)
require.True(t, c.Inputs[0].Config.IgnoreInitError)
require.False(t, c.Inputs[1].Config.IgnoreInitError)
require.False(t, c.Inputs[2].Config.IgnoreInitError)

c = NewConfig()
c.InputFilters = []string{"http_listener_v2"}
err = c.LoadConfig("./testdata/ignore_error_input.toml")
require.NoError(t, err)
require.False(t, c.Inputs[0].Config.IgnoreInitError)

c = NewConfig()
c.InputFilters = []string{"ignore_init_error_test"}
err = c.LoadConfig("./testdata/ignore_error_input.toml")
require.NoError(t, err)
require.False(t, c.Inputs[0].Config.IgnoreInitError)
}

func TestConfig_LoadDirectory(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion config/testdata/ignore_error_input.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[[inputs.memcached]]
ignore_init_error=true

[[inputs.ignore_init_error_test]]
[[inputs.http_listener_v2]]

[[inputs.ignore_init_error_test]]
ignore_init_error=false

0 comments on commit 579ae4b

Please sign in to comment.