Skip to content

Commit

Permalink
Make sure we start with a clean slate
Browse files Browse the repository at this point in the history
  • Loading branch information
Kidswiss committed Jan 8, 2025
1 parent c0e1f29 commit 2fd815e
Show file tree
Hide file tree
Showing 20 changed files with 102 additions and 73 deletions.
2 changes: 2 additions & 0 deletions tests/e2e/postgresql/00-install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ metadata:
name: postgresql-e2e-test
spec:
parameters:
security:
deletionProtection: false
service:
vacuumEnabled: true
repackEnabled: true
Expand Down
14 changes: 14 additions & 0 deletions tests/e2e/postgresql/01-delete.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: kuttl.dev/v1beta1
kind: TestStep
delete:
# This will wait until resources are really gone
- apiVersion: batch/v1
kind: Job
name: connect-postgresql
- apiVersion: v1
kind: Pod
labels:
e2e-test: postgresql
- apiVersion: vshn.appcat.vshn.io/v1
kind: VSHNPostgreSQL
name: postgresql-e2e-test
51 changes: 41 additions & 10 deletions tests/e2e/postgresql/02-assert.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,45 @@
apiVersion: kuttl.dev/v1beta1
kind: TestAssert
timeout: 240
timeout: 180
---
apiVersion: batch/v1
kind: Job
apiVersion: vshn.appcat.vshn.io/v1
kind: VSHNPostgreSQL
metadata:
name: connect-postgresql
status:
conditions:
- type: Complete
status: 'True'
succeeded: 1
ready: 0
finalizers:
- finalizer.apiextensions.crossplane.io
name: postgresql-e2e-test
spec:
compositeDeletePolicy: Background
compositionRef:
name: vshnpostgres.vshn.appcat.vshn.io
compositionUpdatePolicy: Automatic
parameters:
backup:
deletionRetention: 7
retention: 6
instances: 1
security:
deletionProtection: true
service:
vacuumEnabled: true
repackEnabled: true
majorVersion: "15"
serviceLevel: besteffort
size:
plan: standard-2
resourceRef:
apiVersion: vshn.appcat.vshn.io/v1
kind: XVSHNPostgreSQL
writeConnectionSecretToRef:
name: postgresql-e2e-test-creds

---
apiVersion: v1
kind: Secret
type: connection.crossplane.io/v1alpha1
metadata:
name: postgresql-e2e-test-creds
ownerReferences:
- apiVersion: vshn.appcat.vshn.io/v1
kind: VSHNPostgreSQL
name: postgresql-e2e-test
6 changes: 3 additions & 3 deletions tests/e2e/postgresql/02-install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ metadata:
name: postgresql-e2e-test
spec:
parameters:
backup:
deletionRetention: 7
retention: 6
service:
vacuumEnabled: true
repackEnabled: true
size:
plan: standard-2
writeConnectionSecretToRef:
Expand Down
45 changes: 0 additions & 45 deletions tests/e2e/postgresql/03-assert.yaml

This file was deleted.

14 changes: 14 additions & 0 deletions tests/e2e/postgresql/04-assert.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: kuttl.dev/v1beta1
kind: TestAssert
timeout: 240
---
apiVersion: batch/v1
kind: Job
metadata:
name: connect-postgresql
status:
conditions:
- type: Complete
status: 'True'
succeeded: 1
ready: 0
File renamed without changes.
13 changes: 13 additions & 0 deletions tests/e2e/postgresql/04-install.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: vshn.appcat.vshn.io/v1
kind: VSHNPostgreSQL
metadata:
name: postgresql-e2e-test
spec:
parameters:
backup:
deletionRetention: 7
retention: 6
size:
plan: standard-2
writeConnectionSecretToRef:
name: postgresql-e2e-test-creds
2 changes: 1 addition & 1 deletion tests/e2e/postgresql/05-assert.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ spec:
security:
deletionProtection: true
service:
vacuumEnabled: false
vacuumEnabled: true
repackEnabled: true
majorVersion: "15"
serviceLevel: besteffort
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/postgresql/05-install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ spec:
size:
plan: standard-2
service:
vacuumEnabled: false
vacuumEnabled: true
repackEnabled: true
writeConnectionSecretToRef:
name: postgresql-e2e-test-creds
2 changes: 1 addition & 1 deletion tests/e2e/postgresql/06-validate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
apiVersion: kuttl.dev/v1beta1
kind: TestStep
commands:
- script: scripts/trigger-maintenance.sh vshnpostgresql postgresql-e2e-test r
- script: scripts/trigger-maintenance.sh vshnpostgresql postgresql-e2e-test b
timeout: 1000
4 changes: 2 additions & 2 deletions tests/e2e/postgresql/07-assert.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ spec:
security:
deletionProtection: true
service:
vacuumEnabled: true
repackEnabled: false
vacuumEnabled: false
repackEnabled: true
majorVersion: "15"
serviceLevel: besteffort
size:
Expand Down
4 changes: 2 additions & 2 deletions tests/e2e/postgresql/07-install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ spec:
size:
plan: standard-2
service:
vacuumEnabled: true
repackEnabled: false
vacuumEnabled: false
repackEnabled: true
writeConnectionSecretToRef:
name: postgresql-e2e-test-creds
2 changes: 1 addition & 1 deletion tests/e2e/postgresql/08-validate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
apiVersion: kuttl.dev/v1beta1
kind: TestStep
commands:
- script: scripts/trigger-maintenance.sh vshnpostgresql postgresql-e2e-test v
- script: scripts/trigger-maintenance.sh vshnpostgresql postgresql-e2e-test r
timeout: 1000
2 changes: 1 addition & 1 deletion tests/e2e/postgresql/09-assert.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ spec:
retention: 6
instances: 1
security:
deletionProtection: false
deletionProtection: true
service:
vacuumEnabled: true
repackEnabled: false
Expand Down
2 changes: 0 additions & 2 deletions tests/e2e/postgresql/09-install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ spec:
parameters:
size:
plan: standard-2
security:
deletionProtection: false
service:
vacuumEnabled: true
repackEnabled: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
apiVersion: kuttl.dev/v1beta1
kind: TestStep
commands:
- script: scripts/trigger-maintenance.sh vshnpostgresql postgresql-e2e-test b
- script: scripts/trigger-maintenance.sh vshnpostgresql postgresql-e2e-test v
timeout: 1000
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ spec:
retention: 6
instances: 1
security:
deletionProtection: true
deletionProtection: false
service:
vacuumEnabled: true
repackEnabled: true
repackEnabled: false
majorVersion: "15"
serviceLevel: besteffort
size:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ spec:
parameters:
size:
plan: standard-2
security:
deletionProtection: false
service:
vacuumEnabled: true
repackEnabled: true
repackEnabled: false
writeConnectionSecretToRef:
name: postgresql-e2e-test-creds

0 comments on commit 2fd815e

Please sign in to comment.