Skip to content
This repository has been archived by the owner on Jun 26, 2024. It is now read-only.

cherry-pick(release-v1.3.x): Update Crunchy Postgres Operator to v5.3.0 in acceptance tests #1333

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
92 changes: 91 additions & 1 deletion .github/workflows/pr-checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ env:
SDK_VERSION: "1.17.0"
MINIKUBE_WANTUPDATENOTIFICATION: false
MINIKUBE_WANTREPORTERRORPROMPT: false
K8S_VERSION: "1.19.2"
K8S_VERSION: "1.21.3"
MINIKUBE_VERSION: "1.26.0"
OLM_VERSION: "0.22.0"
TEST_ACCEPTANCE_CLI: "kubectl"
TEST_RESULTS: "out/acceptance-tests"

Expand Down Expand Up @@ -385,6 +386,95 @@ jobs:
name: workload-resource-mapping
path: ${{ env.TEST_RESULTS }}

acceptance-upgrade-with-olm:
name: Acceptance Tests for upgrading SBO with OLM on Kubernetes
runs-on: ubuntu-20.04

env:
EXTRA_BEHAVE_ARGS: "--tags=@upgrade-with-olm --tags=~@disable-github-actions"
TEST_RUN: Acceptance_tests_Upgrade_with_OLM

steps:
- name: Checkout Git Repository
uses: actions/checkout@v3

- name: Check if acceptance tests can be skipped
id: check-skip-acceptance
uses: ./.github/actions/check-skip-acceptance-tests

- name: Set up Python
if: ${{ steps.check-skip-acceptance.outputs.can_skip != 'true' }}
uses: actions/setup-python@v4
with:
python-version: "3.7"
architecture: "x64"

- name: Setup-cli
if: ${{ steps.check-skip-acceptance.outputs.can_skip != 'true' }}
uses: ./.github/actions/setup-cli
with:
start-minikube: true

- name: Install OLM
if: ${{ steps.check-skip-acceptance.outputs.can_skip != 'true' }}
timeout-minutes: 10
run: |
kubectl get crd clusterserviceversions.operators.coreos.com || curl -sL https://github.com/operator-framework/operator-lifecycle-manager/releases/download/v${OLM_VERSION}/install.sh | bash -s v${OLM_VERSION}

- name: Wait for push
if: ${{ steps.check-skip-acceptance.outputs.can_skip != 'true' }}
uses: lewagon/wait-on-check-action@1b1630e169116b58a4b933d5ad7effc46d3d312d
with:
ref: ${{ github.event.pull_request.head.sha }}
check-name: "Push operator images (PR)"
repo-token: ${{ secrets.GITHUB_TOKEN }}
wait-interval: 60

- name: Extract image references
if: ${{ steps.check-skip-acceptance.outputs.can_skip != 'true' }}
uses: pmacik/action-download-multiple-artifacts@node16
with:
names: operator-refs-${{github.event.pull_request.number}}-${{github.event.pull_request.head.sha}}

- name: Acceptance tests
if: ${{ steps.check-skip-acceptance.outputs.can_skip != 'true' }}
timeout-minutes: 60
run: |
source ./operator.refs
export PATH=$PATH:$(pwd)/bin
make opm yq

source ./hack/upgrade-sbo-env.sh

make SKIP_REGISTRY_LOGIN=true -o registry-login test-acceptance

- name: Collect Kube resources
if: ${{ steps.check-skip-acceptance.outputs.can_skip != 'true' && always() }}
continue-on-error: true
uses: ./.github/actions/collect-kube-resources
with:
operator-namespace: operators
olm-namespace: olm
test-namespace-file: out/test-namespace
output-path: ${{env.TEST_RESULTS}}

- name: Setup Testspace
if: ${{ steps.check-skip-acceptance.outputs.can_skip != 'true' && always() }}
uses: testspace-com/setup-testspace@v1
with:
domain: ${{ github.repository_owner }}

- name: Publish tests results to Testspace
if: ${{ steps.check-skip-acceptance.outputs.can_skip != 'true' && always() }}
run: |
testspace [${{ env.TEST_RUN }}]${{ env.TEST_RESULTS }}/TEST*.xml

- uses: actions/upload-artifact@v3
if: ${{ steps.check-skip-acceptance.outputs.can_skip != 'true' && always() }}
with:
name: upgrade-with-olm
path: ${{ env.TEST_RESULTS }}

acceptance_without_olm:
name: Acceptance tests running on Kubernetes without using OLM
runs-on: ubuntu-20.04
Expand Down
4 changes: 2 additions & 2 deletions samples/apps/spring-petclinic/pgcluster-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ kind: PostgresCluster
metadata:
name: hippo
spec:
image: registry.developers.crunchydata.com/crunchydata/crunchy-postgres:ubi8-14.5-1
image: registry.developers.crunchydata.com/crunchydata/crunchy-postgres:ubi8-14.6-2
postgresVersion: 14
instances:
- name: instance1
Expand All @@ -17,7 +17,7 @@ spec:
storage: 1Gi
backups:
pgbackrest:
image: registry.developers.crunchydata.com/crunchydata/crunchy-pgbackrest:ubi8-2.40-1
image: registry.developers.crunchydata.com/crunchydata/crunchy-pgbackrest:ubi8-2.41-2
repos:
- name: repo1
volume:
Expand Down
2 changes: 1 addition & 1 deletion test/acceptance/features/steps/crunchypostgresoperator.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def __init__(self, name="pgo"):
else:
package_name = "postgresql"
catalog_source_name = "operatorhubio-catalog"
csv = "postgresoperator.v5.2.0"
csv = "postgresoperator.v5.3.0"
channel = "v5"

super().__init__(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ Feature: Support a number of existing operator-backed services out of the box
metadata:
name: hippo
spec:
image: registry.developers.crunchydata.com/crunchydata/crunchy-postgres:ubi8-14.5-1
image: registry.developers.crunchydata.com/crunchydata/crunchy-postgres:ubi8-14.6-2
postgresVersion: 14
instances:
- name: instance1
Expand All @@ -116,7 +116,7 @@ Feature: Support a number of existing operator-backed services out of the box
storage: 1Gi
backups:
pgbackrest:
image: registry.developers.crunchydata.com/crunchydata/crunchy-pgbackrest:ubi8-2.40-1
image: registry.developers.crunchydata.com/crunchydata/crunchy-pgbackrest:ubi8-2.41-2
repos:
- name: repo1
volume:
Expand Down