Skip to content

Commit

Permalink
tests: fix unnecessary file created on config tests (#733)
Browse files Browse the repository at this point in the history
Previously when running the config tests a file `config/test` was
created with all the logs. This commit change the behaviour to create
this test log file on temp directory.

This is related with #726 and #731

Signed-off-by: Matheus Alcantara <matheus.alcantara@zup.com.br>
  • Loading branch information
matheusalcantarazup authored Oct 28, 2021
1 parent 9a85401 commit 6419dcf
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,9 @@ func TestNewHorusecConfig(t *testing.T) {
assert.NoError(t, os.Setenv(config.EnvEnableShellCheck, "true"))
assert.NoError(t, os.Setenv(config.EnvCustomRulesPath, "test"))
assert.NoError(t, os.Setenv(config.EnvEnableInformationSeverity, "true"))
assert.NoError(t, os.Setenv(config.EnvLogFilePath, "test"))
assert.NoError(t, os.Setenv(
config.EnvLogFilePath, filepath.Join(os.TempDir(), "test.log")),
)
configs.LoadFromEnvironmentVariables()

assert.Equal(t, configFilePath, configs.ConfigFilePath)
Expand Down

0 comments on commit 6419dcf

Please sign in to comment.