diff --git a/.github/workflows/upgrade-tests.yaml b/.github/workflows/upgrade-tests.yaml new file mode 100644 index 0000000000..3ca436f811 --- /dev/null +++ b/.github/workflows/upgrade-tests.yaml @@ -0,0 +1,79 @@ +name: Upgrade Tests +on: [push, pull_request, workflow_dispatch] + +jobs: + upgrade-tests: + runs-on: ubuntu-latest + timeout-minutes: 90 + concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + + env: + BRANCH_NAME: ${{ github.event.inputs.branch || 'master' }} + + steps: + - name: Checkout noobaa-core (master/input branch) + uses: actions/checkout@v4 + with: + repository: 'noobaa/noobaa-core' + path: 'noobaa-core' + ref: ${{ env.BRANCH_NAME }} + + - name: Deploy minikube + run: | + cd ./noobaa-core + sudo bash ./.travis/deploy_minikube.sh + + - name: Build noobaa tester (from master) + run: | + cd ./noobaa-core + make tester TESTER_TAG=noobaa-tester:upgrade-tests + docker tag noobaa:latest noobaa-core:upgrade-tests + + - name: Checkout noobaa-operator + uses: actions/checkout@v3 + with: + repository: 'noobaa/noobaa-operator' + path: 'noobaa-operator' + + - name: Change settings for k8s and minikube + run: | + sudo mv /root/.kube /root/.minikube $HOME + sudo chown -R $USER $HOME/.kube $HOME/.minikube + sed "s/root/home\/$USER/g" $HOME/.kube/config > tmp; mv tmp $HOME/.kube/config + + - name: Build operator + run: | + cd ./noobaa-operator + make all + + - name: Install noobaa system + run: | + cd ./noobaa-operator + ./build/_output/bin/noobaa-operator crd create + ./build/_output/bin/noobaa-operator operator install + ./build/_output/bin/noobaa-operator system create \ + --db-resources='{ "limits": {"cpu": "200m","memory": "2G"}, "requests": {"cpu": "200m","memory": "2G"}}' \ + --core-resources='{ "limits": {"cpu": "200m","memory": "1G"}, "requests": {"cpu": "200m","memory": "1G"}}' \ + --endpoint-resources='{ "limits": {"cpu": "200m","memory": "1G"}, "requests": {"cpu": "200m","memory": "1G"}}' \ + --noobaa-image='noobaa-core:upgrade-tests' + ./build/_output/bin/noobaa-operator status + + - name: Wait for phase Ready in the backingstore pod + run: | + cd ./noobaa-operator + ./.travis/number_of_pods_in_system.sh --pods 5 + kubectl wait --for=condition=available backingstore/noobaa-default-backing-store --timeout=5m + + - name: Checkout noobaa-core (latest) + uses: actions/checkout@v4 + with: + repository: 'noobaa/noobaa-core' + path: 'noobaa-core' + + - name: Run Upgrade Tests (PR code) + run: | + set -x + cd ./noobaa-core + make test-upgrade diff --git a/Makefile b/Makefile index fe9057de73..4570ce2ade 100644 --- a/Makefile +++ b/Makefile @@ -332,6 +332,11 @@ test-external-pg-sanity: build-ssl-postgres @$(call remove_docker_network) .PHONY: test-external-pg-sanity +test-upgrade: tester + @echo "\033[1;34mRunning Upgrade Tests - after upgrading from 5.17.0 to latest\033[0m" + ./src/test/system_tests/run_upgrade_tests.sh || exit 1 +.PHONY: test-upgrade + clean: @echo Stopping and Deleting containers @$(CONTAINER_ENGINE) ps -a | grep noobaa_ | awk '{print $1}' | xargs $(CONTAINER_ENGINE) stop &> /dev/null diff --git a/src/test/system_tests/run_upgrade_tests.sh b/src/test/system_tests/run_upgrade_tests.sh new file mode 100644 index 0000000000..c651422687 --- /dev/null +++ b/src/test/system_tests/run_upgrade_tests.sh @@ -0,0 +1,2 @@ +echo "Executing upgrade tests..." +# TODO \ No newline at end of file