Skip to content

Commit

Permalink
Make e2e more robust
Browse files Browse the repository at this point in the history
Some of the statusfields in the status object will never actually become true, even thought the instance comes up correctly.

These status fields are deprecated and we have proper replacements for them. However Redis hasn't yet been migrated to comp functions.

So for now we don't assert these fields anymore to make sure the e2e tests work again.

Other changes:
- Make sure to remove any old claims before running
- Leave more spaces between the test names, so we don't have to rename all if we want to add one in between
- Make maintenance script sturdier
  • Loading branch information
Kidswiss committed Jan 8, 2025
1 parent 16d32d6 commit 3aa6c0d
Show file tree
Hide file tree
Showing 66 changed files with 147 additions and 40 deletions.
3 changes: 3 additions & 0 deletions tests/e2e/keycloak/00-install.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Install with disabled protection
apiVersion: vshn.appcat.vshn.io/v1
kind: VSHNKeycloak
metadata:
Expand All @@ -6,5 +7,7 @@ spec:
parameters:
service:
fqdn: keycloak-e2e.example.com
security:
deletionProtection: false
writeConnectionSecretToRef:
name: keycloak-e2e
14 changes: 14 additions & 0 deletions tests/e2e/keycloak/01-delete.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Remove any leftover objects
apiVersion: kuttl.dev/v1beta1
kind: TestStep
delete:
- apiVersion: vshn.appcat.vshn.io/v1
kind: VSHNKeycloak
name: keycloak-e2e
- apiVersion: batch/v1
kind: Job
name: connect-keycloak-e2e
- apiVersion: v1
kind: Pod
labels:
e2e-test: keycloak-e2e
File renamed without changes.
File renamed without changes.
10 changes: 10 additions & 0 deletions tests/e2e/keycloak/10-install.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: vshn.appcat.vshn.io/v1
kind: VSHNKeycloak
metadata:
name: keycloak-e2e
spec:
parameters:
service:
fqdn: keycloak-e2e.example.com
writeConnectionSecretToRef:
name: keycloak-e2e
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion tests/e2e/kuttl-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ kind: TestSuite
testDirs:
- ./test/e2e/
namespace: appcat-e2e
parallel: 1
parallel: 2
4 changes: 3 additions & 1 deletion tests/e2e/mariadb/00-install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ metadata:
name: mariadb-e2e
spec:
parameters:
service:
instances: 3
security:
deletionProtection: false
size:
plan: standard-2
writeConnectionSecretToRef:
Expand Down
14 changes: 14 additions & 0 deletions tests/e2e/mariadb/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-mariadb
- apiVersion: v1
kind: Pod
labels:
e2e-test: mariadb
- apiVersion: vshn.appcat.vshn.io/v1
kind: VSHNMariaDB
name: mariadb-e2e
File renamed without changes.
11 changes: 11 additions & 0 deletions tests/e2e/mariadb/10-install.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: vshn.appcat.vshn.io/v1
kind: VSHNMariaDB
metadata:
name: mariadb-e2e
spec:
parameters:
service:
size:
plan: standard-2
writeConnectionSecretToRef:
name: mariadb-creds
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 2 additions & 0 deletions tests/e2e/nextcloud/00-install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,7 @@ spec:
service:
fqdn:
- nextcloud-e2e.example.com
security:
deletionProtection: false
writeConnectionSecretToRef:
name: nextcloud-e2e
13 changes: 13 additions & 0 deletions tests/e2e/nextcloud/01-delete.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: kuttl.dev/v1beta1
kind: TestStep
delete:
- apiVersion: vshn.appcat.vshn.io/v1
kind: VSHNNextcloud
name: nextcloud-e2e
- apiVersion: batch/v1
kind: Job
name: connect-nextcloud-e2e
- apiVersion: v1
kind: Pod
labels:
e2e-test: nextcloud-e2e
File renamed without changes.
11 changes: 11 additions & 0 deletions tests/e2e/nextcloud/10-install.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: vshn.appcat.vshn.io/v1
kind: VSHNNextcloud
metadata:
name: nextcloud-e2e
spec:
parameters:
service:
fqdn:
- nextcloud-e2e.example.com
writeConnectionSecretToRef:
name: nextcloud-e2e
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ metadata:
name: postgresql-e2e-test
spec:
parameters:
size:
plan: standard-2
service:
vacuumEnabled: true
repackEnabled: true
size:
plan: standard-2
writeConnectionSecretToRef:
name: postgresql-e2e-test-creds
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
15 changes: 15 additions & 0 deletions tests/e2e/postgresql/80-install.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: vshn.appcat.vshn.io/v1
kind: VSHNPostgreSQL
metadata:
name: postgresql-e2e-test
spec:
parameters:
size:
plan: standard-2
security:
deletionProtection: false
service:
vacuumEnabled: true
repackEnabled: false
writeConnectionSecretToRef:
name: postgresql-e2e-test-creds
14 changes: 14 additions & 0 deletions tests/e2e/postgresql/999-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
8 changes: 4 additions & 4 deletions tests/e2e/postgresql/scripts/trigger-maintenance.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,16 +57,16 @@ kubectl -n "$ns" wait --for=condition=complete --timeout=1000s job/test
# I have to wait for job/jobs completion otherwise stackgres will recreate that even if I delete it...
if [ "$to_be_found" == "r" ]; then
kubectl -n "$ns" get job
kubectl -n "$ns" get job databasesrepack
kubectl -n "$ns" wait --for=create job/databasesrepack
kubectl -n "$ns" wait --for=condition=complete --timeout=1000s job/databasesrepack
elif [ "$to_be_found" == "v" ]; then
kubectl -n "$ns" get job
kubectl -n "$ns" get job vacuum
kubectl -n "$ns" wait --for=create job/vacuum
kubectl -n "$ns" wait --for=condition=complete --timeout=1000s job/vacuum
elif [ "$to_be_found" == "b" ]; then
kubectl -n "$ns" get job
kubectl -n "$ns" get job databasesrepack
kubectl -n "$ns" get job vacuum
kubectl -n "$ns" wait --for=create job/databasesrepack
kubectl -n "$ns" wait --for=create job/vacuum
kubectl -n "$ns" wait --for=condition=complete --timeout=1000s job/databasesrepack
kubectl -n "$ns" wait --for=condition=complete --timeout=1000s job/vacuum
else
Expand Down
2 changes: 2 additions & 0 deletions tests/e2e/redis/00-install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ metadata:
name: redis-e2e-test
spec:
parameters:
security:
deletionProtection: false
size:
plan: standard-2
writeConnectionSecretToRef:
Expand Down
14 changes: 14 additions & 0 deletions tests/e2e/redis/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-redis
- apiVersion: v1
kind: Pod
labels:
e2e-test: redis
- apiVersion: vshn.appcat.vshn.io/v1
kind: VSHNRedis
name: redis-e2e-test
15 changes: 0 additions & 15 deletions tests/e2e/redis/00-assert.yaml → tests/e2e/redis/10-assert.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,24 +33,9 @@ spec:
writeConnectionSecretToRef:
name: redis-e2e-test-creds
status:
caCertificateConditions:
- status: "True"
- status: "True"
clientCertificateConditions:
- status: "True"
- status: "True"
conditions:
- status: "True"
- status: "True"
localCAConditions:
- status: "True"
- status: "True"
selfSignedIssuerConditions:
- status: "True"
- status: "True"
serverCertificateConditions:
- status: "True"
- status: "True"

---
apiVersion: v1
Expand Down
10 changes: 10 additions & 0 deletions tests/e2e/redis/10-install.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: vshn.appcat.vshn.io/v1
kind: VSHNRedis
metadata:
name: redis-e2e-test
spec:
parameters:
size:
plan: standard-2
writeConnectionSecretToRef:
name: redis-e2e-test-creds
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
15 changes: 0 additions & 15 deletions tests/e2e/redis/04-assert.yaml → tests/e2e/redis/50-assert.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,24 +33,9 @@ spec:
writeConnectionSecretToRef:
name: redis-e2e-test-creds
status:
caCertificateConditions:
- status: "True"
- status: "True"
clientCertificateConditions:
- status: "True"
- status: "True"
conditions:
- status: "True"
- status: "True"
localCAConditions:
- status: "True"
- status: "True"
selfSignedIssuerConditions:
- status: "True"
- status: "True"
serverCertificateConditions:
- status: "True"
- status: "True"

---
apiVersion: v1
Expand Down

0 comments on commit 3aa6c0d

Please sign in to comment.