Skip to content

Commit 33ffa86

Browse files
Merge branch 'master' into secret-reconcile
Signed-off-by: Anisur Rahman <[email protected]>
2 parents c642a9c + a3b858e commit 33ffa86

File tree

9 files changed

+587
-1
lines changed

9 files changed

+587
-1
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Manual 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+
manual-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: gen cli
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}'))

deploy/role_core.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,13 @@ rules:
4545
- securitycontextconstraints
4646
verbs:
4747
- use
48+
- apiGroups:
49+
- route.openshift.io
50+
resources:
51+
- routes
52+
verbs:
53+
- get
54+
- create
55+
- update
56+
- list
57+
- watch

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).

pkg/bundle/deploy.go

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6602,7 +6602,7 @@ subjects:
66026602
name: custom-metrics-prometheus-adapter
66036603
`
66046604

6605-
const Sha256_deploy_role_core_yaml = "c3cfb5b87298224fd6e4e4bff32d3948ad168a0110b8569118a260739ef5d5e7"
6605+
const Sha256_deploy_role_core_yaml = "1ec420603dcec64b247852d106535a85a1a866129f78f790c2e5c9285f029ae7"
66066606

66076607
const File_deploy_role_core_yaml = `apiVersion: rbac.authorization.k8s.io/v1
66086608
kind: Role
@@ -6651,6 +6651,16 @@ rules:
66516651
- securitycontextconstraints
66526652
verbs:
66536653
- use
6654+
- apiGroups:
6655+
- route.openshift.io
6656+
resources:
6657+
- routes
6658+
verbs:
6659+
- get
6660+
- create
6661+
- update
6662+
- list
6663+
- watch
66546664
`
66556665

66566666
const Sha256_deploy_role_db_yaml = "bc7eeca1125dfcdb491ab8eb69e3dcbce9f004a467b88489f85678b3c6872cce"

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)