Skip to content

Commit

Permalink
clear resources after test run
Browse files Browse the repository at this point in the history
  • Loading branch information
treblereel committed Dec 16, 2024
1 parent cfd1a4f commit eea41d5
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion packages/kn-plugin-workflow/e2e-tests/deploy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ package e2e_tests
import (
"fmt"
"os"
"path/filepath"
"testing"
"time"

Expand Down Expand Up @@ -53,8 +54,15 @@ func TestDeployProjectSuccess(t *testing.T) {
// Run `create` command
RunCreateTest(t, CfgTestInputCreate_Success[0])
// change dir to created project
err := os.Chdir(GetCreateProjectName(t, CfgTestInputCreate_Success[0]))
projectName := GetCreateProjectName(t, CfgTestInputCreate_Success[0])
projectDir := filepath.Join(TempTestsPath, projectName)

// delete the project directory after the test
defer os.RemoveAll(projectDir)

require.NoError(t, err)
err = os.Chdir(projectDir)
require.NoErrorf(t, err, "Expected nil error, got %v", err)

// Run `deploy` command
_, err = ExecuteKnWorkflow(transformDeployCmdCfgToArgs(test.input)...)
Expand Down

0 comments on commit eea41d5

Please sign in to comment.