Skip to content

Commit 82d06f9

Browse files
docs: update contribution guidelines for both module testing procedures
1 parent 94d9381 commit 82d06f9

File tree

1 file changed

+17
-6
lines changed

1 file changed

+17
-6
lines changed

CONTRIBUTING.md

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -124,18 +124,27 @@ This script generates:
124124
- Accurate description and usage examples
125125
- Correct icon path (usually `../../../../.icons/your-icon.svg`)
126126
- Proper tags that describe your module
127-
3. **Create at least one `.tftest.hcl`** to test your module with `terraform test`
127+
3. **Create tests for your module:**
128+
- **New modules**: Create `.tftest.hcl` files and test with `terraform test`
129+
- **Existing modules**: Keep `main.test.ts` files and test with `bun test`
130+
- **Both approaches** are supported
128131
4. **Add any scripts** or additional files your module needs
129132

130133
### 4. Test and Submit
131134

132135
```bash
133-
# Test your module (from the module directory)
136+
# Test your module
137+
# For new modules with .tftest.hcl:
138+
cd registry/[namespace]/modules/[module-name]
134139
terraform init -upgrade
135140
terraform test -verbose
136141

137-
# Or run all tests in the repo
138-
./scripts/terraform_test_all.sh
142+
# For existing modules with main.test.ts:
143+
bun test registry/[namespace]/modules/[module-name]
144+
145+
# Run all tests in the repo
146+
bun test # All TypeScript tests
147+
./scripts/terraform_test_all.sh # All Terraform tests
139148

140149
# Format code
141150
bun run fmt
@@ -393,7 +402,9 @@ Example: `https://github.com/coder/registry/compare/main...your-branch?template=
393402
### Every Module Must Have
394403

395404
- `main.tf` - Terraform code
396-
- One or more `.tftest.hcl` files - Working tests with `terraform test`
405+
- **Tests** (choose one):
406+
- `.tftest.hcl` files with `terraform test` (preferred for new modules)
407+
- `main.test.ts` file with `bun test` (existing modules)
397408
- `README.md` - Documentation with frontmatter
398409

399410
### Every Template Must Have
@@ -493,6 +504,6 @@ When reporting bugs, include:
493504
2. **No tests** or broken tests
494505
3. **Hardcoded values** instead of variables
495506
4. **Breaking changes** without defaults
496-
5. **Not running** formatting (`bun run fmt`) and tests (`terraform test`) before submitting
507+
5. **Not running** formatting (`bun run fmt`) and tests (`bun test` or `terraform test`) before submitting
497508

498509
Happy contributing! 🚀

0 commit comments

Comments
 (0)