Skip to content

Commit

Permalink
add simple test
Browse files Browse the repository at this point in the history
  • Loading branch information
gionn committed Sep 18, 2023
1 parent 12be4e1 commit c0ddfa3
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
{{- include "repository.labels" . | nindent 4 }}
data:
{{- $databaseURL := .Values.database.url }}
{{- if eq .Values.database.external false }}
{{- if not .Values.database.external }}
{{- $databaseURL = (printf "jdbc:postgresql://%s-%s:%d/%s" .Release.Name .Values.postgresql.nameOverride (int .Values.postgresql.primary.service.ports.postgresql) .Values.postgresql.auth.database) }}
{{- end }}
DATABASE_URL: {{ $databaseURL }}
25 changes: 25 additions & 0 deletions helm/alfresco-content-services/tests/config-database_test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
suite: test config-database manifest
templates:
- config-database.yaml
tests:
- it: should reference embedded postgres with default values
values: &testvalues
- values/test_values.yaml
asserts:
- equal:
path: data.DATABASE_URL
value: jdbc:postgresql://RELEASE-NAME-postgresql-acs:5432/alfresco
template: config-database.yaml

- it: should reference external postgres when enabled
values: *testvalues
set:
database:
external: true
url: jdbc:postgresql://my-external-postgresql-acs:5432/alfresco
asserts:
- equal:
path: data.DATABASE_URL
value: jdbc:postgresql://my-external-postgresql-acs:5432/alfresco
template: config-database.yaml

0 comments on commit c0ddfa3

Please sign in to comment.