Skip to content

Commit fa34076

Browse files
committed
Test with dynamic catalogs
1 parent a68b3be commit fa34076

File tree

3 files changed

+38
-2
lines changed

3 files changed

+38
-2
lines changed

charts/trino/templates/tests/test-connection.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,13 @@ spec:
4242
- --password
4343
{{- end }}
4444
- --debug
45-
- --execute=SELECT COUNT(*) FROM tpch.tiny.nation
45+
{{- if has "catalog.management=dynamic" .Values.additionalConfigProperties }}
46+
- --execute=CREATE CATALOG dynamic USING tpch; SELECT name FROM dynamic.tiny.nation WHERE nationkey = 12
47+
{{- else }}
48+
- --execute=SELECT COUNT(*) FROM tpch.tiny.nation WHERE nationkey = 12
49+
{{- end }}
4650
- --no-progress
51+
- --network-logging=BODY
4752
{{- if eq .Values.server.config.authenticationType "PASSWORD" }}
4853
env:
4954
- name: TRINO_PASSWORD

tests/trino/dyncat-values.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
additionalConfigProperties:
2+
- catalog.management=dynamic
3+
4+
coordinator:
5+
additionalVolumes:
6+
- name: catalogs
7+
persistentVolumeClaim:
8+
claimName: catalogs-pvc
9+
additionalConfigFiles:
10+
catalog-store.properties: |
11+
catalog.config-dir=/etc/trino/dynamic-catalog
12+
13+
additionalVolumeMounts:
14+
- name: catalogs
15+
mountPath: /etc/trino/dynamic-catalog
16+
readOnly: false

tests/trino/test.sh

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ declare -A testCases=(
1111
[exchange_manager_values]="--values test-exchange-manager-values.yaml"
1212
[graceful_shutdown]="--values test-graceful-shutdown-values.yaml"
1313
[resource_groups_properties]="--values test-resource-groups-properties-values.yaml"
14+
[dynamic_catalogs]="--values dyncat-values.yaml"
1415
)
1516

1617
declare -A testCaseCharts=(
@@ -22,6 +23,7 @@ declare -A testCaseCharts=(
2223
[exchange_manager_values]="../../charts/trino"
2324
[graceful_shutdown]="../../charts/trino"
2425
[resource_groups_properties]="../../charts/trino"
26+
[dynamic_catalogs]="../../charts/trino"
2527
)
2628

2729
function join_by {
@@ -41,7 +43,7 @@ CT_ARGS=(
4143
--helm-extra-args="--timeout 2m"
4244
)
4345
CLEANUP_NAMESPACE=true
44-
TEST_NAMES=(default single_node complete_values access_control_properties_values exchange_manager_values graceful_shutdown resource_groups_properties)
46+
TEST_NAMES=(default single_node complete_values access_control_properties_values exchange_manager_values graceful_shutdown resource_groups_properties dynamic_catalogs)
4547

4648
usage() {
4749
cat <<EOF 1>&2
@@ -105,6 +107,19 @@ spec:
105107
requests:
106108
storage: 128Mi
107109
YAML
110+
cat <<YAML | kubectl -n "$NAMESPACE" create -f -
111+
apiVersion: v1
112+
kind: PersistentVolumeClaim
113+
metadata:
114+
name: catalogs-pvc
115+
spec:
116+
accessModes:
117+
- ReadWriteOnce
118+
storageClassName: standard
119+
resources:
120+
requests:
121+
storage: 30Mi
122+
YAML
108123

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

0 commit comments

Comments
 (0)