Skip to content

Commit

Permalink
Add temporary directory for Raft in Test_pluginScaffoldCmd
Browse files Browse the repository at this point in the history
- Introduced a temporary directory for Raft using t.TempDir() in the Test_pluginScaffoldCmd test case.
- Set the GATEWAYD_RAFT_DIRECTORY environment variable to the new temporary directory.
- This change ensures that Raft operations during testing are isolated and do not interfere with other tests or system directories.
  • Loading branch information
sinadarbouy committed Nov 29, 2024
1 parent 809530f commit 071e84c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cmd/plugin_scaffold_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ func Test_pluginScaffoldCmd(t *testing.T) {
postgresAddress2 := postgresHostIP2 + ":" + postgresMappedPort2.Port()
t.Setenv("GATEWAYD_CLIENTS_TEST_WRITE_ADDRESS", postgresAddress2)

raftTempDir := t.TempDir()
t.Setenv("GATEWAYD_RAFT_DIRECTORY", raftTempDir)

globalTestConfigFile := filepath.Join("testdata", "gatewayd.yaml")
plugin.IsPluginTemplateEmbedded()
pluginTestScaffoldInputFile := "./testdata/scaffold_input.yaml"
Expand Down

0 comments on commit 071e84c

Please sign in to comment.