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 19, 2024
1 parent 7bc42c2 commit 3f4cf92
Show file tree
Hide file tree
Showing 3 changed files with 86 additions and 0 deletions.
79 changes: 79 additions & 0 deletions .github/workflows/upgrade-tests.yaml
Original file line number Diff line number Diff line change
@@ -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
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 3f4cf92

Please sign in to comment.