Skip to content

Commit b747d74

Browse files
committed
put the debugging back :|
1 parent a92e371 commit b747d74

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

provisioner/terraform/modules_internal_test.go

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

33
import (
4+
"archive/tar"
45
"bytes"
56
"crypto/sha256"
67
"encoding/hex"
8+
"errors"
9+
"fmt"
10+
"io"
711
"io/fs"
812
"os"
913
"path/filepath"
@@ -54,6 +58,15 @@ func TestGetModulesArchive(t *testing.T) {
5458
_, err = fs.ReadFile(tarfs, ".terraform/modules/stuff_that_should_not_be_included/nothing.txt")
5559
require.Error(t, err)
5660

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+
5770
// It should always be byte-identical to optimize storage
5871
hashBytes := sha256.Sum256(archive)
5972
hash := hex.EncodeToString(hashBytes[:])

0 commit comments

Comments
 (0)