Skip to content

Commit

Permalink
Restructured test steps with logical sequential file names
Browse files Browse the repository at this point in the history
Signed-off-by: Itay Grudev <[email protected]>
  • Loading branch information
itay-grudev committed Aug 1, 2024
1 parent 69f6bef commit 18495cb
Show file tree
Hide file tree
Showing 15 changed files with 67 additions and 65 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: batch/v1
kind: Job
metadata:
name: minio-cleanup
status:
succeeded: 1
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: postgresql.cnpg.io/v1
kind: Cluster
metadata:
name: standalone-cluster
status:
readyInstances: 2
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: batch/v1
kind: Job
metadata:
name: data-write
status:
succeeded: 1
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: postgresql.cnpg.io/v1
kind: Backup
metadata:
name: post-init-backup
spec:
cluster:
name: standalone-cluster
method: barmanObjectStore
status:
phase: running
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: postgresql.cnpg.io/v1
kind: Backup
metadata:
name: post-init-backup
spec:
cluster:
name: standalone-cluster
method: barmanObjectStore
status:
phase: running
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: postgresql.cnpg.io/v1
kind: Cluster
metadata:
name: recovery-backup-cluster
status:
readyInstances: 2
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: batch/v1
kind: Job
metadata:
name: data-test
status:
succeeded: 1
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,15 @@ spec:
- name: Clear the MinIO bucket
try:
- apply:
file: ./minio-cleanup.yaml
file: ./00-minio_cleanup.yaml
- assert:
resource:
apiVersion: batch/v1
kind: Job
metadata:
name: minio-cleanup
status:
succeeded: 1
file: ./00-minio_cleanup-assert.yaml
catch:
- describe:
apiVersion: batch/v1
kind: Job
- podLogs:
name: minio-cleanup
name: minio_cleanup
- name: Install the standalone cluster
try:
- script:
Expand All @@ -34,63 +28,31 @@ spec:
helm upgrade \
--install \
--namespace $NAMESPACE \
--values ./standalone.yaml \
--values ./01-standalone_cluster.yaml \
--wait \
standalone ../../
- assert:
resource:
apiVersion: postgresql.cnpg.io/v1
kind: Cluster
metadata:
name: standalone-cluster
status:
readyInstances: 2
file: 01-standalone_cluster-assert.yaml
catch:
- describe:
apiVersion: postgresql.cnpg.io/v1
kind: Cluster
- name: Crate a table
try:
- apply:
file: ./data-write.yaml
file: ./02-data_write.yaml
- assert:
resource:
apiVersion: batch/v1
kind: Job
metadata:
name: data-write
status:
succeeded: 1
file: ./02-data_write-assert.yaml
- name: Create a backup
try:
- apply:
file: ./backup.yaml
file: ./03-backup.yaml
- assert:
resource:
apiVersion: postgresql.cnpg.io/v1
kind: Backup
metadata:
name: post-init-backup
spec:
cluster:
name: standalone-cluster
method: barmanObjectStore
status:
phase: running
file: ./03-backup_running-assert.yaml
- apply:
file: ./checkpoint.yaml
file: ./03-checkpoint.yaml
- assert:
resource:
apiVersion: postgresql.cnpg.io/v1
kind: Backup
metadata:
name: post-init-backup
spec:
cluster:
name: standalone-cluster
method: barmanObjectStore
status:
phase: completed
file: ./03-backup_running-assert.yaml
timeouts:
apply: 1s
assert: 10m
Expand All @@ -105,27 +67,17 @@ spec:
helm upgrade \
--install \
--namespace $NAMESPACE \
--values ./recovery-backup.yaml \
--values ./04-recovery_backup_cluster.yaml \
--wait \
recovery-backup ../../
- assert:
resource:
apiVersion: postgresql.cnpg.io/v1
kind: Cluster
metadata:
name: standalone-cluster
status:
readyInstances: 2
file: ./04-recovery_backup_cluster-assert.yaml
- name: Verify the table exists
try:
- apply:
file: data-test.yaml
file: 05-data_test.yaml
- assert:
resource:
apiVersion: batch/v1
kind: Job
metadata:
name: data-test
status:
succeeded: 1
file: 05-data_test-assert.yaml
- name: Cleanup
try:
- script:
Expand Down

0 comments on commit 18495cb

Please sign in to comment.