Answer the question
In order to leave comments, you need to log in
Kubernetes how to run testing?
Good afternoon!
Imagine that there is a simple NodeJS application with a MongoDB base, everything works in our containers and, for example, in a local Minikube cluster (a classic tutorial when searching for "nodejs mongo kubernetes").
We also remember that we have a pyramid of tests:
UI
Integration
Unit
Questions:
1. [Unit] Do I need to run Unit tests in a cluster? (although it is not clear how in another way)
How then to run not all, but let's say the one you need? (write a script that will rebuild the image with the desired test, update the deployment and restart the pod in the cluster?)
2. [Unit] how to see that the tests have run? (connect to the container logs and already understand them? although you can probably write a script for all this too)
3. [Integration] in these tests, the joint operation of NodeJS + Mongo containers is checked, how should the tests wait for the start of the Mongo container?
I haven't grown up to UI tests yet.
Answer the question
In order to leave comments, you need to log in
How is your [Unit] different from [Integration] if you are going to run software for them?
If you have to run the software itself to run unit tests, 99.9% you're going the wrong way)
In general, unit tests should block code from getting into the "master" source control branch if the code doesn't pass them.
It's simple:
1) Unit tests don't need a server.
2) For Integration tests - you deploy as usual and run tests against relevant URLs.
This is important not only for tests. Use readiness probes.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question