Skip to content

Commit

Permalink
Fix TestArchiveThresholds to not leave archive in repo
Browse files Browse the repository at this point in the history
  • Loading branch information
na-- committed Mar 5, 2022
1 parent 149aa60 commit ff51247
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion cmd/archive_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package cmd

import (
"os"
"path/filepath"
"testing"

Expand Down Expand Up @@ -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")
}
Expand Down

0 comments on commit ff51247

Please sign in to comment.