Two known methods for writing helm unit tests:
One is using simple bash scripts to do a helm template and a grep-like operation to ensure the manifests contains changes (example
https://github.com/hashicorp/consul-helm)
The other is using golang and helm libraries to template the charts and ensure the resulted k8s api resource structs have the required properties. This requires more effort but is more robust and can do more complex stuff. (example
https://github.com/Waterdrips/helmunit)
Which one do you think is better? I think golang unit tests are overkill for most use-cases and we don't need to ensure complex functionalities but rather we simply need to ensure every variable is used and is generating expected output. So I think a method like
consul-helm
is better for us.