File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed
Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change 1+ // Managed By : CloudDrove
2+ // Description : This Terratest is used to test the Terraform Labels module.
3+ // Copyright @ CloudDrove. All Right Reserved.
4+ package test
5+
6+ import (
7+ "github.com/gruntwork-io/terratest/modules/terraform"
8+ "github.com/stretchr/testify/assert"
9+ "testing"
10+ )
11+
12+ func Test (t * testing.T ) {
13+ t .Parallel ()
14+
15+ terraformOptions := & terraform.Options {
16+ // Source path of Terraform directory.
17+ TerraformDir : "../_example" ,
18+ Upgrade : true ,
19+ }
20+
21+ // This will run 'terraform init' and 'terraform application' and will fail the test if any errors occur
22+ terraform .InitAndApply (t , terraformOptions )
23+
24+ // To clean up any resources that have been created, run 'terraform destroy' towards the end of the test
25+ defer terraform .Destroy (t , terraformOptions )
26+
27+ // To get the value of an output variable, run 'terraform output'
28+ Tags := terraform .OutputMap (t , terraformOptions , "tags" )
29+
30+ // Check that we get back the outputs that we expect
31+ assert .Equal (t , "labels-test-private" , Tags ["Name" ])
32+ }
You can’t perform that action at this time.
0 commit comments