Skip to content

Commit 92af811

Browse files
committed
trying to fix test
1 parent 1620e91 commit 92af811

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

translator/tocwconfig/tocwconfig_test.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -437,8 +437,12 @@ func TestPrometheusPMDConfig(t *testing.T) {
437437
context.CurrentContext().SetMode(config.ModeEC2)
438438
t.Setenv(config.HOST_NAME, "host_name_from_env")
439439

440+
if err := os.MkdirAll("/tmp", os.ModePerm); err != nil && !os.IsExist(err) {
441+
t.Fatalf("Failed to create directory: %v", err)
442+
}
443+
440444
prometheusConfigFileName := filepath.Join("tmp", "prometheus.yaml")
441-
err := os.WriteFile(prometheusConfigFileName, []byte(prometheusPMDConfig), 0600)
445+
err := os.WriteFile(prometheusConfigFileName, []byte(prometheusPMDConfig), os.ModePerm) // #nosec G306
442446
require.NoError(t, err)
443447

444448
defer os.Remove(prometheusConfigFileName)

0 commit comments

Comments
 (0)