diff options
| author | wlq1212 <liqing.wu@daocloud.io> | 2023-08-16 13:38:19 +0800 |
|---|---|---|
| committer | liqing.wu <liqing.wu@daoclod.io> | 2023-08-23 11:02:11 +0800 |
| commit | f7cfbe3cd3c08b9c3693cbc65c3d3d6a567da4a5 (patch) | |
| tree | dd0708e89c49761abf800dd91456924c57c1770e | |
| parent | Merge pull request #4953 from Shelley-BaoYue/update-ke-image (diff) | |
| download | kubeedge-f7cfbe3cd3c08b9c3693cbc65c3d3d6a567da4a5.tar.gz | |
Add e2e compatibility test
Signed-off-by: wlq1212 <liqing.wu@daoclod.io>
| -rw-r--r-- | .github/workflows/main.yaml | 25 | ||||
| -rw-r--r-- | Makefile | 2 | ||||
| -rwxr-xr-x | hack/lib/install.sh | 2 | ||||
| -rwxr-xr-x | hack/local-up-kubeedge.sh | 4 | ||||
| -rwxr-xr-x | tests/scripts/execute.sh | 8 |
5 files changed, 28 insertions, 13 deletions
diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 200717324..4b7bf8f7c 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -160,10 +160,20 @@ jobs: runs-on: ubuntu-22.04 strategy: matrix: - PROTOCOL: - - WebSocket - - QUIC - timeout-minutes: 40 + cases: + - protocol: WebSocket + version: v1.24.0 + - protocol: WebSocket + version: v1.23.0 + - protocol: WebSocket + version: v1.22.0 + - protocol: QUIC + version: v1.24.0 + - protocol: QUIC + version: v1.23.0 + - protocol: QUIC + version: v1.22.0 + timeout-minutes: 60 name: E2e test needs: image-prepare env: @@ -204,14 +214,15 @@ jobs: # for WebSocket protocol, we will use containerd as edgecore container runtime # just for covering both docker and CRI runtime e2e cases - run: | - export PROTOCOL=${{ matrix.PROTOCOL }} + export PROTOCOL=${{ matrix.cases.protocol }} + export KIND_IMAGE=kindest/node:${{ matrix.cases.version }} export CONTAINER_RUNTIME="remote" make e2e - uses: actions/upload-artifact@v3 if: always() with: - name: ${{ matrix.PROTOCOL }}-e2e-test-logs + name: ${{ matrix.cases.version }}-${{ matrix.cases.protocol }}-e2e-test-logs path: | /tmp/cloudcore.log /tmp/edgecore.log @@ -277,7 +288,7 @@ jobs: - name: Install dependences run: | command -v ginkgo || go install github.com/onsi/ginkgo/ginkgo@${{ env.GINKGO_VERSION }} - go install sigs.k8s.io/kind@v0.14.0 + go install sigs.k8s.io/kind@v0.17.0 curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.24.14/bin/linux/amd64/kubectl && sudo install kubectl /usr/local/bin/kubectl - name: Checkout code @@ -292,7 +292,7 @@ else e2e: # bash tests/e2e/scripts/execute.sh device_crd # This has been commented temporarily since there is an issue of CI using same master for all PRs, which is causing failures when run parallelly - tests/scripts/execute.sh + tests/scripts/execute.sh ${KIND_IMAGE} endif define KEADM_DEPRECATED_E2E_HELP_INFO diff --git a/hack/lib/install.sh b/hack/lib/install.sh index e06675cfc..6d777ebd9 100755 --- a/hack/lib/install.sh +++ b/hack/lib/install.sh @@ -32,7 +32,7 @@ function check_kind { command -v kind >/dev/null 2>&1 if [[ $? -ne 0 ]]; then echo "installing kind ." - GO111MODULE="on" go install sigs.k8s.io/kind@v0.12.0 + GO111MODULE="on" go install sigs.k8s.io/kind@v0.17.0 if [[ $? -ne 0 ]]; then echo "kind installed failed, exiting." exit 1 diff --git a/hack/local-up-kubeedge.sh b/hack/local-up-kubeedge.sh index 08f98a3de..7e2bd6ded 100755 --- a/hack/local-up-kubeedge.sh +++ b/hack/local-up-kubeedge.sh @@ -21,6 +21,7 @@ LOG_LEVEL=${LOG_LEVEL:-2} TIMEOUT=${TIMEOUT:-60}s PROTOCOL=${PROTOCOL:-"WebSocket"} CONTAINER_RUNTIME=${CONTAINER_RUNTIME:-"remote"} +KIND_IMAGE=${1:-"kindest/node:v1.24.0"} echo -e "The installation of the cni plugin will overwrite the cni config file. Use export CNI_CONF_OVERWRITE=false to disable it." if [[ "${CLUSTER_NAME}x" == "x" ]];then @@ -48,7 +49,7 @@ function check_prerequisites { # spin up cluster with kind command function kind_up_cluster { echo "Running kind: [kind create cluster ${CLUSTER_CONTEXT}]" - kind create cluster ${CLUSTER_CONTEXT} + kind create cluster ${CLUSTER_CONTEXT} --image ${KIND_IMAGE} } function uninstall_kubeedge { @@ -70,6 +71,7 @@ function cleanup { echo "Running kind: [kind delete cluster ${CLUSTER_CONTEXT}]" kind delete cluster ${CLUSTER_CONTEXT} + } if [[ "${ENABLE_DAEMON}" = false ]]; then diff --git a/tests/scripts/execute.sh b/tests/scripts/execute.sh index 22ada0940..811448272 100755 --- a/tests/scripts/execute.sh +++ b/tests/scripts/execute.sh @@ -23,6 +23,8 @@ curpath=$PWD echo $PWD GOPATH=${GOPATH:-$(go env GOPATH)} +KIND_IMAGE=${1:-"kindest/node:v1.24.0"} +compilemodule=$2 which ginkgo &> /dev/null || ( go install github.com/onsi/ginkgo/ginkgo@latest @@ -39,9 +41,9 @@ sudo rm -rf ${curpath}/tests/e2e/e2e.test sudo rm -rf ${curpath}/tests/e2e_keadm/e2e_keadm.test # Specify the module name to compile in below command -bash -x ${curpath}/tests/scripts/compile.sh $1 +bash -x ${curpath}/tests/scripts/compile.sh ${compilemodule} -ENABLE_DAEMON=true bash -x ${curpath}/hack/local-up-kubeedge.sh || { +ENABLE_DAEMON=true bash -x ${curpath}/hack/local-up-kubeedge.sh ${KIND_IMAGE}|| { echo "failed to start cluster !!!" exit 1 } @@ -52,4 +54,4 @@ export GINKGO_TESTING_RESULT=0 trap cleanup EXIT -bash -x ${curpath}/tests/scripts/fast_test.sh $1 +bash -x ${curpath}/tests/scripts/fast_test.sh ${compilemodule} |
