8000 fixup! chore(coderd): extract fileszip to its own package for reuse · coder/coder@804d9e8 · GitHub
[go: up one dir, main page]

Skip to content

Commit 804d9e8

Browse files
committed
fixup! chore(coderd): extract fileszip to its own package for reuse
1 parent 554281c commit 804d9e8

File tree

3 files changed

+4
-116
lines changed

3 files changed

+4
-116
lines changed

cli/templatepull_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ import (
1414
"github.com/stretchr/testify/require"
1515

1616
"github.com/coder/coder/v2/cli/clitest"
17-
"github.com/coder/coder/v2/coderd"
1817
"github.com/coder/coder/v2/coderd/coderdtest"
1918
"github.com/coder/coder/v2/coderd/rbac"
19+
"github.com/coder/coder/v2/fileszip"
2020
"github.com/coder/coder/v2/provisioner/echo"
2121
"github.com/coder/coder/v2/provisionersdk"
2222
"github.com/coder/coder/v2/provisionersdk/proto"
@@ -95,7 +95,7 @@ func TestTemplatePull_Stdout(t *testing.T) {
9595

9696
// Verify .zip format
9797
tarReader := tar.NewReader(bytes.NewReader(expected))
98-
expectedZip, err := coderd.CreateZipFromTar(tarReader)
98+
expectedZip, err := fileszip.CreateZipFromTar(tarReader, int64(len(expected)))
9999
require.NoError(t, err)
100100

101101
inv, root = clitest.New(t, "templates", "pull", "--zip", template.Name)

coderd/files_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ import (
1010
"github.com/google/uuid"
1111
"github.com/stretchr/testify/require"
1212

13-
"github.com/coder/coder/v2/coderd"
1413
"github.com/coder/coder/v2/coderd/coderdtest"
1514
"github.com/coder/coder/v2/codersdk"
15+
"github.com/coder/coder/v2/fileszip"
1616
"github.com/coder/coder/v2/fileszip/filesziptest"
1717
"github.com/coder/coder/v2/testutil"
1818
)
@@ -133,7 +133,7 @@ func TestDownload(t *testing.T) {
133133
tarball := filesziptest.TestTarFileBytes()
134134

135135
tarReader := tar.NewReader(bytes.NewReader(tarball))
136-
expectedZip, err := coderd.CreateZipFromTar(tarReader)
136+
expectedZip, err := fileszip.CreateZipFromTar(tarReader, 10240)
137137
require.NoError(t, err)
138138

139139
ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitLong)

coderd/fileszip.go

Lines changed: 0 additions & 112 deletions
This file was deleted.

0 commit comments

Comments
 (0)
0