Skip to content

Commit 2d33c0b

Browse files
authored
Merge pull request #1662 from romayalon/romy-upgrade-tests
CI | Upgrade Tests
2 parents e52237f + 6733bf5 commit 2d33c0b

File tree

7 files changed

+566
-0
lines changed

7 files changed

+566
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Full Upgrade Test
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
source_version:
6+
description: "Version to upgrade From"
7+
required: false
8+
target_version:
9+
description: "Version to upgrade to"
10+
required: false
11+
12+
jobs:
13+
nightly-upgrade-tests:
14+
uses: ./.github/workflows/upgrade-tests-workflow.yaml
15+
secrets: inherit
16+
with:
17+
source_version: ${{ github.event.inputs.source_version }}
18+
target_version: ${{ github.event.inputs.target_version }}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
name: Nightly Upgrade Tests
2+
on:
3+
schedule:
4+
- cron: '0 4 * * *'
5+
6+
jobs:
7+
nightly-upgrade-tests:
8+
uses: ./.github/workflows/upgrade-tests-workflow.yaml
9+
secrets: inherit
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Upgrade Tests Workflow
2+
on:
3+
workflow_call:
4+
inputs:
5+
source_version:
6+
type: string
7+
description: "Version to upgrade From"
8+
required: false
9+
target_version:
10+
type: string
11+
description: "Version to upgrade to"
12+
required: false
13+
14+
jobs:
15+
upgrade-tests-workflow:
16+
runs-on: ubuntu-latest
17+
timeout-minutes: 90
18+
concurrency:
19+
group: ${{ github.workflow }}-${{ github.ref }}
20+
cancel-in-progress: true
21+
steps:
22+
- name: checkout
23+
uses: actions/checkout@v4
24+
- uses: actions/setup-go@v5
25+
with:
26+
go-version: "1.23"
27+
28+
- name: Set environment variables
29+
run: |
30+
echo PATH=$PATH:$HOME/go/bin >> $GITHUB_ENV
31+
32+
- name: Deploy Dependencies
33+
run: |
34+
set -x
35+
bash .travis/install-5nodes-kind-cluster.sh
36+
go get -v github.com/onsi/ginkgo/v2
37+
go install -v github.com/onsi/ginkgo/v2/ginkgo
38+
ginkgo version
39+
40+
- name: Run Upgrade test
41+
run: UPGRADE_TEST_OPERATOR_SOURCE_VERSION=${{ inputs.source_version }} UPGRADE_TEST_OPERATOR_TARGET_VERSION=${{ inputs.target_version }} make test-upgrade

Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,11 @@ test-validations:
305305
@echo "✅ test-validations"
306306
.PHONY: test-validations
307307

308+
test-upgrade: vendor
309+
ginkgo -v test/upgrade
310+
@echo "✅ test-upgrade"
311+
.PHONY: test-upgrade
312+
308313
# find or download controller-gen if necessary
309314
controller-gen:
310315
ifneq ($(CONTROLLER_GEN_VERSION), $(shell controller-gen --version | awk -F ":" '{print $2}'))

doc/CI&Tests/UpgradeTests.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# NooBaa Operator - CI & Tests
2+
3+
1. [Introduction](#introduction)
4+
2. [Upgrade Tests](#upgrade-tests)
5+
6+
## Introduction
7+
8+
NooBaa employs a Continuous Integration (CI) process to ensure the reliability and quality of its software.
9+
NooBaa Tests cover various aspects of functionality and integration.
10+
This proactive approach to testing enables NooBaa to deliver stable and efficient solutions for its users.
11+
12+
## Upgrade Tests
13+
14+
The NooBaa operator upgrade tests are part of the continuous integration (CI) pipeline and are designed to verify the stability and reliability of the system during version transitions.
15+
16+
The upgrade test process includes the following steps:
17+
18+
1. **Initial Deployment**: The latest release of the NooBaa operator is deployed on a Kubernetes cluster by default, see - [NooBaa Latest Release](https://api.github.com/repos/noobaa/noobaa-operator/releases/latest).
19+
2. **System Initialization**: A fully functional NooBaa system is created, including resources such as buckets, objects, backing stores, and endpoints.
20+
3. **Upgrade Execution**: The operator is upgraded to the target version using the noobaa CLI, the default target version is the latest noobaa-operator nightly build that could be found in [quay.io/noobaa/noobaa-operator](https://quay.io/repository/noobaa/noobaa-operator?tab=tags).
21+
4. **Post-Upgrade Validation**: The health and functionality of the NooBaa system are verified after the upgrade. This includes checking the readiness of control plane components, data accessibility, and the integrity of configurations and runtime state.
22+
23+
These tests simulate upgrade scenarios and are continuously executed in the CI pipeline to detect upgrade-related issues early and ensure smooth operator version transitions.
24+
25+
### Run upgrade tests locally
26+
27+
In order to run upgrade tests locally with the default source and target versions, run the following command -
28+
```bash
29+
make test-upgrade
30+
```
31+
32+
In order to run upgrade tests locally with custom source and target versions, run the following command -
33+
```bash
34+
UPGRADE_TEST_OPERATOR_SOURCE_VERSION=<upgrade-operator-source-version> UPGRADE_TEST_OPERATOR_TARGET_VERSION=<upgrade-operator-target-version> make test-upgrade
35+
```
36+
37+
For instance -
38+
```bash
39+
UPGRADE_TEST_OPERATOR_SOURCE_VERSION=5.17.0 UPGRADE_TEST_OPERATOR_TARGET_VERSION=5.18.6 make test-upgrade
40+
```
41+
42+
### Manual Upgrade Tests Action
43+
44+
The following action is a dispatchable GitHub Action for running the upgrade tests manually.
45+
It was implemented as part of the continuous integration (CI) process to allow on-demand execution of upgrade scenarios outside the scheduled or automated test pipeline.
46+
See - [Manual Upgrade Tests Action](../../.github/workflows/manual-upgrade-tests.yaml).
47+
48+
### Nightly Upgrade Tests Action
49+
50+
A nightly Upgrade tests github actions runs every night at 4AM UTC.
51+
See - [Nightly Upgrade Tests Action](../../.github/workflows/nightly-upgrade-tests.yaml).

test/upgrade/upgrade_suit_test.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package upgrade_test
2+
3+
import (
4+
"testing"
5+
6+
. "github.com/onsi/ginkgo/v2"
7+
. "github.com/onsi/gomega"
8+
)
9+
10+
func TestUpgrade(t *testing.T) {
11+
RegisterFailHandler(Fail)
12+
RunSpecs(t, "Upgrade Suite")
13+
}

0 commit comments

Comments
 (0)