From 0e024e7225d0651d7617c1d91bf5112378f300f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Wa=C5=9B?= Date: Sat, 9 Nov 2024 13:10:02 +0100 Subject: [PATCH] Test the Trino Gateway chart --- .github/workflows/ci-cd.yaml | 1 + README.md | 4 +++- .../templates/tests/test-connection.yaml | 2 ++ test.sh | 19 +++++++++++++++++-- 4 files changed, 23 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci-cd.yaml b/.github/workflows/ci-cd.yaml index 594d9cfb..bcbeedf8 100644 --- a/.github/workflows/ci-cd.yaml +++ b/.github/workflows/ci-cd.yaml @@ -42,6 +42,7 @@ jobs: - { label: 435, args: '-a "--set image.tag=435"' } # skip cleanup to test deploying multiple releases in a single namespace - { label: overrides, args: '-s -t default,overrides' } + - { label: gateway, args: '-t gateway' } steps: - uses: actions/checkout@v4 - name: Set up Helm diff --git a/README.md b/README.md index b3e61a88..0db765b6 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,9 @@ helm template my-trino trino/trino --namespace ## Documentation -You can find documentation about the chart [here](./charts/trino/README.md). +You can find documentation about the charts: +* [Trino](./charts/trino/README.md). +* [Trino Gateway](./charts/gateway/README.md). ## Development diff --git a/charts/gateway/templates/tests/test-connection.yaml b/charts/gateway/templates/tests/test-connection.yaml index cfad670f..0c336c53 100644 --- a/charts/gateway/templates/tests/test-connection.yaml +++ b/charts/gateway/templates/tests/test-connection.yaml @@ -4,6 +4,8 @@ metadata: name: "{{ include "trino-gateway.fullname" . }}-test-connection" labels: {{- include "trino-gateway.labels" . | nindent 4 }} + app.kubernetes.io/component: test + test: connection annotations: "helm.sh/hook": test spec: diff --git a/test.sh b/test.sh index 0b208033..eaefe4c2 100755 --- a/test.sh +++ b/test.sh @@ -10,6 +10,18 @@ declare -A testCases=( [access_control_properties_values]="--values test-access-control-properties-values.yaml" [exchange_manager_values]="--values test-exchange-manager-values.yaml" [graceful_shutdown]="--values test-graceful-shutdown-values.yaml" + [gateway]="" +) + +declare -A testCaseCharts=( + [default]="charts/trino" + [single_node]="charts/trino" + [complete_values]="charts/trino" + [overrides]="charts/trino" + [access_control_properties_values]="charts/trino" + [exchange_manager_values]="charts/trino" + [graceful_shutdown]="charts/trino" + [gateway]="charts/gateway" ) function join_by { @@ -22,7 +34,10 @@ function join_by { # default to randomly generated namespace, same as chart-testing would do, but we need to load secrets into the same namespace NAMESPACE=trino-$(LC_ALL=C tr -dc 'a-z0-9' &2 "" echo 1>&2 "🧪 Running test $test_name" echo 1>&2 "" - if ! time ct install "${CT_ARGS[@]}" --helm-extra-set-args "$HELM_EXTRA_SET_ARGS ${testCases[$test_name]}"; then + if ! time ct install "${CT_ARGS[@]}" --charts="${testCaseCharts[$test_name]}" --helm-extra-set-args "$HELM_EXTRA_SET_ARGS ${testCases[$test_name]}"; then echo 1>&2 "❌ Test $test_name failed" echo 1>&2 "Test logs:" kubectl --namespace "$NAMESPACE" logs --tail=-1 --selector app.kubernetes.io/component=test --all-containers=true