## 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
22 lines
401 B
HCL
22 lines
401 B
HCL
run "plan_with_required_vars" {
|
|
command = plan
|
|
|
|
variables {
|
|
agent_id = "example-agent-id"
|
|
}
|
|
}
|
|
|
|
run "app_url_uses_port" {
|
|
command = plan
|
|
|
|
variables {
|
|
agent_id = "example-agent-id"
|
|
port = 19999
|
|
}
|
|
|
|
assert {
|
|
condition = resource.coder_app.MODULE_NAME.url == "http://localhost:19999"
|
|
error_message = "Expected MODULE_NAME app URL to include configured port"
|
|
}
|
|
}
|