Overview
Post-deployment testing often includes functional, smoke, black-box, and performance tests. Common tools include JMeter for load testing. Here, we’ll implement a simple Integration Tests – PROD stage in Jenkins that mirrors our dev workflow.This integration step is a quick sanity check. For full end-to-end or load tests, consider extending with specialized tools or scripts.
Jenkins Pipeline Changes
We insert a new Integration Tests – PROD stage immediately after theK8S_Deployment - PROD stage. If any test fails, the deployment rolls back to the previous version automatically.
Testing via Istio Ingress Gateway
In production, services typically use a ClusterIP. To access your app behind Istio, retrieve the NodePort assigned to port 80 on the Istio Ingress Gateway:If the Ingress Gateway service does not expose port 80 as a NodePort, your tests will fail. Ensure your Gateway configuration allows external access.
integration-test-PROD.sh
Below is the shell script executed in the Integration Tests – PROD stage. It:- Waits briefly for the deployment to settle.
- Retrieves the Istio NodePort for port 80.
- Constructs the application URL.
- Checks a simple increment endpoint and HTTP status code.