@@ -24,7 +24,7 @@ The Coder Registry is a collection of Terraform modules and templates for Coder
24
24
25
25
### Install Dependencies
26
26
27
- Install Bun:
27
+ Install Bun (for formatting and scripts) :
28
28
29
29
``` bash
30
30
curl -fsSL https://bun.sh/install | bash
@@ -124,19 +124,23 @@ This script generates:
124
124
- Accurate description and usage examples
125
125
- Correct icon path (usually ` ../../../../.icons/your-icon.svg ` )
126
126
- Proper tags that describe your module
127
- 3 . ** Create ` main.test.ts ` ** to test your module
127
+ 3 . ** Create at least one ` .tftest.hcl ` ** to test your module with ` terraform test `
128
128
4 . ** Add any scripts** or additional files your module needs
129
129
130
130
### 4. Test and Submit
131
131
132
132
``` bash
133
- # Test your module
134
- bun test -t ' module-name'
133
+ # Test your module (from the module directory)
134
+ terraform init -upgrade
135
+ terraform test -verbose
136
+
137
+ # Or run all tests in the repo
138
+ ./scripts/terraform_test_all.sh
135
139
136
140
# Format code
137
- bun fmt
141
+ bun run fmt
138
142
139
- # Commit and create PR
143
+ # Commit and create PR (do not push to main directly)
140
144
git add .
141
145
git commit -m " Add [module-name] module"
142
146
git push origin your-branch
@@ -335,11 +339,12 @@ coder templates push test-[template-name] -d .
335
339
### 2. Test Your Changes
336
340
337
341
``` bash
338
- # Test a specific module
339
- bun test -t ' module-name'
342
+ # Test a specific module (from the module directory)
343
+ terraform init -upgrade
344
+ terraform test -verbose
340
345
341
346
# Test all modules
342
- bun test
347
+ ./scripts/terraform_test_all.sh
343
348
```
344
349
345
350
### 3. Maintain Backward Compatibility
@@ -388,7 +393,7 @@ Example: `https://github.com/coder/registry/compare/main...your-branch?template=
388
393
### Every Module Must Have
389
394
390
395
- ` main.tf ` - Terraform code
391
- - ` main.test.ts ` - Working tests
396
+ - One or more ` .tftest.hcl ` files - Working tests with ` terraform test `
392
397
- ` README.md ` - Documentation with frontmatter
393
398
394
399
### Every Template Must Have
@@ -488,6 +493,6 @@ When reporting bugs, include:
488
493
2 . ** No tests** or broken tests
489
494
3 . ** Hardcoded values** instead of variables
490
495
4 . ** Breaking changes** without defaults
491
- 5 . ** Not running** ` bun fmt ` before submitting
496
+ 5 . ** Not running** formatting ( ` bun run fmt ` ) and tests ( ` terraform test ` ) before submitting
492
497
493
498
Happy contributing! 🚀
0 commit comments