You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+1-24Lines changed: 1 addition & 24 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -80,30 +80,7 @@ We have two types of tests:
80
80
81
81
We use Go's built-in [package testing](https://golang.org/pkg/testing/) for tests. Therefore, simply create a file ending in `_test.go` and write your test.
returnoutput, rand, ao, fmt.Errorf("Test failed because the S3 Bucket '%s' does not exist in the '%s' region.\n", ao.TfRemoteStateS3BucketName, ao.TfRemoteStateS3BucketRegion)
21
+
returnoutput, fmt.Errorf("Test failed because the S3 Bucket '%s' does not exist in the '%s' region.\n", ao.TfRemoteStateS3BucketName, ao.TfRemoteStateS3BucketRegion)
returnoutput, fmt.Errorf("Test failed because the S3 Bucket '%s' does not exist in the '%s' region.\n", ao.TfRemoteStateS3BucketName, ao.TfRemoteStateS3BucketRegion)
Copy file name to clipboardExpand all lines: apply_options.go
+4-2Lines changed: 4 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -2,10 +2,12 @@ package terratest
2
2
3
3
// The options to be passed into any terratest.Apply or Destroy function
4
4
typeApplyOptionsstruct {
5
+
UniqueIdstring// A unique identifier for this terraform run.
5
6
TestNamestring// the name of the test to run, for logging purposes.
6
7
TemplatePathstring// the relative or absolute path to the terraform template to be applied.
7
8
Varsmap[string]string// the vars to pass to the terraform template.
8
9
AttemptTerraformRetrybool// if true, if a known error message occurs, automatically attempt a retry.
10
+
RetryableTerraformErrorsmap[string]string// a map of error messages which we expect on this template and which should invoke a second terraform apply, along with an additional message offering details on this error text.
9
11
TfRemoteStateS3BucketNamestring// S3 bucket name where terraform.tfstate files should be stored for running any terraform runs. Bucket should already exist.
10
12
TfRemoteStateS3BucketRegionstring// AWS Region where the TfRemoteStateS3BucketName exists.
logger.Printf("Terraform apply failed with the error '%s'. %s\n", TF_ERROR_DIFFS_DIDNT_MATCH_DURING_APPLY, TF_ERROR_DIFFS_DIDNT_MATCH_DURING_APPLY_MSG)
logger.Printf("Terraform apply failed with the error '%s'. %s\n", TF_ERROR_EIP_DOES_NOT_HAVE_ATTRIBUTE_ID, TF_ERROR_EIP_DOES_NOT_HAVE_ATTRIBUTE_ID_MSG)
// Check for terraform errors that are specific to this template.
49
+
forerrorText, errorTextMsg:=rangeerrors {
50
+
ifstrings.Contains(output, errorText) {
51
+
logger.Printf("Terraform apply failed with the error '%s' but this error was expected and warrants a terraform apply retry. Further details: %s\n", errorText, errorTextMsg)
0 commit comments