Skip to content

Commit 0c41277

Browse files
committed
Remove files zip files generated by tests (#112)
1 parent 440022f commit 0c41277

File tree

4 files changed

+14
-3
lines changed

4 files changed

+14
-3
lines changed

internal/provider/archive-content.zip

-412 Bytes
Binary file not shown.

internal/provider/archive-dir.zip

-466 Bytes
Binary file not shown.

internal/provider/archive-file.zip

-166 Bytes
Binary file not shown.

internal/provider/zip_archiver_test.go

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ func TestZipArchiver_Content(t *testing.T) {
2525

2626
func TestZipArchiver_File(t *testing.T) {
2727
zipfilepath := "archive-file.zip"
28+
defer os.Remove(zipfilepath)
29+
2830
archiver := NewZipArchiver(zipfilepath)
2931
if err := archiver.ArchiveFile("./test-fixtures/test-file.txt"); err != nil {
3032
t.Fatalf("unexpected error: %s", err)
@@ -60,7 +62,7 @@ func TestZipArchiver_FileMode(t *testing.T) {
6062

6163
func TestZipArchiver_FileModified(t *testing.T) {
6264
var (
63-
zipFilePath = filepath.FromSlash("archive-file.zip")
65+
zipFilePath = filepath.FromSlash("archive-file-modified.zip")
6466
toZipPath = filepath.FromSlash("./test-fixtures/test-file.txt")
6567
)
6668

@@ -72,6 +74,7 @@ func TestZipArchiver_FileModified(t *testing.T) {
7274
}
7375

7476
zip()
77+
defer os.Remove(zipFilePath)
7578

7679
expectedContents, err := os.ReadFile(zipFilePath)
7780
if err != nil {
@@ -98,6 +101,8 @@ func TestZipArchiver_FileModified(t *testing.T) {
98101

99102
func TestZipArchiver_Dir(t *testing.T) {
100103
zipfilepath := "archive-dir.zip"
104+
defer os.Remove(zipfilepath)
105+
101106
archiver := NewZipArchiver(zipfilepath)
102107
if err := archiver.ArchiveDir("./test-fixtures/test-dir", []string{""}); err != nil {
103108
t.Fatalf("unexpected error: %s", err)
@@ -111,7 +116,9 @@ func TestZipArchiver_Dir(t *testing.T) {
111116
}
112117

113118
func TestZipArchiver_Dir_Exclude(t *testing.T) {
114-
zipfilepath := "archive-dir.zip"
119+
zipfilepath := "archive-dir-exclude.zip"
120+
defer os.Remove(zipfilepath)
121+
115122
archiver := NewZipArchiver(zipfilepath)
116123
if err := archiver.ArchiveDir("./test-fixtures/test-dir", []string{"file2.txt"}); err != nil {
117124
t.Fatalf("unexpected error: %s", err)
@@ -124,7 +131,9 @@ func TestZipArchiver_Dir_Exclude(t *testing.T) {
124131
}
125132

126133
func TestZipArchiver_Dir_Exclude_With_Directory(t *testing.T) {
127-
zipfilepath := "archive-dir.zip"
134+
zipfilepath := "archive-dir-exclude-dir.zip"
135+
defer os.Remove(zipfilepath)
136+
128137
archiver := NewZipArchiver(zipfilepath)
129138
if err := archiver.ArchiveDir("./test-fixtures/", []string{"test-dir", "test-dir2/file2.txt"}); err != nil {
130139
t.Fatalf("unexpected error: %s", err)
@@ -139,6 +148,8 @@ func TestZipArchiver_Dir_Exclude_With_Directory(t *testing.T) {
139148

140149
func TestZipArchiver_Multiple(t *testing.T) {
141150
zipfilepath := "archive-content.zip"
151+
defer os.Remove(zipfilepath)
152+
142153
content := map[string][]byte{
143154
"file1.txt": []byte("This is file 1"),
144155
"file2.txt": []byte("This is file 2"),

0 commit comments

Comments
 (0)