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: docs/community/contribute/automated-testing.mdx
+35-4Lines changed: 35 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,7 +28,7 @@ All of our Terraform modules have automated tests. We have two sets of checks:
28
28
This workflow generates some documentation and performs basic sanity checks, including linting and formatting. These checks are lightweight and can be executed without requiring any special permissions. Consequently, they *are automatically run* on every commit.
29
29
Before committing and pushing your changes, you can and should run this set of checks locally by executing the following command on your host
30
30
```
31
-
make precommit/terraform
31
+
pre-commit run --all-files
32
32
```
33
33
Running these checks locally incorporates all the required changes that otherwise would block your PR.
34
34
</Step>
@@ -73,19 +73,50 @@ Here's a list a workflows you might want to trigger manually should things go wr
73
73
-`scheduled` can be triggered anytime from GitHub UI, it has a *workflow_dispatch* trigger for this purpose.
74
74
</Steps>
75
75
76
+
## Running Terraform Tests locally
77
+
78
+
We use [Atmos](https://atmos.tools) to streamline how Terraform tests are run. It centralizes configuration and wraps common test workflows with easy-to-use commands.
79
+
80
+
All tests are located in the `test/` folder.
81
+
82
+
Under the hood, tests are powered by Terratest together with our internal [Test Helpers](https://github.com/cloudposse/test-helpers) library, providing robust infrastructure validation.
- Install Go [1.24+ or newer](https://go.dev/doc/install)
87
+
- Install Terraform or OpenTofu
88
+
89
+
To run tests:
90
+
91
+
- Run all tests:
92
+
```sh
93
+
atmos test run
94
+
```
95
+
- Clean up test artifacts:
96
+
```sh
97
+
atmos test clean
98
+
```
99
+
- Explore additional test options:
100
+
```sh
101
+
atmos test --help
102
+
```
103
+
The configuration for test commands is centrally managed. To review what's being imported, see the [`atmos.yaml`](https://raw.githubusercontent.com/cloudposse/.github/refs/heads/main/.github/atmos/terraform-module.yaml) file.
104
+
105
+
Learn more about implementing [custom commands](https://atmos.tools/core-concepts/custom-commands/) with atmos.
106
+
76
107
## ChatOps Configuration
77
108
78
109
If you're a contributor who wants to initialize one of our terraform modules, this is the process. Note, if a repo has already been configured for ChatOps, there's no need to proceed with these steps.
79
110
80
111
To initialize one of our modules with ChatOps, run the following commands:
0 commit comments