Skip to content

Commit 66099ef

Browse files
committed
STAC-24007: Clean up after a test function
1 parent 4808170 commit 66099ef

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

cmd/stackpack/stackpack_test_deploy_cmd_test.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,10 @@ func TestStackpackTestDeployCommand_DirectoryHandling(t *testing.T) {
212212
require.NoError(t, os.MkdirAll(stackpackDir, 0755))
213213

214214
// Create required files
215-
createTestStackpack(t, stackpackDir, "test-stackpack", "1.0.0")
215+
stackpackName := "test-stackpack"
216+
stackPackCurrentVersion := "1.0.0"
217+
createTestStackpack(t, stackpackDir, stackpackName, stackPackCurrentVersion)
218+
stackpackTestArchive := fmt.Sprintf("%s-%s-cli-test.10000.sts", stackpackName, stackPackCurrentVersion)
216219

217220
cli, cmd := setupStackpackTestDeployCmd(t)
218221

@@ -231,6 +234,7 @@ func TestStackpackTestDeployCommand_DirectoryHandling(t *testing.T) {
231234
// Note: This test will fail at the API call stage since we're using mock deps
232235
// But we can verify that directory parsing works
233236
_, err := di.ExecuteCommandWithContext(&cli.Deps, cmd, tt.args...)
237+
defer os.Remove(stackpackTestArchive)
234238

235239
// Should fail on API calls (upload/install), not on directory or config parsing
236240
if err != nil {

0 commit comments

Comments
 (0)