1
0
mirror of synced 2025-12-19 18:05:44 -05:00
Files
terraform-google-sql/test/validation/validate_all_modules_and_examples_test.go
2021-07-14 13:01:51 -04:00

26 lines
736 B
Go

package testvalidate
import (
"os"
"path/filepath"
"testing"
test_structure "github.com/gruntwork-io/terratest/modules/test-structure"
"github.com/stretchr/testify/require"
)
// TestValidateAllTerraformModulesAndExamples recursively finds all modules and examples (by default) subdirectories in
// the repo and runs Terraform InitAndValidate on them to flush out missing variables, typos, unused vars, etc
func TestValidateAllTerraformModulesAndExamples(t *testing.T) {
t.Parallel()
cwd, err := os.Getwd()
require.NoError(t, err)
opts, optsErr := test_structure.NewValidationOptions(filepath.Join(cwd, "../.."), []string{}, []string{})
require.NoError(t, optsErr)
test_structure.ValidateAllTerraformModules(t, opts)
}