Interview Prep/CI/CD/Testing and Quality Gates

How do you test infrastructure code in CI (Terraform, Helm, Kubernetes manifests)?

IntermediateConceptTesting and Quality Gates
Answer

Layered checks: formatting and syntax (terraform fmt -check, terraform validate, helm lint), schema validation (kubeconform), policy as code (Conftest/OPA, Checkov, Kyverno CLI), security scanning (tfsec/trivy config), a terraform plan posted to the PR, and for important modules integration tests (Terratest or terraform test) in a sandbox account.

All CI/CD questions Roadmap: CI/CD fundamentals

More on Testing and Quality Gates