Skip to content

Commit e0d0dc4

Browse files
authored
Merge branch 'main' into chore-updating-quick-start-guide
2 parents c8b5c09 + f2ca1f4 commit e0d0dc4

80 files changed

Lines changed: 682 additions & 2459 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

docs/_docs/01_getting-started/packages-overview.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,23 +18,19 @@ Terratest's [modules folder](https://github.com/gruntwork-io/terratest/tree/main
1818
| ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1919
| **aws** | Functions that make it easier to work with the AWS APIs. Examples: find an EC2 Instance by tag, get the IPs of EC2 Instances in an ASG, create an EC2 KeyPair, look up a VPC ID. |
2020
| **azure** | Functions that make it easier to work with the Azure APIs. Examples: get the size of a virtual machine, get the tags of a virtual machine. |
21-
| **collections** | Go doesn't have much of a collections library built-in, so this package has a few helper methods for working with lists and maps. Examples: subtract two lists from each other. |
2221
| **docker** | Functions that make it easier to work with Docker and Docker Compose. Examples: run `docker compose` commands. |
23-
| **environment** | Functions for interacting with os environment. Examples: check for first non empty environment variable in a list. |
2422
| **files** | Functions for manipulating files and folders. Examples: check if a file exists, copy a folder and all of its contents. |
2523
| **gcp** | Functions that make it easier to work with the GCP APIs. Examples: Add labels to a Compute Instance, get the Public IPs of an Instance, Get a list of Instances in a Managed Instance Group, Work with Storage Buckets and Objects. |
26-
| **git** | Functions for working with Git. Examples: get the name of the current Git branch. |
2724
| **helm** | Functions for working with Helm. Examples: Install a Helm chart. |
28-
| **http-helper** | Functions for making HTTP requests. Examples: make an HTTP request to a URL and check the status code and body contain the expected values, run a simple HTTP server locally. |
25+
| **httphelper** | Functions for making HTTP requests. Examples: make an HTTP request to a URL and check the status code and body contain the expected values, run a simple HTTP server locally. |
2926
| **k8s** | Functions that make it easier to work with Kubernetes. Examples: Getting the list of nodes in a cluster, waiting until all nodes in a cluster is ready. |
3027
| **logger** | A replacement for Go's `t.Log` and `t.Logf` that writes the logs to `stdout` immediately, rather than buffering them until the very end of the test. This makes debugging and iterating easier. |
3128
| **logger/parser** | Includes functions for parsing out interleaved go test output and piecing out the individual test logs. Used by the [terratest_log_parser](https://github.com/gruntwork-io/terratest/tree/main/cmd/terratest_log_parser) command. |
32-
| **oci** | Functions that make it easier to work with OCI. Examples: Getting the most recent image of a compartment + OS pair, deleting a custom image, retrieving a random subnet. |
3329
| **packer** | Functions for working with Packer. Examples: run a Packer build and return the ID of the artifact that was created. |
3430
| **random** | Functions for generating random data. Examples: generate a unique ID that can be used to namespace resources so multiple tests running in parallel don't clash. |
3531
| **retry** | Functions for retrying actions. Examples: retry a function up to a maximum number of retries, retry a function until a stop function is called, wait up to a certain timeout for a function to complete. These are especially useful when working with distributed systems and eventual consistency. |
3632
| **shell** | Functions to run shell commands. Examples: run a shell command and return its `stdout` and `stderr`. |
3733
| **ssh** | Functions to SSH to servers. Examples: SSH to a server, execute a command, and return `stdout` and `stderr`. |
3834
| **terraform** | Functions for working with Terraform. Examples: run `terraform init`, `terraform apply`, `terraform destroy`. |
3935
| **terragrunt** | Functions for working with Terragrunt. Examples: run `terragrunt apply --all`, `terragrunt destroy --all`, test stack configurations with dependencies, and work with Terragrunt stacks. |
40-
| **test_structure** | Functions for structuring your tests to speed up local iteration. Examples: break up your tests into stages so that any stage can be skipped by setting an environment variable. |
36+
| **teststructure** | Functions for structuring your tests to speed up local iteration. Examples: break up your tests into stages so that any stage can be skipped by setting an environment variable. |

docs/_docs/02_testing-best-practices/iterating-locally-using-test-stages.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ layout: collection-browser-doc
33
title: Iterating locally using test stages
44
category: testing-best-practices
55
excerpt: >-
6-
Learn more about Terratest's `test_structure`.
7-
tags: ["testing-best-practices", "test_structure"]
6+
Learn more about Terratest's `teststructure`.
7+
tags: ["testing-best-practices", "teststructure"]
88
order: 210
99
nav_title: Documentation
1010
nav_title_link: /docs/
@@ -21,7 +21,7 @@ Often, while testing locally, you'll want to re-run some subset of these stages
2121
might want to repeatedly run the validation step while you work out the kinks. Having to run _all_ of these stages
2222
each time you change a single line of code can be very slow.
2323

24-
This is where Terratest's `test_structure` package comes in handy: it allows you to explicitly break up your tests into
24+
This is where Terratest's `teststructure` package comes in handy: it allows you to explicitly break up your tests into
2525
stages and to be able to disable any one of those stages by setting an environment variable. Check out the
2626
[terraform_packer_example_test.go](https://github.com/gruntwork-io/terratest/blob/main/test/terraform_packer_example_test.go)
2727
for working sample code.

docs/_docs/03_migrating-to-v1/overview.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ warnings over the table when they disagree.
6161

6262
The Context migration is the single largest source of deprecation
6363
warnings you will see when upgrading. It touches nearly every helper
64-
package: `terraform`, `helm`, `dns-helper`, `http-helper`, `packer`,
64+
package: `terraform`, `helm`, `dnshelper`, `httphelper`, `packer`,
6565
`docker`, `ssh`, `oci`, `k8s`, `aws`, `azure`, `gcp`. The non-`Context`
6666
variants compile and behave the same as before; they just emit a
6767
`// Deprecated:` godoc warning.

docs/_docs/04_community/contributing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ Here are the guidelines for contributions with external tools:
6666
These are helper functions for creating, destroying, and validating infrastructure directly via API calls or SDKs.
6767
Examples:
6868

69-
* `http_helper.HTTPGetWithRetryContext`: make an HTTP request, retrying until you get a certain expected response.
69+
* `httphelper.HTTPGetWithRetryContext`: make an HTTP request, retrying until you get a certain expected response.
7070
* `ssh.CheckSSHCommandContext`: SSH to a server and execute a command.
7171
* `aws.CreateS3BucketContext`: create an S3 bucket.
7272
* `aws.GetPrivateIpsOfEc2InstancesContext`: use the AWS APIs to fetch IPs of some EC2 instances.

examples/terraform-asg-scp-example/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ aws.FetchFilesFromInstanceContext(t, ctx, awsRegion, sshUserName, keyPair, appSe
5050
Finally, to put all of this together, in your go test you could do something like:
5151

5252
```go
53-
defer test_structure.RunTestStage(t, "grab_logs", func() {
53+
defer teststructure.RunTestStage(t, "grab_logs", func() {
5454
if t.Failed() {
5555
takeElkMultiClusterLogSnapshot(t, examplesDir, awsRegion, "ubuntu")
5656
}

go.mod

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,14 @@ require (
2121
github.com/mattn/go-zglob v0.0.2-0.20190814121620-e3c945676326
2222
github.com/miekg/dns v1.1.62
2323
github.com/mitchellh/go-homedir v1.1.0 // indirect
24-
github.com/oracle/oci-go-sdk v7.1.0+incompatible
2524
github.com/pquerna/otp v1.4.0
2625
github.com/sirupsen/logrus v1.9.3
2726
github.com/stretchr/testify v1.11.1
2827
github.com/tmccombs/hcl2json v0.6.4
2928
github.com/urfave/cli v1.22.16
3029
github.com/zclconf/go-cty v1.15.0
31-
golang.org/x/crypto v0.49.0
32-
golang.org/x/net v0.52.0 // indirect
30+
golang.org/x/crypto v0.51.0
31+
golang.org/x/net v0.55.0 // indirect
3332
golang.org/x/oauth2 v0.36.0
3433
google.golang.org/api v0.276.0
3534
google.golang.org/genproto v0.0.0-20260319201613-d00831a3d3e7 // indirect
@@ -70,7 +69,7 @@ require (
7069
github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/azcertificates v1.4.0
7170
github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/azkeys v1.4.0
7271
github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/azsecrets v1.4.0
73-
github.com/aws/aws-sdk-go-v2 v1.41.6
72+
github.com/aws/aws-sdk-go-v2 v1.42.0
7473
github.com/aws/aws-sdk-go-v2/config v1.32.16
7574
github.com/aws/aws-sdk-go-v2/credentials v1.19.15
7675
github.com/aws/aws-sdk-go-v2/feature/s3/transfermanager v0.1.17
@@ -80,6 +79,7 @@ require (
8079
github.com/aws/aws-sdk-go-v2/service/dynamodb v1.57.2
8180
github.com/aws/aws-sdk-go-v2/service/ec2 v1.297.1
8281
github.com/aws/aws-sdk-go-v2/service/ecr v1.57.1
82+
github.com/aws/aws-sdk-go-v2/service/ecrpublic v1.39.6
8383
github.com/aws/aws-sdk-go-v2/service/ecs v1.78.1
8484
github.com/aws/aws-sdk-go-v2/service/iam v1.53.8
8585
github.com/aws/aws-sdk-go-v2/service/kms v1.50.5
@@ -92,14 +92,13 @@ require (
9292
github.com/aws/aws-sdk-go-v2/service/sqs v1.42.26
9393
github.com/aws/aws-sdk-go-v2/service/ssm v1.68.5
9494
github.com/aws/aws-sdk-go-v2/service/sts v1.42.0
95-
github.com/aws/smithy-go v1.25.0
95+
github.com/aws/smithy-go v1.27.1
9696
github.com/gonvenience/ytbx v1.4.4
9797
github.com/hashicorp/go-getter/v2 v2.2.3
9898
github.com/homeport/dyff v1.6.0
9999
github.com/jackc/pgx/v5 v5.9.0
100100
github.com/lib/pq v1.10.9
101101
github.com/microsoft/go-mssqldb v1.9.8
102-
github.com/slack-go/slack v0.23.1
103102
golang.org/x/sync v0.20.0
104103
google.golang.org/grpc v1.80.0
105104
gopkg.in/yaml.v3 v3.0.1
@@ -126,8 +125,8 @@ require (
126125
github.com/apparentlymart/go-textseg/v15 v15.0.0 // indirect
127126
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.9 // indirect
128127
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.22 // indirect
129-
github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.22 // indirect
130-
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.22 // indirect
128+
github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.29 // indirect
129+
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.29 // indirect
131130
github.com/aws/aws-sdk-go-v2/internal/v4a v1.4.23 // indirect
132131
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.8 // indirect
133132
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.9.14 // indirect
@@ -158,6 +157,7 @@ require (
158157
github.com/go-openapi/jsonpointer v0.21.0 // indirect
159158
github.com/go-openapi/jsonreference v0.20.2 // indirect
160159
github.com/go-openapi/swag v0.23.0 // indirect
160+
github.com/go-test/deep v1.1.1 // indirect
161161
github.com/golang-jwt/jwt/v5 v5.3.1 // indirect
162162
github.com/golang-sql/civil v0.0.0-20220223132316-b832511892a9 // indirect
163163
github.com/golang-sql/sqlexp v0.1.0 // indirect
@@ -222,12 +222,12 @@ require (
222222
go.opentelemetry.io/otel/trace v1.43.0 // indirect
223223
go.yaml.in/yaml/v2 v2.4.3 // indirect
224224
go.yaml.in/yaml/v3 v3.0.4 // indirect
225-
golang.org/x/mod v0.33.0 // indirect
226-
golang.org/x/sys v0.42.0 // indirect
227-
golang.org/x/term v0.41.0 // indirect
228-
golang.org/x/text v0.35.0 // indirect
225+
golang.org/x/mod v0.35.0 // indirect
226+
golang.org/x/sys v0.45.0 // indirect
227+
golang.org/x/term v0.43.0 // indirect
228+
golang.org/x/text v0.37.0 // indirect
229229
golang.org/x/time v0.15.0 // indirect
230-
golang.org/x/tools v0.42.0 // indirect
230+
golang.org/x/tools v0.44.0 // indirect
231231
google.golang.org/genproto/googleapis/api v0.0.0-20260401024825-9d38bb4040a9 // indirect
232232
google.golang.org/genproto/googleapis/rpc v0.0.0-20260401024825-9d38bb4040a9 // indirect
233233
google.golang.org/protobuf v1.36.12-0.20260120151049-f2248ac996af // indirect

0 commit comments

Comments
 (0)