diff --git a/MAINTAINER.md b/MAINTAINER.md index 9959e59c..22326574 100644 --- a/MAINTAINER.md +++ b/MAINTAINER.md @@ -18,9 +18,9 @@ sudo apt install golang-go Check that PRs have: -- [ ] All required files (`main.tf`, `README.md`, at least one `.tftest.hcl`) +- [ ] All required files (`main.tf`, `main.test.ts`, `README.md`) - [ ] Proper frontmatter in README -- [ ] Working tests (`terraform test`) +- [ ] Working tests (`bun test`) - [ ] Formatted code (`bun run fmt`) - [ ] Avatar image for new namespaces (`avatar.png` or `avatar.svg` in `.images/`) diff --git a/package.json b/package.json index c2f9ff69..7ca9f2ec 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "fmt": "bun x prettier --write **/*.sh **/*.ts **/*.md *.md && terraform fmt -recursive -diff", "fmt:ci": "bun x prettier --check **/*.sh **/*.ts **/*.md *.md && terraform fmt -check -recursive -diff", "terraform-validate": "./scripts/terraform_validate.sh", - "test": "./scripts/terraform_test_all.sh", + "test": "bun test", "update-version": "./update-version.sh" }, "devDependencies": { diff --git a/registry/coder/modules/zed/zed.tftest.hcl b/registry/coder/modules/zed/zed.tftest.hcl deleted file mode 100644 index 508b6550..00000000 --- a/registry/coder/modules/zed/zed.tftest.hcl +++ /dev/null @@ -1,40 +0,0 @@ -run "default_output" { - command = apply - - variables { - agent_id = "foo" - } - - assert { - condition = output.zed_url == "zed://ssh/default.coder" - error_message = "zed_url did not match expected default URL" - } -} - -run "adds_folder" { - command = apply - - variables { - agent_id = "foo" - folder = "/foo/bar" - } - - assert { - condition = output.zed_url == "zed://ssh/default.coder/foo/bar" - error_message = "zed_url did not include provided folder path" - } -} - -run "adds_agent_name" { - command = apply - - variables { - agent_id = "foo" - agent_name = "myagent" - } - - assert { - condition = output.zed_url == "zed://ssh/myagent.default.default.coder" - error_message = "zed_url did not include agent_name in hostname" - } -} diff --git a/scripts/terraform_test_all.sh b/scripts/terraform_test_all.sh deleted file mode 100755 index 3ba9b5b9..00000000 --- a/scripts/terraform_test_all.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail - -# Find all directories that contain any .tftest.hcl files and run terraform test in each - -run_dir() { - local dir="$1" - echo "==> Running terraform test in $dir" - (cd "$dir" && terraform init -upgrade -input=false -no-color >/dev/null && terraform test -no-color -verbose) -} - -mapfile -t test_dirs < <(find . -type f -name "*.tftest.hcl" -print0 | xargs -0 -I{} dirname {} | sort -u) - -if [[ ${#test_dirs[@]} -eq 0 ]]; then - echo "No .tftest.hcl tests found." - exit 0 -fi - -status=0 -for d in "${test_dirs[@]}"; do - if ! run_dir "$d"; then - status=1 - fi -done - -exit $status