Add BATS test suite for k3d-dev.sh and lefthook git hooks
Why
k3d-dev.sh is the primary script Big Bang developers use to stand up local dev clusters, but it has zero automated test coverage today. It's ~1,500 lines of bash with complex argument parsing, domain configuration, and cloud provisioning logic - exactly the kind of code where silent regressions hide until someone's dev environment breaks.
Adding BATS tests lets us catch those regressions early. Starting with pure functions (argument parsing, domain config, kubeconfig path derivation) gives us meaningful coverage without needing live AWS credentials or SSH connections. Lefthook makes it easy for contributors to run these tests locally as part of their normal git workflow - opt-in, zero config beyond lefthook install.
What
- 18 BATS tests covering argument parsing, domain config, kubeconfig path derivation, and the batch-file error guard
- lefthook.yaml for opt-in pre-commit / pre-push hooks
-
.gitattributes for Bash syntax highlighting of
.batsfiles in GitLab
Part of the multi-step plan in big-bang/pipeline-templates/pipeline-templates#912 (closed).