Adds a faster way to run e2e locally (#1475)

This commit is contained in:
Alex Collins 2019-04-17 10:53:37 -07:00 committed by GitHub
parent 11c878b847
commit 53cbcd362d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 19 additions and 12 deletions

View file

@ -146,6 +146,13 @@ test:
test-e2e: cli
$(TEST_CMD) -v -failfast -timeout 20m ./test/e2e
.PHONY: start-e2e
start-e2e: cli
kubectl create ns argocd-e2e || true
kubens argocd-e2e
kustomize build test/manifests/base | kubectl apply -f -
make start
# Cleans VSCode debug.test files from sub-dirs to prevent them from being included in packr boxes
.PHONY: clean-debug
clean-debug:
@ -158,6 +165,7 @@ clean: clean-debug
.PHONY: start
start:
killall goreman || true
kubens argocd
goreman start
.PHONY: pre-commit

View file

@ -18,17 +18,20 @@ Install:
* [kustomize](https://github.com/kubernetes-sigs/kustomize/releases)
* [go-swagger](https://github.com/go-swagger/go-swagger/blob/master/docs/install.md)
* [jq](https://stedolan.github.io/jq/)
* [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/).
* [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/)
* [kubectx](https://kubectx.dev)
* [minikube](https://kubernetes.io/docs/setup/minikube/) or Docker for Desktop
Brew users can quickly install the lot:
```bash
brew tap go-swagger/go-swagger
brew install go dep protobuf kubectl kubectx ksonnet/tap/ks kubernetes-helm jq go-swagger
```
!!! note "Kustomize"
Since Argo CD supports Kustomize v1.0 and v2.0, you will need to install both versions in order for the unit tests to run. The Kustomize 1 unit test expects to find a `kustomize1` binary in the path. You can use this [link](https://github.com/argoproj/argo-cd/blob/master/Dockerfile#L66-L69) to find the Kustomize 1 currently used by Argo CD and modify the curl command to download the correct OS.
```bash
brew tap go-swagger/go-swagger
brew install go dep protobuf kubectl ksonnet/tap/ks kubernetes-helm jq go-swagger
```
Set up environment variables (e.g. is `~/.bashrc`):
```bash

View file

@ -8,12 +8,8 @@ Git repository via file url: `file:///tmp/argocd-e2e***`.
## Running Tests Locally
1. Create namespace: `kubectl create ns argocd-e2e`
1. Apply manifests: `kustomize build test/manifests/base | kubectl apply -n argocd-e2e -f -`
1. Change namespace to `argocd-e2e`: `kubens argocd-e2e`
1. Start services: `make start`
1. Build CLI: `make cli`
1. Run tests: `make test-e2e`
1. Start the e2e version `make start-e2e`
1. Run the tests: `make test-e2e`
You can observe the tests by using the UI [http://localhost:8080/applications](http://localhost:8080/applications).