Skip to content

Commit e006963

Browse files
committed
fix windows hash
1 parent dc185b7 commit e006963

File tree

1 file changed

+1
-14
lines changed

1 file changed

+1
-14
lines changed

provisioner/terraform/modules_internal_test.go

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
11
package terraform
22

33
import (
4-
"archive/tar"
54
"bytes"
65
"crypto/sha256"
76
"encoding/hex"
8-
"errors"
9-
"fmt"
10-
"io"
117
"io/fs"
128
"os"
139
"path/filepath"
@@ -58,22 +54,13 @@ func TestGetModulesArchive(t *testing.T) {
5854
_, err = fs.ReadFile(tarfs, ".terraform/modules/stuff_that_should_not_be_included/nothing.txt")
5955
require.Error(t, err)
6056

61-
r := tar.NewReader(bytes.NewBuffer(archive))
62-
for {
63-
h, err := r.Next()
64-
if errors.Is(err, io.EOF) {
65-
break
66-
}
67-
fmt.Printf("- %v (%v) [%v:%v] %#v\n", h.Name, h.Size, h.Uid, h.Gid, h)
68-
}
69-
7057
// It should always be byte-identical to optimize storage
7158
hashBytes := sha256.Sum256(archive)
7259
hash := hex.EncodeToString(hashBytes[:])
7360
if runtime.GOOS != "windows" {
7461
require.Equal(t, "8491a8ab368f00a7eb0e927a957a3b0e4bf5df322c5b330d7b92b8b043a3d1d9", hash)
7562
} else {
76-
require.Equal(t, "c219943913051e4637527cd03ae2b7303f6945005a262cdd420f9c2af490d572", hash)
63+
require.Equal(t, "d15ae1791f19122a3ead806a225e1b79140432397b3543605505fe8b66e6ddf6", hash)
7764
}
7865
})
7966

0 commit comments

Comments
 (0)