Skip to content

Commit

Permalink
Refactor tests
Browse files Browse the repository at this point in the history
  • Loading branch information
allanger committed Jan 14, 2024
1 parent 0b43ebf commit e869872
Show file tree
Hide file tree
Showing 11 changed files with 17 additions and 27 deletions.
5 changes: 2 additions & 3 deletions charts/db-operator/ci/0-crds-test-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ reconcileInterval: "10"
crds:
keep: false
tests:
scripts:
enabled: true
enabled:
- crds
crds:
enabled: true
installed: true
5 changes: 2 additions & 3 deletions charts/db-operator/ci/0-nocrds-test-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ crds:
keep: false
install: false
tests:
scripts:
enabled: true
enabled:
- crds
crds:
enabled: true
installed: false
3 changes: 2 additions & 1 deletion charts/db-operator/ci/1-mysql-test-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ crds:
keep: false

tests:
enabled:
- mysql
mysql:
enabled: true
admin:
password: 123123!!
user: root
Expand Down
3 changes: 2 additions & 1 deletion charts/db-operator/ci/1-postgresql-test-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ crds:
keep: false

tests:
enabled:
- postgresql
postgresql:
enabled: true
admin:
password: 123123!!
user: postgres
Expand Down
5 changes: 2 additions & 3 deletions charts/db-operator/ci/2-gsql-test-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,9 @@ secrets:
}
tests:
scripts:
enabled: true
enabled:
- gsql
gsql:
enabled: true
cloudishSQL:
image:
repository: ghcr.io/db-operator/cloudish-sql
Expand Down
2 changes: 1 addition & 1 deletion charts/db-operator/templates/test/crds-test.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{- $version := semver .Capabilities.KubeVersion.Version }}
{{- if .Values.tests.crds.enabled }}
{{- if has "crds" .Values.tests.enabled }}
# ---------------------------------------------------------------------
# -- Test that CRDs are installed
# ---------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion charts/db-operator/templates/test/gsql_test.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{- $version := semver .Capabilities.KubeVersion.Version }}
{{- if .Values.tests.gsql.enabled }}
{{- if has "gsql" .Values.tests.enabled }}
# ---------------------------------------------------------------------
# -- Test Google API requests with cloudish-sql
# -- https://github.com/db-operator/cloudish-sql
Expand Down
2 changes: 1 addition & 1 deletion charts/db-operator/templates/test/mysql-test.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if .Values.tests.mysql.enabled }}
{{- if has "mysql" .Values.tests.enabled }}
---
apiVersion: v1
kind: Secret
Expand Down
4 changes: 2 additions & 2 deletions charts/db-operator/templates/test/postgres-test.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if .Values.tests.postgresql.enabled }}
{{- if has "postgresql" .Values.tests.enabled }}
---
apiVersion: v1
kind: Secret
Expand Down Expand Up @@ -180,4 +180,4 @@ spec:
name: {{ template "db-operator.name" . }}-postgresql-test-script
- name: shared-data
emptyDir: {}
{{- end }}
{{- end }}
2 changes: 1 addition & 1 deletion charts/db-operator/templates/test/test-scripts.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if .Values.tests.scripts.enabled }}
{{- if or (has "crds" .Values.tests.enabled) (has "gsql" .Values.tests.enabled) }}
---
apiVersion: v1
kind: ConfigMap
Expand Down
11 changes: 1 addition & 10 deletions charts/db-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -157,16 +157,7 @@ service:
# -- These values are used in tests, they should not affect users
# ---------------------------------------------------------------------
tests:
scripts:
enabled: false
gsql:
enabled: false
mysql:
enabled: false
postgresql:
enabled: false
crds:
enabled: false
enabled: []

Check failure on line 160 in charts/db-operator/values.yaml

View workflow job for this annotation

GitHub Actions / lint

160:14 [trailing-spaces] trailing spaces
attempts:
amount: 10
timeout: 30
Expand Down

0 comments on commit e869872

Please sign in to comment.