mirror of
https://github.com/opentffoundation/opentf.git
synced 2025-12-19 17:59:05 -05:00
Fix passing wrong file info & Add test coverage
This commit is contained in:
committed by
Kristin Laemmert
parent
6ecee4e1d6
commit
6d4e02ee42
@@ -125,6 +125,9 @@ func TestPackage_manyProviders(t *testing.T) {
|
|||||||
|
|
||||||
for _, file := range read.File {
|
for _, file := range read.File {
|
||||||
if _, exists := expectedFiles[file.Name]; exists {
|
if _, exists := expectedFiles[file.Name]; exists {
|
||||||
|
if !file.FileInfo().Mode().IsRegular() {
|
||||||
|
t.Errorf("Expected file is not a regular file: %s", file.Name)
|
||||||
|
}
|
||||||
delete(expectedFiles, file.Name)
|
delete(expectedFiles, file.Name)
|
||||||
} else {
|
} else {
|
||||||
extraFiles[file.Name] = struct{}{}
|
extraFiles[file.Name] = struct{}{}
|
||||||
@@ -195,6 +198,9 @@ func TestPackage_localProviders(t *testing.T) {
|
|||||||
|
|
||||||
for _, file := range read.File {
|
for _, file := range read.File {
|
||||||
if _, exists := expectedFiles[file.Name]; exists {
|
if _, exists := expectedFiles[file.Name]; exists {
|
||||||
|
if !file.FileInfo().Mode().IsRegular() {
|
||||||
|
t.Errorf("Expected file is not a regular file: %s", file.Name)
|
||||||
|
}
|
||||||
delete(expectedFiles, file.Name)
|
delete(expectedFiles, file.Name)
|
||||||
} else {
|
} else {
|
||||||
extraFiles[file.Name] = struct{}{}
|
extraFiles[file.Name] = struct{}{}
|
||||||
|
|||||||
@@ -226,7 +226,7 @@ func (c *PackageCommand) Run(args []string) int {
|
|||||||
return addZipFile(
|
return addZipFile(
|
||||||
filepath.Join(linkPath, file.Name()), // the link to this provider binary
|
filepath.Join(linkPath, file.Name()), // the link to this provider binary
|
||||||
filepath.Join(relPath, file.Name()), // the expected directory for the binary
|
filepath.Join(relPath, file.Name()), // the expected directory for the binary
|
||||||
info, outZ,
|
file, outZ,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user