From 2fda37f5b6ef269244ca0bdbca1d093071f67c13 Mon Sep 17 00:00:00 2001 From: moremind Date: Tue, 19 Sep 2023 14:57:39 +0800 Subject: [PATCH] [type:feat] support e2e contain in k8s --- .github/workflows/e2e-k8s.yml | 2 +- .../k8s/script/e2e-test-mysql.sh | 42 +------------------ .../k8s/shenyu-deployment-mysql.yml | 2 +- 3 files changed, 4 insertions(+), 42 deletions(-) diff --git a/.github/workflows/e2e-k8s.yml b/.github/workflows/e2e-k8s.yml index 3959bcd61ab90..98514e6376cf7 100644 --- a/.github/workflows/e2e-k8s.yml +++ b/.github/workflows/e2e-k8s.yml @@ -86,7 +86,7 @@ jobs: if: steps.filter.outputs.changed == 'true' run: | bash ./shenyu-e2e/shenyu-e2e-case/shenyu-e2e-case-http/k8s/script/e2e-test-h2.sh -# bash ./shenyu-e2e/shenyu-e2e-case/shenyu-e2e-case-http/k8s/script/e2e-test-mysql.sh + bash ./shenyu-e2e/shenyu-e2e-case/shenyu-e2e-case-http/k8s/script/e2e-test-mysql.sh - name: Cluster Test after Healthcheck if: steps.filter.outputs.changed == 'true' diff --git a/shenyu-e2e/shenyu-e2e-case/shenyu-e2e-case-http/k8s/script/e2e-test-mysql.sh b/shenyu-e2e/shenyu-e2e-case/shenyu-e2e-case-http/k8s/script/e2e-test-mysql.sh index bbe2f783a29fc..78793436e5c06 100644 --- a/shenyu-e2e/shenyu-e2e-case/shenyu-e2e-case-http/k8s/script/e2e-test-mysql.sh +++ b/shenyu-e2e/shenyu-e2e-case/shenyu-e2e-case-http/k8s/script/e2e-test-mysql.sh @@ -16,21 +16,11 @@ # limitations under the License. # -## init kubernetes for mysql +echo -e `nc -z -v -w30 shenyu-mysql 30306` + curPath=$(readlink -f "$(dirname "$0")") PRGDIR=`dirname "$curPath"` echo $PRGDIR -kubectl apply -f ${PRGDIR}/shenyu-mysql.yml -sleep 10s - -kubectl get pod -o wide - -sleep 60s - -kubectl get pod -o wide - -echo -e `nc -z -v -w30 shenyu-mysql 30306` - kubectl apply -f ${PRGDIR}/shenyu-deployment-mysql.yml kubectl apply -f ${PRGDIR}/shenyu-app-service-mysql.yml @@ -38,36 +28,8 @@ kubectl get pod -o wide sleep 60s -kubectl run -it --rm --image=mysql:8.0 --restart=Never mysql-client -- mysql -h shenyu-mysql -uroot -pshenyue2e -e "show databases;" kubectl get pod -o wide chmod +x ${curPath}/healthcheck.sh sh ${curPath}/healthcheck.sh mysql -# -#kubectl logs -l app=shenyu-admin-mysql -# -#sleep 10s -# -#kubectl -n kube-system get pods | grep Evicted |awk '{print$1}'|xargs kubectl -n kube-system delete pods -#kubectl get pod -o wide -# -## execute healthcheck.sh -#chmod +x ${curPath}/healthcheck.sh -#sh ${curPath}/healthcheck.sh mysql -# -### run e2e-test -#curl http://localhost:31196/actuator/shenyu/pluginData - -### wait shenyu-admin and shenyu-bootstrap start -# get shenyu-admin pod name -# -#shenyu_admin_pod_name=`kubectl get pod -n kube-system | grep shenyu-admin | awk '{print $1}'` -# -## get shenyu-bootstrap pod name -# -#shenyu_bootstrap_pod_name=`kubectl get pod -n kube-system | grep shenyu-bootstrap | awk '{print $1}'` -# -## get shenyu-admin pod status -# -#shenyu_admin_pod_status=`kubectl get pod -n kube-system | grep shenyu-admin | awk '{print $3}'` diff --git a/shenyu-e2e/shenyu-e2e-case/shenyu-e2e-case-http/k8s/shenyu-deployment-mysql.yml b/shenyu-e2e/shenyu-e2e-case/shenyu-e2e-case-http/k8s/shenyu-deployment-mysql.yml index b6d0c03f50695..89a3ca09b6688 100644 --- a/shenyu-e2e/shenyu-e2e-case/shenyu-e2e-case-http/k8s/shenyu-deployment-mysql.yml +++ b/shenyu-e2e/shenyu-e2e-case/shenyu-e2e-case-http/k8s/shenyu-deployment-mysql.yml @@ -80,7 +80,7 @@ spec: volumes: - name: mysql-connector-volume hostPath: - path: /tmp/shenyu-e2e/driver/mysql + path: /tmp/shenyu-e2e/mysql/driver restartPolicy: Always ---