Skip to content

Commit ab5ff4b

Browse files
committed
Revert "chore(test): add terraform tests for jetbrains, zed, code-server and keep mixed mode"
This reverts commit fb657b8.
1 parent f5a68b5 commit ab5ff4b

File tree

6 files changed

+1150
-197
lines changed

6 files changed

+1150
-197
lines changed

CONTRIBUTING.md

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ The Coder Registry is a collection of Terraform modules and templates for Coder
2020

2121
- Basic Terraform knowledge (for module development)
2222
- Terraform installed ([installation guide](https://developer.hashicorp.com/terraform/install))
23-
- Docker (for some modules' tests that rely on containers)
23+
- Docker (for running tests)
2424

25-
### Install Dependencies (for formatting and scripts)
25+
### Install Dependencies
2626

2727
Install Bun:
2828

@@ -124,21 +124,17 @@ 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 `main.test.ts`** to test your module
128128
4. **Add any scripts** or additional files your module needs
129129

130130
### 4. Test and Submit
131131

132132
```bash
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
133+
# Test your module
134+
bun test -t 'module-name'
139135

140136
# Format code
141-
bun run fmt
137+
bun fmt
142138

143139
# Commit and create PR
144140
git add .
@@ -339,12 +335,11 @@ coder templates push test-[template-name] -d .
339335
### 2. Test Your Changes
340336

341337
```bash
342-
# Test a specific module (from the module directory)
343-
terraform init -upgrade
344-
terraform test -verbose
338+
# Test a specific module
339+
bun test -t 'module-name'
345340

346341
# Test all modules
347-
./scripts/terraform_test_all.sh
342+
bun test
348343
```
349344

350345
### 3. Maintain Backward Compatibility
@@ -393,7 +388,7 @@ Example: `https://github.com/coder/registry/compare/main...your-branch?template=
393388
### Every Module Must Have
394389

395390
- `main.tf` - Terraform code
396-
- One or more `.tftest.hcl` files - Working tests with `terraform test`
391+
- `main.test.ts` - Working tests
397392
- `README.md` - Documentation with frontmatter
398393

399394
### Every Template Must Have
@@ -493,6 +488,6 @@ When reporting bugs, include:
493488
2. **No tests** or broken tests
494489
3. **Hardcoded values** instead of variables
495490
4. **Breaking changes** without defaults
496-
5. **Not running** formatting (`bun run fmt`) and tests (`terraform test`) before submitting
491+
5. **Not running** `bun fmt` before submitting
497492

498493
Happy contributing! 🚀

registry/coder/modules/code-server/code-server.tftest.hcl

Lines changed: 0 additions & 50 deletions
This file was deleted.
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import { describe, expect, it } from "bun:test";
2+
import {
3+
runTerraformApply,
4+
runTerraformInit,
5+
testRequiredVariables,
6+
} from "~test";
7+
8+
describe("code-server", async () => {
9+
await runTerraformInit(import.meta.dir);
10+
11+
testRequiredVariables(import.meta.dir, {
12+
agent_id: "foo",
13+
});
14+
15+
it("use_cached and offline can not be used together", () => {
16+
const t = async () => {
17+
await runTerraformApply(import.meta.dir, {
18+
agent_id: "foo",
19+
use_cached: "true",
20+
offline: "true",
21+
});
22+
};
23+
expect(t).toThrow("Offline and Use Cached can not be used together");
24+
});
25+
26+
it("offline and extensions can not be used together", () => {
27+
const t = async () => {
28+
await runTerraformApply(import.meta.dir, {
29+
agent_id: "foo",
30+
offline: "true",
31+
extensions: '["1", "2"]',
32+
});
33+
};
34+
expect(t).toThrow("Offline mode does not allow extensions to be installed");
35+
});
36+
37+
// More tests depend on shebang refactors
38+
});

registry/coder/modules/jetbrains/jetbrains.tftest.hcl

Lines changed: 0 additions & 131 deletions
This file was deleted.

0 commit comments

Comments
 (0)