-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Copy validated Terraform to /tmp to avoid conflict #935
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package terraform | ||
package test_structure | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. NIT: Mention in the function docs that this is here instead of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. NIT: This file should probably still be called |
||
|
||
import ( | ||
"fmt" | ||
|
@@ -7,6 +7,7 @@ import ( | |
|
||
go_commons_collections "github.com/gruntwork-io/go-commons/collections" | ||
"github.com/gruntwork-io/terratest/modules/collections" | ||
"github.com/gruntwork-io/terratest/modules/files" | ||
"github.com/mattn/go-zglob" | ||
) | ||
|
||
|
@@ -96,7 +97,10 @@ func FindTerraformModulePathsInRootE(opts *ValidationOptions) ([]string, error) | |
// The glob match returns all full paths to every .tf file, whereas we're only interested in their root | ||
// directories for the purposes of running Terraform validate | ||
rootDir := path.Dir(match) | ||
terraformDirSet[rootDir] = "exists" | ||
// Don't include hidden .terraform directories when finding paths to validate | ||
if !files.PathContainsHiddenFileOrFolder(rootDir) { | ||
terraformDirSet[rootDir] = "exists" | ||
} | ||
} | ||
|
||
// Retrieve just the unique paths to each Terraform module directory from the map we're using as a set | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NIT: Mention that the this is here instead of
terraform
module to avoid import cycling.