mirror of
https://github.com/coder/registry.git
synced 2026-06-06 22:48:15 +00:00
45b72c7241
## Summary - Introduces Terraform native tests (`terraform test`) alongside existing Bun tests - Migrates tests for modules: jetbrains, zed, and code-server - Removes Bun test files for these migrated modules only - Adds repo-wide test runner script for Terraform tests - Updates docs and new-module sample to reflect Terraform tests ## Transition plan - Mixed mode: Other modules retain Bun tests; CI should run both Bun and Terraform tests temporarily - Follow the linked epic to migrate remaining modules ## Test plan - Run: `./scripts/terraform_test_all.sh` (passes locally) - Bun tests still available for non-migrated modules ## Affected paths - registry/coder/modules/jetbrains/jetbrains.tftest.hcl - registry/coder/modules/zed/zed.tftest.hcl - registry/coder/modules/code-server/code-server.tftest.hcl - scripts/terraform_test_all.sh - examples/modules/MODULE_NAME.tftest.hcl - CONTRIBUTING.md Contributes to #308
51 lines
886 B
HCL
51 lines
886 B
HCL
run "required_vars" {
|
|
command = plan
|
|
|
|
variables {
|
|
agent_id = "foo"
|
|
}
|
|
}
|
|
|
|
run "offline_and_use_cached_conflict" {
|
|
command = plan
|
|
|
|
variables {
|
|
agent_id = "foo"
|
|
use_cached = true
|
|
offline = true
|
|
}
|
|
|
|
expect_failures = [
|
|
resource.coder_script.code-server
|
|
]
|
|
}
|
|
|
|
run "offline_disallows_extensions" {
|
|
command = plan
|
|
|
|
variables {
|
|
agent_id = "foo"
|
|
offline = true
|
|
extensions = ["ms-python.python", "golang.go"]
|
|
}
|
|
|
|
expect_failures = [
|
|
resource.coder_script.code-server
|
|
]
|
|
}
|
|
|
|
run "url_with_folder_query" {
|
|
command = plan
|
|
|
|
variables {
|
|
agent_id = "foo"
|
|
folder = "/home/coder/project"
|
|
port = 13337
|
|
}
|
|
|
|
assert {
|
|
condition = resource.coder_app.code-server.url == "http://localhost:13337/?folder=%2Fhome%2Fcoder%2Fproject"
|
|
error_message = "coder_app URL must include encoded folder query param"
|
|
}
|
|
}
|