<p>I’ve been digging a bit into the way people run integration and e2e tests in the context of Kubernetes and have been quite disappointed by the lack of documentation and feedbacks. I know there are amazing tools such as kind or minikube that allow to run resources locally. But in the context of a CI, and with a bunch of services, it does not seem to be a good fit, for obvious resources reasons. I think there are great opportunities with running tests for:</p>

<ul>
<li>Validating manifests or helm charts</li>
<li>Validating the well behaving of a component as part of a bigger whole</li>
<li>Validating the global behaviour of a product</li>
</ul>

<p>The point here is not really about the testing framework but more about the environment on top of which the tests could be run.</p>

<p>Do you share my thought? Have you ever experienced running such kind of tests? Do you have any feedbacks or insights about it?</p>

<p>Thanks a lot</p>

vesna
<p>Interesting question and something that I have worked on over the last couple of months for my current employer. Essentially we ship a product as docker images with manifests. When writing e2e tests I want to run the product as close to the customer environment as possible.</p>

<p>Essentially to solve this we have built scripts that interact with our standard cloud provider (GCloud) to create a cluster, deploy the product and then run the tests against it.</p>

<p>For the major cloud providers this is not a difficult tasks but can be time consuming. There are a couple of things that we have learnt the hard way to keep in mind while developing the tests.</p>

<ol>
<li>Concurrency, this may sound obvious but do think about the number of concurrent builds your CI can run.</li>
<li>Latency from the cloud, don't assume that you will get an instant response to every command that you run in the cloud. Also think about the timeouts. If you bring up a product with lots of pods and services what is the acceptable start up time?</li>
<li>Errors causing build failures, this is an interesting one. We have seen errors in the build due to network errors when communicating with our test deployment. These are nearly always transitive. It is best to avoid these making the build fail.</li>
</ol>

<p>One thing to look at is GitLab are providing some <a href="https://docs.gitlab.com/ee/ci/docker/using_docker_build.html" rel="nofollow noreferrer">documentation</a> on how to build and test images in their CI pipeline.</p>
