Skip to content

Commit

Permalink
test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
michalpristas committed Jun 20, 2024
1 parent 0cfff08 commit 58be04f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions internal/pkg/agent/cmd/otel_flags_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ func TestOtelFlagsSetup(t *testing.T) {
func TestGetConfigFiles(t *testing.T) {
cmd := newOtelCommandWithArgs(nil, nil)
configFile := "sample.yaml"
cmd.Flag(otelConfigFlagName).Value.Set(configFile)
require.NoError(t, cmd.Flag(otelConfigFlagName).Value.Set(configFile))

setVal := "set=val"
sets, err := getSets([]string{setVal})
require.NoError(t, err)
cmd.Flag(otelSetFlagName).Value.Set(setVal)
require.NoError(t, cmd.Flag(otelSetFlagName).Value.Set(setVal))

expectedConfigFiles := append([]string{configFile}, sets...)
configFiles, err := getConfigFiles(cmd, false)
Expand All @@ -52,7 +52,7 @@ func TestGetConfigFilesWithDefault(t *testing.T) {
setVal := "set=val"
sets, err := getSets([]string{setVal})
require.NoError(t, err)
cmd.Flag(otelSetFlagName).Value.Set(setVal)
require.NoError(t, cmd.Flag(otelSetFlagName).Value.Set(setVal))

expectedConfigFiles := append([]string{paths.OtelConfigFile()}, sets...)
configFiles, err := getConfigFiles(cmd, true)
Expand Down

0 comments on commit 58be04f

Please sign in to comment.