From 58c32834115d1a7e7a0cdadb09e4ceebf9eb4d89 Mon Sep 17 00:00:00 2001 From: woshicai <583605554@qq.com> Date: Fri, 9 Apr 2021 14:13:59 +0800 Subject: [PATCH] update: run helm lint & test after e2e-setup (#1415) Co-authored-by: charles --- .github/workflows/go.yml | 2 + .../templates/test/test-application.yaml | 60 +++++++++++++++++++ 2 files changed, 62 insertions(+) create mode 100644 charts/vela-core/templates/test/test-application.yaml diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 98086b779..763d174e2 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -167,6 +167,8 @@ jobs: run: | make e2e-cleanup make e2e-setup + helm lint ./charts/vela-core + helm test -n vela-system kubevela --timeout 5m - name: Wait for e2e preparation ready run: | diff --git a/charts/vela-core/templates/test/test-application.yaml b/charts/vela-core/templates/test/test-application.yaml new file mode 100644 index 000000000..a390d48e9 --- /dev/null +++ b/charts/vela-core/templates/test/test-application.yaml @@ -0,0 +1,60 @@ +apiVersion: core.oam.dev/v1beta1 +kind: Application +metadata: + annotations: + helm.sh/hook: test-success + name: first-vela-app +spec: + components: + - name: express-server + type: webservice + properties: + image: crccheck/hello-world + port: 8000 + traits: + - type: ingress + properties: + domain: testsvc.example.com + http: + "/": 8000 +--- +apiVersion: v1 +kind: Pod +metadata: + name: "{{ .Release.Name }}-application-test" + annotations: + "helm.sh/hook": test +spec: + serviceAccountName: kubevela-vela-core + containers: + - name: {{ .Release.Name }}-application-test + image: alpine/k8s:1.18.2 + imagePullPolicy: IfNotPresent + command: + - /bin/bash + - -ec + - | + + set -e + + echo "Waiting application is ready..." + + echo "waiting for application being Applied" + kubectl -n vela-system wait --for=condition=Applied application first-vela-app --timeout=3m + echo "application being Applied" + + # wait for deploy being created + echo "waiting for deployment being available" + kubectl -n vela-system wait --for=condition=available deploy express-server --timeout 3m + echo "deployment being available" + + # wait for ingress being created + while ! [ `kubectl -n vela-system get ing express-server | grep -v NAME | wc -l` = 1 ]; do + echo "waiting for ingress being created" + sleep 1 + done + + + + echo "Application and its components are created" + restartPolicy: Never \ No newline at end of file