Skip to content

Commit

Permalink
Added upgrade tests
Browse files Browse the repository at this point in the history
Signed-off-by: Aayush Chouhan <[email protected]>
  • Loading branch information
achouhan09 committed Nov 12, 2024
1 parent 58f9ebc commit 1032b01
Show file tree
Hide file tree
Showing 3 changed files with 98 additions and 0 deletions.
91 changes: 91 additions & 0 deletions .github/workflows/upgrade-tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
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 || '5.17' }}

steps:
- name: Checkout noobaa-core
uses: actions/checkout@v4
with:
repository: 'noobaa/noobaa-core'
path: 'noobaa-core'

- name: Save current branch name
run: |
cd ./noobaa-core
echo "CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD)" >> $GITHUB_ENV
- name: Checkout and install version ${{ env.BRANCH_NAME }}
run: |
cd ./noobaa-core
git remote add upstream https://github.com/noobaa/noobaa-core.git
git fetch upstream ${{ env.BRANCH_NAME }}:${{ env.BRANCH_NAME }}
git checkout ${{ env.BRANCH_NAME }}
git reset --hard upstream/${{ env.BRANCH_NAME }}
- name: Deploy minikube
run: |
cd ./noobaa-core
sudo bash ./.travis/deploy_minikube.sh
- name: Build noobaa tester
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'
ref: ${{ env.BRANCH_NAME }}

- 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 back to current branch
run: |
cd ./noobaa-core
git checkout ${{ env.CURRENT_BRANCH }}
- name: Run Upgrade Tests
run: |
set -x
cd ./noobaa-core
make test-upgrade
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions src/test/system_tests/run_upgrade_tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
echo "Executing upgrade tests..."
# TODO

0 comments on commit 1032b01

Please sign in to comment.