<p>Preview:
We started working on helm 3 to deploy our applications on k8s and we have come to good stage with deploying the charts successfully. However we are very new to implement tests under helm charts.
For example I am deploying pdfreactor official image and i can check the web application version details either by using browser &quot;http://172.27.1.119:31423/service/&quot; or by &quot;curl <a href="http://172.27.1.119:31423/service/%22" rel="nofollow noreferrer">http://172.27.1.119:31423/service/&quot;</a>. Now I want to write a helm test to check the same. The below is pdfreactor-test.yaml (reference link: <a href="https://helm.sh/docs/topics/chart_tests/" rel="nofollow noreferrer">https://helm.sh/docs/topics/chart_tests/</a>)</p>
<pre><code>apiVersion: v1
kind: Pod
metadata:
  name: &quot;{{ .Release.Name }}-credentials-test&quot;
  annotations:
    &quot;helm.sh/hook&quot;: test
spec:
  containers:
    - name: {{ .Release.Name }}-credentials-test
      image: {{ .Values.image.imageName }}
      imagePullPolicy: {{ .Values.image.pullPolicy | quote }}
      command:
        - /bin/bash
        - curl http://172.27.1.119:31423/service/
</code></pre>
<p>When i ran</p>
<pre><code> helm install pdfreactor &lt;chart name&gt; 
 helm test pdfreactor 
</code></pre>
<p>I got below response</p>
<pre><code>NAME: pdfreactor
LAST DEPLOYED: Thu Aug 13 09:02:55 2020
NAMESPACE: default
STATUS: deployed
REVISION: 1
TEST SUITE: None
NOTES:
Thank you for installing pdfreactor.
</code></pre>
<p>Below are my challenges.</p>
<ol>
<li>Need to understand what am i doing wrong?</li>
<li>How exactly the helm test will work? Does it create a new pod and test, or does it test on existing pod?</li>
<li>What is the purpose of giving image details in test.yaml?</li>
</ol>
<p>Note: I have even used the default template generated with helm create.</p>

SHC
<p>Make sure your test configuration files reside under <code>&lt;chart-name&gt;/templates/tests/</code> folder.</p>
<p>Regarding 2 and 3 - Yes, it creates a new pod, using the template you provided. The pod will run to completion, and if the Exit Code will be 0, the test is considered successful.</p>
