Skip to content

Commit

Permalink
fix(charts): allow helm api test to support 3rd party auth service
Browse files Browse the repository at this point in the history
[CHRON-404](https://blockchaintp.atlassian.net/browse/CHRON-404)

Signed-off-by: Joseph Livesey <[email protected]>
  • Loading branch information
suchapalaver committed Jun 16, 2023
1 parent f4a1a23 commit e99ac02
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
2 changes: 1 addition & 1 deletion charts/chronicle/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ keywords:
# This is the chart version. This version number should be incremented each
# time you make changes to the chart and its templates, including the app
# version.
version: 0.1.18
version: 0.1.19

# This is the version number of Chronicle being deployed. This version
# number should be incremented each time you make changes to Chronicle.
Expand Down
10 changes: 8 additions & 2 deletions charts/chronicle/templates/tests/api-test.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if .Values.test.enabled }}
{{- if .Values.test.api.enabled }}
apiVersion: batch/v1
kind: Job
metadata:
Expand All @@ -16,8 +16,9 @@ spec:
serviceAccountName: {{ include "lib.serviceAccountName" . }}
automountServiceAccountToken: true
{{- if .Values.auth.required }}
{{ if not .Values.test.auth.token }}
{{ if not .Values.devIdProvider.enabled }}
{{ required "If 'auth.required' when using the test suite 'devIdProvider.enabled' must be set to 'true'!" .Values.devIdProvider.enabled }}
{{ required "If 'auth.required' when using the api-test 'test.auth.token' must be provided or 'devIdProvider.enabled' must be set to 'true'!" .Values.devIdProvider.enabled }}
{{ end }}
initContainers:
- name: wait-for-id-provider
Expand Down Expand Up @@ -73,6 +74,7 @@ spec:
volumeMounts:
- name: shared-data
mountPath: /shared-data
{{ end }}
{{- end }}
containers:
- name: test
Expand All @@ -87,6 +89,10 @@ spec:
echo "Getting IP address for API ..."
getent hosts $API | cut -f 1 -d \ | head -n 1 > /shared-data/api-ip || exit 1
{{- if .Values.test.auth.token }}
echo "{{ .Values.test.auth.token }}" > /shared-data/jwks-token
{{- end }}
if [ -f "/shared-data/jwks-token" ]; then
echo "Found token."
sleep 5
Expand Down
9 changes: 6 additions & 3 deletions charts/chronicle/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -133,16 +133,19 @@ serviceAccount:
test:
## @md | `test.api` | test the chronicle GraphQL server API |
api:
## @md | `api-test-container.image` | the image to use for the api-test container | blockchaintp/chronicle-api-test |
## @md | `test.api.enabled` | true to enable api-test Jobs and Services | true |
enabled: true
## @md | `test.api.image` | the image to use for the api-test container | blockchaintp/chronicle-helm-api-test |
image:
## @md | `test.api.image.pullPolicy` | the image pull policy | IfNotPresent |
pullPolicy: IfNotPresent
## @md | `test.api.image.repository` | the image repository | blockchaintp/chronicle-helm-api-test |
repository: blockchaintp/chronicle-helm-api-test-amd64
## @md | `test.api.image.tag` | the image tag | latest |
tag: BTP2.1.0-0.7.3
## @md | `test.enabled` | true to enable test Jobs and Services | true |
enabled: true
auth:
## @md | `test.auth.token` | provide a token for auth-related testing | nil |
token:

postgres:
# if enabled we allocate a postgres database here
Expand Down

0 comments on commit e99ac02

Please sign in to comment.