Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion charts/trino/templates/tests/test-connection.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,13 @@ spec:
- --password
{{- end }}
- --debug
- --execute=SELECT COUNT(*) FROM tpch.tiny.nation
{{- if has "catalog.management=dynamic" .Values.additionalConfigProperties }}
- --execute=CREATE CATALOG dynamic USING tpch; SELECT name FROM dynamic.tiny.nation WHERE nationkey = 12
{{- else }}
- --execute=SELECT COUNT(*) FROM tpch.tiny.nation WHERE nationkey = 12
{{- end }}
- --no-progress
- --network-logging=BODY
{{- if eq .Values.server.config.authenticationType "PASSWORD" }}
env:
- name: TRINO_PASSWORD
Expand Down
16 changes: 16 additions & 0 deletions tests/trino/dyncat-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
additionalConfigProperties:
- catalog.management=dynamic

coordinator:
additionalVolumes:
- name: catalogs
persistentVolumeClaim:
claimName: catalogs-pvc
additionalConfigFiles:
catalog-store.properties: |
catalog.config-dir=/etc/trino/dynamic-catalog

additionalVolumeMounts:
- name: catalogs
mountPath: /etc/trino/dynamic-catalog
readOnly: false
17 changes: 16 additions & 1 deletion tests/trino/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ declare -A testCases=(
[exchange_manager_values]="--values test-exchange-manager-values.yaml"
[graceful_shutdown]="--values test-graceful-shutdown-values.yaml"
[resource_groups_properties]="--values test-resource-groups-properties-values.yaml"
[dynamic_catalogs]="--values dyncat-values.yaml"
)

declare -A testCaseCharts=(
Expand All @@ -22,6 +23,7 @@ declare -A testCaseCharts=(
[exchange_manager_values]="../../charts/trino"
[graceful_shutdown]="../../charts/trino"
[resource_groups_properties]="../../charts/trino"
[dynamic_catalogs]="../../charts/trino"
)

function join_by {
Expand All @@ -41,7 +43,7 @@ CT_ARGS=(
--helm-extra-args="--timeout 2m"
)
CLEANUP_NAMESPACE=true
TEST_NAMES=(default single_node complete_values access_control_properties_values exchange_manager_values graceful_shutdown resource_groups_properties)
TEST_NAMES=(default single_node complete_values access_control_properties_values exchange_manager_values graceful_shutdown resource_groups_properties dynamic_catalogs)

usage() {
cat <<EOF 1>&2
Expand Down Expand Up @@ -105,6 +107,19 @@ spec:
requests:
storage: 128Mi
YAML
cat <<YAML | kubectl -n "$NAMESPACE" create -f -
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: catalogs-pvc
spec:
accessModes:
- ReadWriteOnce
storageClassName: standard
resources:
requests:
storage: 30Mi
YAML

# only install the Prometheus and KEDA Helm charts when running the `complete_values` test
if printf '%s\0' "${TEST_NAMES[@]}" | grep -qwz complete_values; then
Expand Down
Loading