Skip to content
This repository was archived by the owner on Jul 27, 2023. It is now read-only.

Commit cae171f

Browse files
committed
Tests improvements
1 parent c7eeabe commit cae171f

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

config/config_test.go

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ func TestOnlyEnvConfig(t *testing.T) {
7979
}
8080

8181
func TestOnlyEnvConfigArgsScrubbingEnabled(t *testing.T) {
82-
os.Setenv("DD_SCRUB_ARGS", "true")
8382
os.Setenv("DD_CUSTOM_SENSITIVE_WORDS", "*password*,consul_token,*api_key")
8483

8584
agentConfig, _ := NewAgentConfig(nil, nil)
@@ -89,16 +88,17 @@ func TestOnlyEnvConfigArgsScrubbingEnabled(t *testing.T) {
8988
cmdline []string
9089
parsedCmdline []string
9190
}{
92-
{[]string{"spidly", "--mypasswords=123,456", "consul_token", "1234", "--dd_api_key=1234"},
93-
[]string{"spidly", "--mypasswords=********", "consul_token", "********", "--dd_api_key=********"}},
91+
{
92+
[]string{"spidly", "--mypasswords=123,456", "consul_token", "1234", "--dd_api_key=1234"},
93+
[]string{"spidly", "--mypasswords=********", "consul_token", "********", "--dd_api_key=********"},
94+
},
9495
}
9596

9697
for i := range cases {
9798
cases[i].cmdline = agentConfig.Scrubber.ScrubCmdline(cases[i].cmdline)
9899
assert.Equal(t, cases[i].parsedCmdline, cases[i].cmdline)
99100
}
100101

101-
os.Setenv("DD_SCRUB_ARGS", "")
102102
os.Setenv("DD_CUSTOM_SENSITIVE_WORDS", "")
103103
}
104104

@@ -113,8 +113,10 @@ func TestOnlyEnvConfigArgsScrubbingDisabled(t *testing.T) {
113113
cmdline []string
114114
parsedCmdline []string
115115
}{
116-
{[]string{"spidly", "--mypasswords=123,456", "consul_token", "1234", "--dd_api_key=1234"},
117-
[]string{"spidly", "--mypasswords=123,456", "consul_token", "1234", "--dd_api_key=1234"}},
116+
{
117+
[]string{"spidly", "--mypasswords=123,456", "consul_token", "1234", "--dd_api_key=1234"},
118+
[]string{"spidly", "--mypasswords=123,456", "consul_token", "1234", "--dd_api_key=1234"},
119+
},
118120
}
119121

120122
for i := range cases {

0 commit comments

Comments
 (0)