Why do we need Helm Tests? What does they solve?


@Tejaswini_Vadlamudi
 

Hi,
I want to understand why we need helm tests? I have my CI automation which deploys all of my charts and checks if the feature is working or not.
I don't understand why I need "helm tests" in the helm chart directories. Also, is it the only way-forward or do we have any other tools that can help us for the time being?

Thanks,
Teja


Matt Farina
 

Teja,

This is a good question.

There are a couple things that come to mind for uses of Helm tests.

Helm tests enable a chart author to package tests in a chart and ship them to a chart consumer. The chart consumer (sometimes called the Helm user) can then install a chart and test that it's running. This is useful as Helm is a package manager and the one creating the chart is often not the one installing and using the chart.

Helm is used across many versions of Kubernetes. That includes supported and unsupported versions. When a chart is packaged up by a chart creator it may be tested against the version of Kubernetes they use but does that mean it works against the version of Kubernetes a chart user is dealing with? Testing passed to the users in a common way provides a means to help figure it out.

One tool to help with testing is the Chart Testing tool (https://github.com/helm/chart-testing). It's used for the CI testing in the stable charts repo.

Regards,
Matt


On Mon, Sep 7, 2020, at 9:11 AM, vtejaswini1@... wrote:
Hi,
I want to understand why we need helm tests? I have my CI automation which deploys all of my charts and checks if the feature is working or not.
I don't understand why I need "helm tests" in the helm chart directories. Also, is it the only way-forward or do we have any other tools that can help us for the time being?

Thanks,
Teja


@Tejaswini_Vadlamudi
 

Thank you Matt, you always share prompt and correct reflections!! I'm very happy with the above explanation, sounds reasonable. :)
I agree that chart consumers (automation/human beings) are different actors compared to chart owners/developers. If chart owners don't involve in the chart consumer's helm deployments and tests, chart owners of course need to provide some sort of sanity tests.

Best Regards,
Teja 


Loritsch, Berin <bloritsch@...>
 

Keep in mind that there is a tool called Terratest https://github.com/gruntwork-io/terratest that is designed to test your deployments.  It works with a wide array of deployment tools, including Kubernetes.  Might be worth seeing what they provide.


On Wed, Sep 9, 2020 at 7:37 PM <vtejaswini1@...> wrote:
Thank you Matt, you always share prompt and correct reflections!! I'm very happy with the above explanation, sounds reasonable. :)
I agree that chart consumers (automation/human beings) are different actors compared to chart owners/developers. If chart owners don't involve in the chart consumer's helm deployments and tests, chart owners of course need to provide some sort of sanity tests.

Best Regards,
Teja 



--
Berin Loritsch

Systems Integration Lead


7921 Jones Branch Drive
McLean, VA 22102
Email bloritsch@...

Office (703) 735-6281

Mobile (571) 215-7708


@Tejaswini_Vadlamudi
 

@Matt:  I am trying to understand different test cases that can be tested via the helm test. I now agree that we need these tests but I was unsure how can help/aid my chart consumers. Most of the helm charts today in helm hub are testing connections to their ports. I was thinking if we can use "helm tests" to notice if the deployment was successful or not i.e. to understand if microservices are deployed properly as per deployment configuration and ready to serve traffic. Am I thinking correctly? Can we use helm tests to test readiness and liveness checks of microservices or is it a bad idea (rely on monitoring instead)?

@Berin: Thanks for the suggestions. I had a quick look at Terratest. If we have helm tests, we can either run "helm test" or "ct lint". I think Terratest is a go library support for writing test code and also offers support for deployment, validation of charts, and infrastructure readiness. Does Terratest run "helm test" as part of its validation or does that something else?

Thanks,
Teja


Loritsch, Berin <bloritsch@...>
 

My understanding is that Terratest was designed around testing deployments and predates any testing code in Helm.  I'm not on the terratest email distribution list so I don't know if they are even aware of helm's new testing support.


On Thu, Oct 1, 2020 at 6:12 AM <vtejaswini1@...> wrote:
@Matt:  I am trying to understand different test cases that can be tested via the helm test. I now agree that we need these tests but I was unsure how can help/aid my chart consumers. Most of the helm charts today in helm hub are testing connections to their ports. I was thinking if we can use "helm tests" to notice if the deployment was successful or not i.e. to understand if microservices are deployed properly as per deployment configuration and ready to serve traffic. Am I thinking correctly? Can we use helm tests to test readiness and liveness checks of microservices or is it a bad idea (rely on monitoring instead)?

@Berin: Thanks for the suggestions. I had a quick look at Terratest. If we have helm tests, we can either run "helm test" or "ct lint". I think Terratest is a go library support for writing test code and also offers support for deployment, validation of charts, and infrastructure readiness. Does Terratest run "helm test" as part of its validation or does that something else?

Thanks,
Teja



--
Berin Loritsch

Systems Integration Lead


7921 Jones Branch Drive
McLean, VA 22102
Email bloritsch@...

Office (703) 735-6281

Mobile (571) 215-7708