From 61ba7ec45acebdc5e04304d67fb2f6b18f8ff8b8 Mon Sep 17 00:00:00 2001 From: subhamkrai Date: Fri, 22 Jan 2021 10:17:08 +0530 Subject: [PATCH] ci: it test to run on multiple k8s version for master/release this commit enables IT to run on multiple k8s version and for master/release, all the 5 k8s version 'v1.15.12','v1.16.15','v1.18.15','v1.19.7','v1.20.0' similar to jenkins. Signed-off-by: subhamkrai --- .../integration-test-flex-suite.yaml | 59 ++++++++++++++++++ .../integration-test-helm-suite.yaml | 61 +++++++++++++++++++ .../workflows/integration-test-mgr-suite.yaml | 61 ++++++++++++++++++- .../integration-test-multi-cluster-suite.yaml | 60 ++++++++++++++++++ .../integration-test-smoke-suite.yaml | 59 ++++++++++++++++++ .../integration-test-upgrade-suite.yaml | 60 ++++++++++++++++++ 6 files changed, 359 insertions(+), 1 deletion(-) diff --git a/.github/workflows/integration-test-flex-suite.yaml b/.github/workflows/integration-test-flex-suite.yaml index d0458765e..39b0b8543 100644 --- a/.github/workflows/integration-test-flex-suite.yaml +++ b/.github/workflows/integration-test-flex-suite.yaml @@ -56,3 +56,62 @@ jobs: - name: setup tmate session for debugging if: failure() && contains(github.event.pull_request.labels.*.name, 'debug-flex-suite') uses: mxschmitt/action-tmate@v3 + + TestCephFlexSuite-Master: + if: github.ref == 'refs/heads/master' || github.ref == 'refs/tags/release-*' + runs-on: ubuntu-18.04 + strategy: + fail-fast: false + matrix: + kubernetes-versions : ['v1.15.12','v1.16.15','v1.18.15','v1.19.7','v1.20.2'] + steps: + - name: checkout + uses: actions/checkout@v2 + + - name: setup golang + uses: actions/setup-go@v2 + with: + go-version: 1.15 + + - name: setup minikube + uses: manusa/actions-setup-minikube@v2.3.1 + with: + minikube version: 'v1.13.1' + kubernetes version: ${{ matrix.kubernetes-versions }} + start args: --memory 6g --cpus=2 + + - name: check k8s cluster status + run: | + kubectl cluster-info + kubectl get pods -n kube-system + + - name: use local disk + run: | + sudo swapoff --all --verbose + sudo umount /mnt + # search for the device since it keeps changing between sda and sdb + sudo wipefs --all --force /dev/$(lsblk|awk '/14G/ {print $1}'| head -1)1 + sudo lsblk + + - name: build rook + run: | + # set VERSION to a dummy value since Jenkins normally sets it for us. Do this to make Helm happy and not fail with "Error: Invalid Semantic Version" + GOPATH=$(go env GOPATH) make clean && make -j$nproc IMAGES='ceph' VERSION=0 build + docker images + docker tag $(docker images|awk '/build-/ {print $1}') rook/ceph:master + + - name: TestCephFlexSuite + run: | + export DEVICE_FILTER=$(lsblk|awk '/14G/ {print $1}'| head -1) + go test -v -timeout 1800s -run CephFlexSuite github.com/rook/rook/tests/integration + + - name: Artifact + uses: actions/upload-artifact@v2 + if: failure() + with: + name: ceph-flex-suite-artifact + path: /home/runner/work/rook/rook/tests/integration/_output/tests/ + + - name: setup tmate session for debugging + if: failure() && contains(github.event.pull_request.labels.*.name, 'debug-flex-suite') + uses: mxschmitt/action-tmate@v3 diff --git a/.github/workflows/integration-test-helm-suite.yaml b/.github/workflows/integration-test-helm-suite.yaml index 70b4e633f..72cd36795 100644 --- a/.github/workflows/integration-test-helm-suite.yaml +++ b/.github/workflows/integration-test-helm-suite.yaml @@ -62,3 +62,64 @@ jobs: - name: setup tmate session for debugging if: failure() && contains(github.event.pull_request.labels.*.name, 'debug-helm-suite') uses: mxschmitt/action-tmate@v3 + + TestCephHelmSuite-Master: + if: github.ref == 'refs/heads/master' || github.ref == 'refs/tags/release-*' + runs-on: ubuntu-18.04 + strategy: + fail-fast: false + matrix: + kubernetes-versions : ['v1.15.12','v1.16.15','v1.18.15','v1.19.7','v1.20.2'] + steps: + - name: checkout + uses: actions/checkout@v2 + + - name: setup golang + uses: actions/setup-go@v2 + with: + go-version: 1.15 + + - name: setup minikube + uses: manusa/actions-setup-minikube@v2.3.1 + with: + minikube version: 'v1.16.0' + kubernetes version: ${{ matrix.kubernetes-versions }} + start args: --memory 6g --cpus=2 + + - name: check k8s cluster status + run: | + kubectl cluster-info + kubectl get pods -n kube-system + + - name: use local disk + run: | + sudo swapoff --all --verbose + sudo umount /mnt + # search for the device since it keeps changing between sda and sdb + sudo wipefs --all --force /dev/$(lsblk|awk '/14G/ {print $1}'| head -1)1 + sudo lsblk + + - name: build rook + run: | + # set VERSION to a dummy value since Jenkins normally sets it for us. Do this to make Helm happy and not fail with "Error: Invalid Semantic Version" + GOPATH=$(go env GOPATH) make clean && make -j$nproc IMAGES='ceph' VERSION=0 build + docker images + docker tag $(docker images|awk '/build-/ {print $1}') rook/ceph:master + + - name: TestCephHelmSuite + run: | + tests/scripts/minikube.sh helm + tests/scripts/helm.sh up + export DEVICE_FILTER=$(lsblk|awk '/14G/ {print $1}'| head -1) + SKIP_TEST_CLEANUP=false SKIP_CLEANUP_POLICY=false go test -v -timeout 1800s -run CephHelmSuite github.com/rook/rook/tests/integration + + - name: Artifact + uses: actions/upload-artifact@v2 + if: failure() + with: + name: ceph-helm-suite-artifact + path: /home/runner/work/rook/rook/tests/integration/_output/tests/ + + - name: setup tmate session for debugging + if: failure() && contains(github.event.pull_request.labels.*.name, 'debug-helm-suite') + uses: mxschmitt/action-tmate@v3 diff --git a/.github/workflows/integration-test-mgr-suite.yaml b/.github/workflows/integration-test-mgr-suite.yaml index fddd595b7..e626d0919 100644 --- a/.github/workflows/integration-test-mgr-suite.yaml +++ b/.github/workflows/integration-test-mgr-suite.yaml @@ -59,4 +59,63 @@ jobs: - name: setup tmate session for debugging if: failure() && contains(github.event.pull_request.labels.*.name, 'debug-mgr-suite') - uses: mxschmitt/action-tmate@v3 \ No newline at end of file + uses: mxschmitt/action-tmate@v3 + + TestCephMgrSuite-Master: + if: github.ref == 'refs/heads/master' || github.ref == 'refs/tags/release-*' + runs-on: ubuntu-18.04 + strategy: + fail-fast: false + matrix: + kubernetes-versions : ['v1.15.12','v1.16.15','v1.18.15','v1.19.7','v1.20.2'] + steps: + - name: checkout + uses: actions/checkout@v2 + + - name: setup golang + uses: actions/setup-go@v2 + with: + go-version: 1.15 + + - name: setup minikube + uses: manusa/actions-setup-minikube@v2.3.1 + with: + minikube version: 'v1.16.0' + kubernetes version: ${{ matrix.kubernetes-versions }} + start args: --memory 6g --cpus=2 + + - name: check k8s cluster status + run: | + kubectl cluster-info + kubectl get pods -n kube-system + + - name: use local disk + run: | + sudo swapoff --all --verbose + sudo umount /mnt + # search for the device since it keeps changing between sda and sdb + sudo wipefs --all --force /dev/$(lsblk|awk '/14G/ {print $1}'| head -1)1 + sudo lsblk + + - name: build rook + run: | + # set VERSION to a dummy value since Jenkins normally sets it for us. Do this to make Helm happy and not fail with "Error: Invalid Semantic Version" + GOPATH=$(go env GOPATH) make clean && make -j$nproc IMAGES='ceph' VERSION=0 build + docker images + docker tag $(docker images|awk '/build-/ {print $1}') rook/ceph:master + + - name: TestCephMgrSuite + run: | + export DEVICE_FILTER=$(lsblk|awk '/14G/ {print $1}'| head -1) + go test -v -timeout 1800s -run CephMgrSuite github.com/rook/rook/tests/integration + + - name: Artifact + uses: actions/upload-artifact@v2 + if: failure() + with: + name: ceph-mgr-suite-artifact + path: /home/runner/work/rook/rook/tests/integration/_output/tests/ + + - name: setup tmate session for debugging + if: failure() && contains(github.event.pull_request.labels.*.name, 'debug-mgr-suite') + uses: mxschmitt/action-tmate@v3 diff --git a/.github/workflows/integration-test-multi-cluster-suite.yaml b/.github/workflows/integration-test-multi-cluster-suite.yaml index 09f70b9ba..0f5fde6e7 100644 --- a/.github/workflows/integration-test-multi-cluster-suite.yaml +++ b/.github/workflows/integration-test-multi-cluster-suite.yaml @@ -61,3 +61,63 @@ jobs: - name: setup tmate session for debugging if: failure() && contains(github.event.pull_request.labels.*.name, 'debug-multi-cluster-suite') uses: mxschmitt/action-tmate@v3 + + TestCephMultiClusterDeploySuite-Master: + if: github.ref == 'refs/heads/master' || github.ref == 'refs/tags/release-*' + runs-on: ubuntu-18.04 + strategy: + fail-fast: false + matrix: + kubernetes-versions : ['v1.15.12','v1.16.15','v1.18.15','v1.19.7','v1.20.2'] + steps: + - name: checkout + uses: actions/checkout@v2 + + - name: setup golang + uses: actions/setup-go@v2 + with: + go-version: 1.15 + + - name: setup minikube + uses: manusa/actions-setup-minikube@v2.3.1 + with: + minikube version: 'v1.16.0' + kubernetes version: ${{ matrix.kubernetes-versions }} + start args: --memory 6g --cpus=2 + + - name: check k8s cluster status + run: | + kubectl cluster-info + kubectl get pods -n kube-system + + - name: use local disk + run: | + sudo swapoff --all --verbose + sudo umount /mnt + # search for the device since it keeps changing between sda and sdb + sudo wipefs --all --force /dev/$(lsblk|awk '/14G/ {print $1}'| head -1)1 + sudo lsblk + + - name: build rook + run: | + # set VERSION to a dummy value since Jenkins normally sets it for us. Do this to make Helm happy and not fail with "Error: Invalid Semantic Version" + GOPATH=$(go env GOPATH) make clean && make -j$nproc IMAGES='ceph' VERSION=0 build + docker images + docker tag $(docker images|awk '/build-/ {print $1}') rook/ceph:master + + - name: TestCephMultiClusterDeploySuite + run: | + export TEST_SCRATCH_DEVICE=$(sudo lsblk --paths|awk '/14G/ {print $1}'| head -1)1 + export DEVICE_FILTER=$(lsblk|awk '/14G/ {print $1}'| head -1) + go test -v -timeout 1800s -run CephMultiClusterDeploySuite github.com/rook/rook/tests/integration + + - name: Artifact + uses: actions/upload-artifact@v2 + if: failure() + with: + name: ceph-multi-cluster-deploy-suite-artifact + path: /home/runner/work/rook/rook/tests/integration/_output/tests/ + + - name: setup tmate session for debugging + if: failure() && contains(github.event.pull_request.labels.*.name, 'debug-multi-cluster-suite') + uses: mxschmitt/action-tmate@v3 diff --git a/.github/workflows/integration-test-smoke-suite.yaml b/.github/workflows/integration-test-smoke-suite.yaml index d563ea276..d9107fc25 100644 --- a/.github/workflows/integration-test-smoke-suite.yaml +++ b/.github/workflows/integration-test-smoke-suite.yaml @@ -60,3 +60,62 @@ jobs: - name: setup tmate session for debugging if: failure() && contains(github.event.pull_request.labels.*.name, 'debug-smoke-suite') uses: mxschmitt/action-tmate@v3 + + TestCephSmokeSuite-Master: + if: github.ref == 'refs/heads/master' || github.ref == 'refs/tags/release-*' + runs-on: ubuntu-18.04 + strategy: + fail-fast: false + matrix: + kubernetes-versions : ['v1.15.12','v1.16.15','v1.18.15','v1.19.7','v1.20.2'] + steps: + - name: checkout + uses: actions/checkout@v2 + + - name: setup golang + uses: actions/setup-go@v2 + with: + go-version: 1.15 + + - name: setup minikube + uses: manusa/actions-setup-minikube@v2.3.1 + with: + minikube version: 'v1.16.0' + kubernetes version: ${{ matrix.kubernetes-versions }} + start args: --memory 6g --cpus=2 + + - name: check k8s cluster status + run: | + kubectl cluster-info + kubectl get pods -n kube-system + + - name: use local disk + run: | + sudo swapoff --all --verbose + sudo umount /mnt + # search for the device since it keeps changing between sda and sdb + sudo wipefs --all --force /dev/$(lsblk|awk '/14G/ {print $1}'| head -1)1 + sudo lsblk + + - name: build rook + run: | + # set VERSION to a dummy value since Jenkins normally sets it for us. Do this to make Helm happy and not fail with "Error: Invalid Semantic Version" + GOPATH=$(go env GOPATH) make clean && make -j$nproc IMAGES='ceph' VERSION=0 build + docker images + docker tag $(docker images|awk '/build-/ {print $1}') rook/ceph:master + + - name: TestCephSmokeSuite + run: | + export DEVICE_FILTER=$(lsblk|awk '/14G/ {print $1}'| head -1) + SKIP_CLEANUP_POLICY=false go test -v -timeout 1800s -run CephSmokeSuite github.com/rook/rook/tests/integration + + - name: Artifact + uses: actions/upload-artifact@v2 + if: failure() + with: + name: ceph-smoke-suite-artifact + path: /home/runner/work/rook/rook/tests/integration/_output/tests/ + + - name: setup tmate session for debugging + if: failure() && contains(github.event.pull_request.labels.*.name, 'debug-smoke-suite') + uses: mxschmitt/action-tmate@v3 diff --git a/.github/workflows/integration-test-upgrade-suite.yaml b/.github/workflows/integration-test-upgrade-suite.yaml index 92d1778ad..f7a3d3361 100644 --- a/.github/workflows/integration-test-upgrade-suite.yaml +++ b/.github/workflows/integration-test-upgrade-suite.yaml @@ -60,3 +60,63 @@ jobs: - name: setup tmate session for debugging if: failure() && contains(github.event.pull_request.labels.*.name, 'debug-upgrade-suite') uses: mxschmitt/action-tmate@v3 + + TestCephUpgradeSuite-Master: + if: github.ref == 'refs/heads/master' || github.ref == 'refs/tags/release-*' + runs-on: ubuntu-18.04 + strategy: + fail-fast: false + matrix: + kubernetes-versions : ['v1.15.12','v1.16.15','v1.18.15','v1.19.7','v1.20.2'] + steps: + - name: checkout + uses: actions/checkout@v2 + + - name: setup golang + uses: actions/setup-go@v2 + with: + go-version: 1.15 + + - name: setup minikube + uses: manusa/actions-setup-minikube@v2.3.1 + with: + minikube version: 'v1.16.0' + kubernetes version: ${{ matrix.kubernetes-versions }} + start args: --memory 6g --cpus=2 + + - name: check k8s cluster status + run: | + kubectl cluster-info + kubectl get pods -n kube-system + + - name: use local disk + run: | + sudo swapoff --all --verbose + sudo umount /mnt + # search for the device since it keeps changing between sda and sdb + sudo wipefs --all --force /dev/$(lsblk|awk '/14G/ {print $1}'| head -1)1 + sudo lsblk + + - name: build rook + run: | + # set VERSION to a dummy value since Jenkins normally sets it for us. Do this to make Helm happy and not fail with "Error: Invalid Semantic Version" + GOPATH=$(go env GOPATH) make clean && make -j$nproc IMAGES='ceph' VERSION=0 build + docker images + docker tag $(docker images|awk '/build-/ {print $1}') rook/ceph:master + + - name: TestCephUpgradeSuite + run: | + export DEVICE_FILTER=$(lsblk|awk '/14G/ {print $1}'| head -1) + go test -v -timeout 1800s -run CephUpgradeSuite github.com/rook/rook/tests/integration + + - name: Artifact + uses: actions/upload-artifact@v2 + if: failure() + with: + name: ceph-upgrade-suite-artifact + path: /home/runner/work/rook/rook/tests/integration/_output/tests/ + + - name: setup tmate session for debugging + if: failure() && contains(github.event.pull_request.labels.*.name, 'debug-upgrade-suite') + uses: mxschmitt/action-tmate@v3 + \ No newline at end of file