2023-02-21 08:40:38 +03:00
|
|
|
package terraform_module_test_helper
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/gruntwork-io/terratest/modules/logger"
|
|
|
|
"github.com/gruntwork-io/terratest/modules/terraform"
|
|
|
|
)
|
|
|
|
|
|
|
|
var _ testExecutor = unitTestExecutor{}
|
|
|
|
|
|
|
|
type unitTestExecutor struct{}
|
|
|
|
|
|
|
|
func (u unitTestExecutor) TearDown(t *testing.T, rootDir string, modulePath string) {}
|
|
|
|
|
|
|
|
func (u unitTestExecutor) Logger() logger.TestLogger {
|
|
|
|
return logger.Discard
|
|
|
|
}
|
|
|
|
|
|
|
|
func RunUnitTest(t *testing.T, moduleRootPath, exampleRelativePath string, option terraform.Options, assertion func(*testing.T, TerraformOutput)) {
|
2023-07-28 08:07:12 +03:00
|
|
|
initAndApplyAndIdempotentTest(t, moduleRootPath, exampleRelativePath, option, true, true, assertion, unitTestExecutor{})
|
2023-02-21 08:40:38 +03:00
|
|
|
}
|