github.com/argoproj/argo-cd@v1.8.7/docs/developer-guide/test-e2e.md (about) 1 # E2E Tests 2 3 !!!warning 4 This documentation is out-of-date. Please bear with us while we work to 5 update the documentation to reflect reality! 6 7 The directory contains E2E tests and test applications. The test assume that Argo CD services are installed into `argocd-e2e` namespace or cluster in current context. One throw-away 8 namespace `argocd-e2e***` is created prior to tests execute. The throw-away namespace is used as a target namespace for test applications. 9 10 The `test/e2e/testdata` directory contains various Argo CD applications. Before test execution directory is copies into `/tmp/argocd-e2e***` temp directory and used in tests as a 11 Git repository via file url: `file:///tmp/argocd-e2e***`. 12 13 ## Running Tests Locally 14 15 1. Start the e2e version `make start-e2e` 16 1. Run the tests: `make test-e2e` 17 18 You can observe the tests by using the UI [http://localhost:8080/applications](http://localhost:8080/applications). 19 20 ## Configuration of E2E Tests execution 21 22 The Makefile's `start-e2e` target starts instances of ArgoCD on your local machine, of which the most will require a network listener. If for whatever reason you already have network services on your machine listening on the same ports, the e2e tests will not be able to run. You can derive from the defaults by setting the following environment variables before you run `make start-e2e`: 23 24 * `ARGOCD_E2E_APISERVER_PORT`: Listener port for `argocd-server` (default: `8080`) 25 * `ARGOCD_E2E_REPOSERVER_PORT`: Listener port for `argocd-reposerver` (default: `8081`) 26 * `ARGOCD_E2E_DEX_PORT`: Listener port for `dex` (default: `5556`) 27 * `ARGOCD_E2E_REDIS_PORT`: Listener port for `redis` (default: `6379`) 28 * `ARGOCD_E2E_YARN_CMD`: Command to use for starting the UI via Yarn (default: `yarn`) 29 30 If you have changed the port for `argocd-server`, be sure to also set `ARGOCD_SERVER` environment variable to point to that port, e.g. `export ARGOCD_SERVER=localhost:8888` before running `make test-e2e` so that the test will communicate to the correct server component. 31 32 ## CI Set-up 33 34 The tests are executed by Argo Workflow defined at `.argo-ci/ci.yaml`. CI job The builds an Argo CD image, deploy argo cd components into throw-away kubernetes cluster provisioned 35 using k3s and run e2e tests against it. 36 37 ## Test Isolation 38 39 Some effort has been made to balance test isolation with speed. Tests are isolated as follows as each test gets: 40 41 * A random 5 character ID. 42 * A unique Git repository containing the `testdata` in `/tmp/argocd-e2e/${id}`. 43 * A namespace `argocd-e2e-ns-${id}`. 44 * An primary name for the app `argocd-e2e-${id}`. 45 46 ## Troubleshooting 47 48 **Tests fails to delete `argocd-e2e-ns-*` namespaces.** 49 50 This maybe due to the metrics server, run this: 51 52 ```bash 53 kubectl api-resources 54 ``` 55 56 If it exits with status code 1, run: 57 58 ```bash 59 kubectl delete apiservice v1beta1.metrics.k8s.io 60 ``` 61 62 Remove `/spec/finalizers` from the namespace 63 64 ```bash 65 kubectl edit ns argocd-e2e-ns-* 66 ```