'How to run application E2E test after argocd deployment?

I would like to know how can we run application E2E(UI or API) test after successful deployment of any micro services using ArgoCD.

Current Setup: I have CI pipeline setup with github-actions. Upon completion on CI build for any microservices, it updates the docker image version in helm values which resides in one of the github repo. This repo is than polled by ArgoCD for any change, and deploys in Kubernestes cluster if there is change exists.

Intent: I want to run the application E2E( UI & API ) test once argocd synced any micro-services deployment object defined in the Helm charts. But I am unsure what should be the trigger point in github actions for that. How E2E test github actions workflow will know argocd has deployed the microservices without any issue and service is ready to be consumed by the automated test.



Solution 1:[1]

ArgoCD provides a feature called resource hooks. Hooks are ways to run scripts before, during, and after a sync operation. A use case for hooks from the official documentation:

Using a PostSync hook to run integration and health checks after a deployment.

Hooks can be any type of Kubernetes resource kind, but tend to be Pod, Job, or Argo Workflows.

Per the GitHub actions documentation, you can send a POST request to the Github API in PostSync hooks template to run the workflow run.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Jeremy Caney