Skip to content

Commit 7625df7

Browse files
authored
Added atmos tests run docs (#774)
1 parent d95df29 commit 7625df7

1 file changed

Lines changed: 35 additions & 4 deletions

File tree

docs/community/contribute/automated-testing.mdx

Lines changed: 35 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ All of our Terraform modules have automated tests. We have two sets of checks:
2828
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.
2929
Before committing and pushing your changes, you can and should run this set of checks locally by executing the following command on your host
3030
```
31-
make precommit/terraform
31+
pre-commit run --all-files
3232
```
3333
Running these checks locally incorporates all the required changes that otherwise would block your PR.
3434
</Step>
@@ -73,19 +73,50 @@ Here's a list a workflows you might want to trigger manually should things go wr
7373
- `scheduled` can be triggered anytime from GitHub UI, it has a *workflow_dispatch* trigger for this purpose.
7474
</Steps>
7575

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.
83+
84+
Setup dependencies:
85+
- Install Atmos ([installation guide](https://atmos.tools/install/))
86+
- 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+
76107
## ChatOps Configuration
77108

78109
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.
79110

80111
To initialize one of our modules with ChatOps, run the following commands:
81112

82113
<Steps>
114+
1. Install Atmos ([installation guide](https://atmos.tools/install/))
83115
1. `git clone` the terraform module repository
84116
1. `cd $repo` to enter the repository directory
85-
1. `make init` to initialize the build-harness
86117
1. `git add *` to add the changes
87118
1. Add the build badge to the `README.yaml` under the `badges` section.
88-
1. `make readme` to rebuild the `README.md` (remember, never edit the `README.md` manually since it's generated from the `README.yaml`)
119+
1. `atmos docs generate readme` to rebuild the `README.md` (remember, never edit the `README.md` manually since it's generated from the `README.yaml`)
89120
1. Open up a Pull Request with the changes. Here is a [good example](https://github.com/cloudposse/atmos/pull/555).
90121
1. Request a Code Review in the [`#pr-reviews`](https://slack.cloudposse.com) Slack channel (and *big* thanks for your contribution!)
91-
</Steps>
122+
</Steps>

0 commit comments

Comments
 (0)