Skip to content

Commit

Permalink
Each call to t.TempDir return a new directory
Browse files Browse the repository at this point in the history
  • Loading branch information
mostafa committed Oct 3, 2024
1 parent 9e4bcb2 commit efc8668
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions cmd/plugin_scaffold_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,10 @@ func Test_pluginScaffoldCmd(t *testing.T) {
plugin.IsPluginTemplateEmbedded()
pluginTestScaffoldInputFile := "./testdata/scaffold_input.yaml"

tempDir := t.TempDir()

output, err := executeCommandC(
rootCmd, "plugin", "scaffold", "-i", pluginTestScaffoldInputFile, "-o", t.TempDir())
rootCmd, "plugin", "scaffold", "-i", pluginTestScaffoldInputFile, "-o", tempDir)
require.NoError(t, err, "plugin scaffold should not return an error")
assert.Contains(t, output, "scaffold done")
assert.Contains(t, output, "created files:")
Expand All @@ -42,7 +44,7 @@ func Test_pluginScaffoldCmd(t *testing.T) {
assert.Contains(t, output, "test-gatewayd-plugin/.github/workflows/commits-signed.yaml")

pluginName := "test-gatewayd-plugin"
pluginDir := filepath.Join(t.TempDir(), pluginName)
pluginDir := filepath.Join(tempDir, pluginName)

pluginsConfig, err := os.ReadFile(filepath.Join(pluginDir, "gatewayd_plugin.yaml"))
require.NoError(t, err, "reading plugins config file should not return an error")
Expand Down

0 comments on commit efc8668

Please sign in to comment.