<p>I'm using helm charts to deploy several REST services to Microsoft Azure. 
Some of these services communicate with each other and to some databases. After the deployment I want to test if "everything" works as expected. To be more precise, I want to send some HTTP requests to one of the services and check if the response makes sense. In automated tests of course.</p>

<p>I saw that it's possible to run basic commands after the deployment using <a href="https://helm.sh/docs/developing_charts/#chart-tests" rel="nofollow noreferrer">"helm test"</a>, but this is not exactly what I need.</p>

<p>In some earlier approach I used <a href="https://learning.getpostman.com/docs/postman/collection_runs/command_line_integration_with_newman/" rel="nofollow noreferrer">Newman</a> to execute a <a href="https://www.getpostman.com/" rel="nofollow noreferrer">Postman</a> collection in a script after the deployment.
The Postman collection defined several requests and the corresponding tests.</p>

<p>Now I don't know how to do it in the new environment (Azure) and deployment pipeline (helm, k8s).</p>

<p>It would be nice to have something like this again.
But for me it's not clear how to do it, e.g. </p>

<ul>
<li>how can I use Newman in the "helm test" scope?</li>
<li>how can I ensure, that the deployed Pods are all "Running" before starting the test (some wait time? status check?)?</li>
</ul>

<p><code>newman run "test.postman_collection.json" -e "azure.postman_environment.json" --bail</code></p>

Thomas
<p>Helm test is very flexible, because it runs any Kubernetes YAML including any Docker image. As an example, you can check <a href="https://github.com/helm/charts/tree/master/stable/mysql/templates/tests" rel="nofollow noreferrer">tests for the MySQL Helm Chart</a>.</p>

<p>So, coming to your questions:</p>

<ol>
<li><p>To use Newman, you just need to find a Docker image with the Newman installed (e.g. the official one <a href="https://hub.docker.com/r/postman/newman" rel="nofollow noreferrer">postman/newman</a> or build your own). To use your JSON configuration files, you can either put them as <code>ConfigMap</code> or copy them into the container. Check he MySQL Helm Chart for more details.</p></li>
<li><p>You're right that you need to wait until your system is ready before running the tests. AFAIK this is not covered by Helm Test. So you need to either put <code>sleep</code> into your script or actively check with <code>kubectl</code> until the PODs are ready.</p></li>
</ol>
