Skip to content

Commit d2fbe95

Browse files
authored
Merge branch 'main' into packer-init-directory-templates
2 parents 90baae0 + ce2718b commit d2fbe95

40 files changed

Lines changed: 689 additions & 194 deletions

README.md

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
Terratest is a Go library that makes it easier to write automated tests for your infrastructure code. It provides a
99
variety of helper functions and patterns for common infrastructure testing tasks, including:
1010

11-
- Testing OpenTofu and Terraform code
11+
- Testing Terraform code
1212
- Testing Packer templates
1313
- Testing Docker images
1414
- Executing commands on servers over SSH
@@ -21,23 +21,6 @@ variety of helper functions and patterns for common infrastructure testing tasks
2121
- Running shell commands
2222
- And much more
2323

24-
## What Terratest is for
25-
26-
Terratest is a Go library for writing automated tests of infrastructure code. It covers five workflows that, together,
27-
let you test infrastructure end to end:
28-
29-
- **Deploy** OpenTofu, Terragrunt, Packer, or Docker from Go and capture their output.
30-
- **Inspect** what got deployed by calling cloud provider APIs (AWS, Azure, GCP, Kubernetes).
31-
- **Interact** with it over the network: SSH, HTTP, DNS, and database checks that cloud SDKs alone can't do.
32-
- **Validate** behavior and policy: OPA against OpenTofu plans, test-stage orchestration, retry-with-backoff for
33-
eventual consistency.
34-
- **Tear down** with `tofu destroy` and cleanup helpers.
35-
36-
Terratest is deliberately scoped. It is not a unit-testing framework (Go's standard `testing` covers that), a mocking
37-
library, a general-purpose utility collection, or a CI/notification tool. Helpers that fall outside the five workflows
38-
above, including ones the standard library already covers, are being deprecated and removed in v2. See
39-
[What Terratest is for](https://terratest.gruntwork.io/docs/getting-started/what-terratest-is-for/) for the full picture.
40-
4124
## Install
4225

4326
```bash
@@ -54,6 +37,10 @@ only happen in major releases (e.g. v2.0.0).
5437
Symbols renamed or replaced in v1 are kept with `// Deprecated:` annotations pointing at the new name; removals happen
5538
in v2. Migrating from v0.x: see the [v1 migration guide](https://terratest.gruntwork.io/docs/migrating-to-v1/overview/).
5639

40+
**v1 maintenance.** With v2 in development, the v1 line has entered maintenance: it receives security fixes only,
41+
delivered on the `v1` branch, until 12 months after v2.0.0 reaches general availability. v2 ships under new `/v2`
42+
module paths, so pinned v1 consumers are unaffected. Upgrade on your own schedule.
43+
5744
## More info
5845

5946
- [Terratest Website](https://terratest.gruntwork.io)

docs/Gemfile.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ GEM
3737
ffi (>= 1.3.0)
3838
eventmachine (1.2.7)
3939
execjs (2.7.0)
40-
faraday (2.14.2)
40+
faraday (2.14.3)
4141
faraday-net_http (>= 2.0, < 3.5)
4242
json
4343
logger
44-
faraday-net_http (3.4.2)
44+
faraday-net_http (3.4.4)
4545
net-http (~> 0.5)
4646
ffi (1.13.1)
4747
forwardable-extended (2.6.0)
@@ -213,7 +213,7 @@ GEM
213213
gemoji (~> 3.0)
214214
html-pipeline (~> 2.2)
215215
jekyll (>= 3.0, < 5.0)
216-
json (2.19.5)
216+
json (2.20.0)
217217
kramdown (2.3.2)
218218
rexml
219219
kramdown-parser-gfm (1.1.0)

docs/_docs/01_getting-started/examples.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ excerpt: Examples are the best way to start testing Terraform, Docker, Packer, K
55
tags: ["example"]
66
redirect_to:
77
- /examples/
8-
order: 103
8+
order: 102
99
nav_title: Documentation
1010
nav_title_link: /docs/
1111
---

docs/_docs/01_getting-started/godoc.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ tags: ["packages"]
88
redirect_to:
99
- https://godoc.org/github.com/gruntwork-io/terratest
1010
target_blank: true
11-
order: 105
11+
order: 104
1212
nav_title: Documentation
1313
nav_title_link: /docs/
1414
---

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

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,29 +3,27 @@ layout: collection-browser-doc
33
title: Package by package overview
44
category: getting-started
55
excerpt: >-
6-
Learn more about Terratest modules and how they can help you test different types of infrastructure.
6+
Learn more about Terratest modules and how they can help you test different types infrastructure.
77
tags: ["packages"]
8-
order: 104
8+
order: 103
99
nav_title: Documentation
1010
nav_title_link: /docs/
1111
---
1212

1313
Now that you've had a chance to browse the examples and their tests, here's an overview of the packages you'll find in
14-
Terratest's [modules folder](https://github.com/gruntwork-io/terratest/tree/main/modules) and how they can help you test different types of infrastructure:
15-
16-
Some packages are **deprecated** and scheduled for removal in v2 because they fall outside [what Terratest is for]({{ site.baseurl }}/docs/getting-started/what-terratest-is-for/) (for example, helpers the Go standard library already covers). They keep working for the rest of v1; their GoDoc points at the recommended replacement.
14+
Terratest's [modules folder](https://github.com/gruntwork-io/terratest/tree/main/modules) and how they can help you test different types infrastructure:
1715

1816
{:.doc-styled-table}
1917
| Package | Description |
2018
| ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
2119
| **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. |
2220
| **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. |
23-
| **collections** | _Deprecated (removed in v2): use the standard library `slices`/`strings`._ A few helper methods for working with lists. Examples: subtract two lists from each other. |
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. |
2422
| **docker** | Functions that make it easier to work with Docker and Docker Compose. Examples: run `docker compose` commands. |
25-
| **environment** | _Deprecated (removed in v2): use the standard library `os.Getenv`._ Functions for interacting with os environment. Examples: check for first non empty environment variable in a list. |
23+
| **environment** | Functions for interacting with os environment. Examples: check for first non empty environment variable in a list. |
2624
| **files** | Functions for manipulating files and folders. Examples: check if a file exists, copy a folder and all of its contents. |
2725
| **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. |
28-
| **git** | _Deprecated (removed in v2): shell out to `git` with `os/exec`._ Functions for working with Git. Examples: get the name of the current Git branch. |
26+
| **git** | Functions for working with Git. Examples: get the name of the current Git branch. |
2927
| **helm** | Functions for working with Helm. Examples: Install a Helm chart. |
3028
| **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. |
3129
| **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. |
@@ -36,9 +34,7 @@ Some packages are **deprecated** and scheduled for removal in v2 because they fa
3634
| **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. |
3735
| **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. |
3836
| **shell** | Functions to run shell commands. Examples: run a shell command and return its `stdout` and `stderr`. |
39-
| **slack** | _Deprecated (removed in v2): use the slack-go client directly._ Functions for validating Slack messages posted during a test. |
4037
| **ssh** | Functions to SSH to servers. Examples: SSH to a server, execute a command, and return `stdout` and `stderr`. |
41-
| **terraform** | Functions for working with OpenTofu and Terraform. Examples: run `init`, `apply`, and `destroy`. |
38+
| **terraform** | Functions for working with Terraform. Examples: run `terraform init`, `terraform apply`, `terraform destroy`. |
4239
| **terragrunt** | Functions for working with Terragrunt. Examples: run `terragrunt apply --all`, `terragrunt destroy --all`, test stack configurations with dependencies, and work with Terragrunt stacks. |
4340
| **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. |
44-
| **version-checker** | _Deprecated (removed in v2): shell out to check a binary's version yourself._ Functions for checking a binary's version against a constraint. |

docs/_docs/01_getting-started/quick-start.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ title: Quick start
44
category: getting-started
55
excerpt: Learn how to start with Terratest.
66
tags: ["quick-start"]
7-
order: 102
7+
order: 101
88
nav_title: Documentation
99
nav_title_link: /docs/
1010
custom_js:

docs/_docs/01_getting-started/testing-terragrunt.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ category: getting-started
55
excerpt: >-
66
Learn how to test Terragrunt configurations with Terratest.
77
tags: ["terragrunt", "testing", "quick-start"]
8-
order: 106
8+
order: 105
99
nav_title: Documentation
1010
nav_title_link: /docs/
1111
---

docs/_docs/01_getting-started/version-pinning.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ title: Pinning a Terratest version
44
category: getting-started
55
excerpt: Lock your tests to a specific Terratest release.
66
tags: ["versioning", "go-modules", "pinning"]
7-
order: 107
7+
order: 106
88
nav_title: Documentation
99
nav_title_link: /docs/
1010
---

docs/_docs/01_getting-started/what-terratest-is-for.md

Lines changed: 0 additions & 59 deletions
This file was deleted.

0 commit comments

Comments
 (0)