Skip to content

Commit

Permalink
Add initial e2e test for mariadb operator
Browse files Browse the repository at this point in the history
This commit adds a new test step to install mariadb operator
and execute a basic test. It adds a new workflow for mariadb-operator
to be used on a e2e test.
It also adds a new pre-submit test that claims a SNO cluster from
vexxhost cloud, managed by Hive operator.
  • Loading branch information
viroel committed Sep 30, 2022
1 parent 38d09a6 commit 5eedb6a
Show file tree
Hide file tree
Showing 10 changed files with 222 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,22 @@ base_images:
name: golangci-lint
namespace: ci
tag: v1.46.0
openstack-installer:
name: "4.10"
namespace: ocp
tag: openstack-installer
binary_build_commands: make build
build_root:
image_stream_tag:
name: release
namespace: openshift
tag: golang-1.18
releases:
latest:
integration:
include_built_images: true
name: "4.10"
namespace: ocp
resources:
'*':
limits:
Expand Down Expand Up @@ -42,6 +52,16 @@ tests:
commands: make gofmt || true
container:
from: src
- as: mariadb-operator-e2e
cluster_claim:
architecture: amd64
cloud: vexxhost
owner: openstack-k8s-operators
product: ocp
timeout: 1h0m0s
version: "4.10"
steps:
workflow: openstack-k8s-operators-mariadb-e2e
zz_generated_metadata:
branch: master
org: openstack-k8s-operators
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,69 @@ presubmits:
secret:
secretName: result-aggregator
trigger: (?m)^/test( | .* )govet,?($|\s.*)
- agent: kubernetes
always_run: true
branches:
- ^master$
- ^master-
cluster: build04
context: ci/prow/mariadb-operator-e2e
decorate: true
decoration_config:
skip_cloning: true
labels:
ci.openshift.io/generator: prowgen
pj-rehearse.openshift.io/can-be-rehearsed: "true"
name: pull-ci-openstack-k8s-operators-mariadb-operator-master-mariadb-operator-e2e
rerun_command: /test mariadb-operator-e2e
spec:
containers:
- args:
- --gcs-upload-secret=/secrets/gcs/service-account.json
- --hive-kubeconfig=/secrets/hive-hive-credentials/kubeconfig
- --image-import-pull-secret=/etc/pull-secret/.dockerconfigjson
- --report-credentials-file=/etc/report/credentials
- --secret-dir=/secrets/ci-pull-credentials
- --target=mariadb-operator-e2e
command:
- ci-operator
image: ci-operator:latest
imagePullPolicy: Always
name: ""
resources:
requests:
cpu: 10m
volumeMounts:
- mountPath: /secrets/ci-pull-credentials
name: ci-pull-credentials
readOnly: true
- mountPath: /secrets/gcs
name: gcs-credentials
readOnly: true
- mountPath: /secrets/hive-hive-credentials
name: hive-hive-credentials
readOnly: true
- mountPath: /etc/pull-secret
name: pull-secret
readOnly: true
- mountPath: /etc/report
name: result-aggregator
readOnly: true
serviceAccountName: ci-operator
volumes:
- name: ci-pull-credentials
secret:
secretName: ci-pull-credentials
- name: hive-hive-credentials
secret:
secretName: hive-hive-credentials
- name: pull-secret
secret:
secretName: registry-pull-credentials
- name: result-aggregator
secret:
secretName: result-aggregator
trigger: (?m)^/test( | .* )mariadb-operator-e2e,?($|\s.*)
- agent: kubernetes
always_run: true
branches:
Expand Down
15 changes: 15 additions & 0 deletions ci-operator/step-registry/openstack-k8s-operators/OWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
approvers:
- abays
- dprince
- olliewalsh
- Sandeepyadav93
- stuggi
- viroel
options: {}
reviewers:
- abays
- dprince
- olliewalsh
- Sandeepyadav93
- stuggi
- viroel
15 changes: 15 additions & 0 deletions ci-operator/step-registry/openstack-k8s-operators/mariadb/OWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
approvers:
- abays
- dprince
- olliewalsh
- Sandeepyadav93
- stuggi
- viroel
options: {}
reviewers:
- abays
- dprince
- olliewalsh
- Sandeepyadav93
- stuggi
- viroel
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
approvers:
- abays
- dprince
- olliewalsh
- Sandeepyadav93
- stuggi
- viroel
options: {}
reviewers:
- abays
- dprince
- olliewalsh
- Sandeepyadav93
- stuggi
- viroel
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/usr/bin/env bash

set -ex

cd $HOME
# Setting up kustomize, needed by install_yamls makefile
mkdir bin
export PATH=$PATH:$HOME/bin
cd $HOME/bin
curl -s "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" | bash
cd $HOME
# Get install_yamls
rm -rf install_yamls
git clone https://github.com/openstack-k8s-operators/install_yamls.git
cd $HOME/install_yamls
# Sets namespace to 'openstack'
export NAMESPACE=openstack
# Creates namespace
make namespace
sleep 5
# Creates storage needed for mariadb
make crc_storage
sleep 20
# Deploy mariadb operator
make mariadb
sleep 120
# Deploy mariadb service
make mariadb_deploy
sleep 120
# Get all resources
oc get all
# Show mariadb databases
oc exec -it pod/mariadb-openstack -- mysql -uroot -p12345678 -e "show databases;"
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"path": "openstack-k8s-operators/mariadb/e2e/openstack-k8s-operators-mariadb-e2e-ref.yaml",
"owners": {
"approvers": [
"abays",
"dprince",
"olliewalsh",
"Sandeepyadav93",
"stuggi",
"viroel"
],
"reviewers": [
"abays",
"dprince",
"olliewalsh",
"Sandeepyadav93",
"stuggi",
"viroel"
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
ref:
as: openstack-k8s-operators-mariadb-e2e
from: openstack-installer
commands: openstack-k8s-operators-mariadb-e2e-commands.sh
resources:
requests:
cpu: 1000m
memory: 100Mi
documentation: |-
This is a test step to install mariadb operator and do some basic tests.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"path": "openstack-k8s-operators/mariadb/e2e/openstack-k8s-operators-mariadb-e2e-workflow.yaml",
"owners": {
"approvers": [
"abays",
"dprince",
"olliewalsh",
"Sandeepyadav93",
"stuggi",
"viroel"
],
"reviewers": [
"abays",
"dprince",
"olliewalsh",
"Sandeepyadav93",
"stuggi",
"viroel"
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
workflow:
as: openstack-k8s-operators-mariadb-e2e
steps:
pre:
- ref: ipi-install-rbac
test:
- ref: openstack-k8s-operators-mariadb-e2e
documentation: |-
Test mariadb operator deployment.

0 comments on commit 5eedb6a

Please sign in to comment.