- Notifications
You must be signed in to change notification settings - Fork72
chore: update CONTRIBUTION docs to explain both tests, and update CI for both tests#384
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Open
DevelopmentCats wants to merge14 commits intomainChoose a base branch fromcat/contrib-docs-testing
base:main
Could not load branches
Branch not found:{{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline, and old review comments may become outdated.
+31 −22
Open
Changes from6 commits
Commits
Show all changes
14 commits Select commitHold shift + click to select a range
82d06f9
docs: update contribution guidelines for both module testing procedures
DevelopmentCats7469a6e
ci: add Terraform tests to CI workflow
DevelopmentCatsa7bad95
chore: bun run fmt
DevelopmentCats37cde45
chore: clarify module requirements
DevelopmentCats2a78dc8
chore: add wildcard to tftest.hcl
DevelopmentCats6a98f83
docs(contributing): clarify testing procedures and requirements
DevelopmentCats7cd4969
Apply suggestion from @matifali
matifali7f94259
Merge branch 'main' into cat/contrib-docs-testing
matifaliaf28c4f
Merge branch 'main' into cat/contrib-docs-testing
matifalid7e2892
Merge branch 'main' into cat/contrib-docs-testing
DevelopmentCats276c61a
Merge branch 'main' into cat/contrib-docs-testing
DevelopmentCats3920709
fix(examples): standardize module naming from MODULE_NAME to module_n…
DevelopmentCats7cefd58
chore: resolve index issue with claude-code tf test
DevelopmentCats32f2e05
Merge branch 'main' into cat/contrib-docs-testing
DevelopmentCatsFile filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
2 changes: 2 additions & 0 deletions.github/workflows/ci.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
24 changes: 16 additions & 8 deletionsCONTRIBUTING.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -124,18 +124,24 @@ This script generates: | ||
- Accurate description and usage examples | ||
- Correct icon path (usually `../../../../.icons/your-icon.svg`) | ||
- Proper tags that describe your module | ||
3. **Create tests for your module:** | ||
- **New modules**: Create `*.tftest.hcl` files and test with `terraform test` | ||
- **TypeScript tests**: Create `main.test.ts` files if your module runs scripts or has business logic that Terraform tests can't cover | ||
- **Both approaches** are supported | ||
matifali marked this conversation as resolved. OutdatedShow resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
4. **Add any scripts** or additional files your module needs | ||
### 4. Test and Submit | ||
```bash | ||
# Test your module | ||
cd registry/[namespace]/modules/[module-name] | ||
# Required: Test Terraform functionality | ||
terraform init -upgrade | ||
terraform test -verbose | ||
#Optional: Test TypeScript files if you have main.test.ts | ||
bun test main.test.ts | ||
# Format code | ||
bun run fmt | ||
@@ -343,8 +349,8 @@ coder templates push test-[template-name] -d . | ||
terraform init -upgrade | ||
terraform test -verbose | ||
#Optional: If you have TypeScript tests | ||
bun test main.test.ts | ||
``` | ||
### 3. Maintain Backward Compatibility | ||
@@ -393,7 +399,9 @@ Example: `https://github.com/coder/registry/compare/main...your-branch?template= | ||
### Every Module Must Have | ||
- `main.tf` - Terraform code | ||
- **Tests**: | ||
- `*.tftest.hcl` files with `terraform test` (to test terraform specific logic) | ||
- `main.test.ts` file with `bun test` (to test business logic, i.e., `coder_script` to install a package.) | ||
- `README.md` - Documentation with frontmatter | ||
### Every Template Must Have | ||
@@ -493,6 +501,6 @@ When reporting bugs, include: | ||
2. **No tests** or broken tests | ||
3. **Hardcoded values** instead of variables | ||
4. **Breaking changes** without defaults | ||
5. **Not running** formatting (`bun run fmt`) and tests (`terraform test`, and `bun test main.test.ts` if applicable) before submitting | ||
Happy contributing! 🚀 |
Oops, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.