diff --git a/cmd/archive_test.go b/cmd/archive_test.go index 0b53a651866..e281ea9fcff 100644 --- a/cmd/archive_test.go +++ b/cmd/archive_test.go @@ -1,6 +1,7 @@ package cmd import ( + "os" "path/filepath" "testing" @@ -40,10 +41,17 @@ func TestArchiveThresholds(t *testing.T) { t.Run(testCase.name, func(t *testing.T) { t.Parallel() + tmpDir, err := os.MkdirTemp("", "k6archivetest") + require.NoError(t, err) + defer func() { + require.NoError(t, os.RemoveAll(tmpDir)) + }() + tmpPath := filepath.Join(tmpDir, "archive.tar") + cmd := getArchiveCmd(testutils.NewLogger(t), newCommandFlags()) filename, err := filepath.Abs(testCase.testFilename) require.NoError(t, err) - args := []string{filename} + args := []string{filename, "--archive-out", tmpPath} if testCase.noThresholds { args = append(args, "--no-thresholds") }