Skip to content

Commit 20ea512

Browse files
authored
ci: add nightly integration scenario for Opensearch with basic auth (#3725)
1 parent 75b83cc commit 20ea512

File tree

10 files changed

+65
-16
lines changed

10 files changed

+65
-16
lines changed

.github/workflows/test-integration-runner.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,12 @@ env:
203203
# Camunda registry auth to access WebModeler Docker image since it's not public.
204204
TEST_DOCKER_USERNAME_CAMUNDA_CLOUD: ${{ secrets.DISTRO_CI_DOCKER_USERNAME_CAMUNDA }}
205205
TEST_DOCKER_PASSWORD_CAMUNDA_CLOUD: ${{ secrets.DISTRO_CI_DOCKER_PASSWORD_CAMUNDA }}
206+
# OpenSearch credentials
207+
OPENSEARCH_USERNAME: ${{ secrets.OPENSEARCH_USERNAME }}
208+
OPENSEARCH_PASSWORD: ${{ secrets.OPENSEARCH_PASSWORD }}
209+
OPENSEARCH_PROTOCOL: "https"
210+
OPENSEARCH_HOST: "search-qa-e2e-5q5uium4w7pgfz7i5tviimmmgm.eu-north-1.es.amazonaws.com"
211+
OPENSEARCH_PORT: "443"
206212
# OIDC.
207213
ENTRA_PARENT_APP_CLIENT_ID: ${{ secrets.ENTRA_PARENT_APP_CLIENT_ID }}
208214
ENTRA_PARENT_APP_CLIENT_SECRET: ${{ secrets.ENTRA_PARENT_APP_CLIENT_SECRET }}
@@ -425,6 +431,13 @@ jobs:
425431
${{ env.TEST_HELM_EXTRA_ARGS }}
426432
--set global.ingress.host=${{ steps.vars.outputs.ingress-host }}
427433
run: |
434+
# Configure OpenSearch environment if using opensearch scenario
435+
if [[ "${{ inputs.scenario }}" == "opensearch" ]] && [[ -n "${OPENSEARCH_USERNAME}" ]] && [[ -n "${OPENSEARCH_PASSWORD}" ]]; then
436+
# Apply environment variable substitution to values file
437+
values_file="charts/${{ inputs.camunda-helm-dir }}/test/integration/scenarios/chart-full-setup/values-integration-test-ingress-${TEST_VALUES_SCENARIO}.yaml"
438+
envsubst < "$values_file" > /tmp/values-substituted.yaml && mv /tmp/values-substituted.yaml "$values_file"
439+
fi
440+
428441
echo "Extra values from workflow:"
429442
echo "$EXTRA_VALUES" | tee /tmp/extra-values-file.yaml
430443
task -d ${CI_TASKS_BASE_DIR}/chart-full-setup setup.pre
@@ -649,6 +662,13 @@ jobs:
649662
EXTRA_VALUES: ${{ inputs.extra-values }}
650663
continue-on-error: false
651664
run: |
665+
# Configure OpenSearch environment if using opensearch scenario
666+
if [[ "${{ inputs.scenario }}" == "opensearch" ]] && [[ -n "${OPENSEARCH_USERNAME}" ]] && [[ -n "${OPENSEARCH_PASSWORD}" ]]; then
667+
# Apply environment variable substitution to values file
668+
values_file="charts/${{ inputs.camunda-helm-dir }}/test/integration/scenarios/chart-full-setup/values-integration-test-ingress-${TEST_VALUES_SCENARIO}.yaml"
669+
envsubst < "$values_file" > /tmp/values-substituted.yaml && mv /tmp/values-substituted.yaml "$values_file"
670+
fi
671+
652672
echo "Extra values from workflow:"
653673
echo "$EXTRA_VALUES" | tee /tmp/extra-values-file.yaml
654674
task -d ${CI_TASKS_BASE_DIR}/chart-full-setup setup.venom.env

charts/camunda-platform-8.8/templates/common/constraints.tpl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -581,7 +581,7 @@ The keys moved in the 8.8 Alpha 8 version.
581581
- renamed: global.security.authentication => orchestration.security.authentication
582582
*/}}
583583
{{ include "camundaPlatform.keyRenamed" (dict
584-
"condition" (.Values.global.security.authentication)
584+
"condition" (and (hasKey .Values.global "security") (hasKey .Values.global.security "authentication"))
585585
"oldName" "global.security.authentication"
586586
"newName" "orchestration.security.authentication"
587587
) }}
@@ -590,7 +590,7 @@ The keys moved in the 8.8 Alpha 8 version.
590590
- renamed: global.security.authorizations => orchestration.security.authorizations
591591
*/}}
592592
{{ include "camundaPlatform.keyRenamed" (dict
593-
"condition" (.Values.global.security.authorizations)
593+
"condition" (and (hasKey .Values.global "security") (hasKey .Values.global.security "authorizations"))
594594
"oldName" "global.security.authorizations"
595595
"newName" "orchestration.security.authorizations"
596596
) }}
@@ -599,7 +599,7 @@ The keys moved in the 8.8 Alpha 8 version.
599599
- renamed: global.security.initialization => orchestration.security.initialization
600600
*/}}
601601
{{ include "camundaPlatform.keyRenamed" (dict
602-
"condition" (.Values.global.security.initialization)
602+
"condition" (and (hasKey .Values.global "security") (hasKey .Values.global.security "initialization"))
603603
"oldName" "global.security.initialization"
604604
"newName" "orchestration.security.initialization"
605605
) }}

charts/camunda-platform-8.8/test/ci-test-config.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,11 @@ integration:
6262
exclude: []
6363
shortname: oske
6464
auth: keycloak
65+
- name: opensearch
66+
enabled: true
67+
shortname: osba
68+
exclude: [identity,console,orchestration-grpc]
69+
auth: basic
6570
- name: identity-migration
6671
enabled: true
6772
exclude: []

charts/camunda-platform-8.8/test/integration/scenarios/chart-full-setup/values-integration-test-ingress-basic.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
global:
22
secrets:
33
autoGenerated: false
4+
exporter:
5+
enabled: false
46
ingress:
57
enabled: true
68
className: nginx
@@ -13,6 +15,9 @@ global:
1315
annotations:
1416
external-dns.alpha.kubernetes.io/hostname: "{{ .Values.global.ingress.host }}"
1517
external-dns.alpha.kubernetes.io/ttl: "60"
18+
19+
orchestration:
20+
contextPath: "/orchestration"
1621
security:
1722
authentication:
1823
method: basic

charts/camunda-platform-8.8/test/integration/scenarios/chart-full-setup/values-integration-test-ingress-opensearch.yaml

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,27 @@
11
global:
22
elasticsearch:
33
enabled: false
4+
exporter:
5+
enabled: true
46
opensearch:
57
enabled: true
8+
aws:
9+
enabled: false
610
auth:
7-
username: camunda
8-
password: camunda
11+
username: "$OPENSEARCH_USERNAME"
12+
password: "$OPENSEARCH_PASSWORD"
913
url:
10-
protocol: https
11-
host: camunda.com
12-
port: 443
14+
protocol: $OPENSEARCH_PROTOCOL
15+
host: "$OPENSEARCH_HOST"
16+
port: $OPENSEARCH_PORT
17+
prefix: "custom-zeebe"
1318

1419
elasticsearch:
1520
enabled: false
1621

1722
orchestration:
18-
# index:
19-
# prefix: app
23+
index:
24+
prefix: "custom-zeebe"
2025
env:
2126
# group1
2227
- name: CAMUNDA_DATA_SECONDARYSTORAGE_OPENSEARCH_INDEXPREFIX

charts/camunda-platform-8.8/test/integration/testsuites/tests/connectors.spec.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,11 @@ test.describe("connectors", () => {
3737

3838
test.beforeAll(async ({ playwright }) => {
3939
api = await playwright.request.newContext();
40-
venomJWT = await fetchToken(config.venomID, config.venomSec, api, config);
40+
if (config.authType !== "basic") {
41+
venomJWT = await fetchToken(config.venomID, config.venomSec, api, config);
42+
} else {
43+
venomJWT = "";
44+
}
4145
});
4246

4347
test("Connectors inbound page", async () => {

charts/camunda-platform-8.8/test/integration/testsuites/tests/core-rest.spec.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,11 @@ test.describe("orchestration-rest", () => {
6060

6161
test.beforeAll(async ({ playwright }) => {
6262
api = await playwright.request.newContext();
63-
venomJWT = await fetchToken(config.venomID, config.venomSec, api, config);
63+
if (config.authType !== "basic") {
64+
venomJWT = await fetchToken(config.venomID, config.venomSec, api, config);
65+
} else {
66+
venomJWT = "";
67+
}
6468
});
6569

6670
for (const [label, url, method, body] of [

charts/camunda-platform-8.8/test/integration/testsuites/tests/helper.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export async function fetchToken(
2525
}
2626
}
2727

28-
export const authHeader = async (api: APIRequestContext, config: any) => {
28+
export const authHeader = async (api: APIRequestContext, config: any): Promise<string> => {
2929
if (config.authType === "basic") {
3030
return `Basic ${Buffer.from(
3131
`${config.demoUser}:${config.demoPass}`,

scripts/run-integration-tests.sh

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,12 @@ setup_env_file() {
4343
local is_ci="$7"
4444

4545
export TEST_INGRESS_HOST="$hostname"
46+
47+
# Only export TEST_AUTH_TYPE for 8.8+ where the template uses it
48+
if [[ "$test_suite_path" == *"8.8"* ]]; then
49+
export TEST_AUTH_TYPE="$test_auth_type"
50+
fi
51+
4652
envsubst <"$test_suite_path"/vars/playwright/files/playwright-job-vars.env.template >"$env_file"
4753

4854
# during helm install, we create a secret with the credentials for the services
@@ -140,8 +146,8 @@ ABSOLUTE_CHART_PATH=""
140146
NAMESPACE=""
141147
SHOW_HTML_REPORT=false
142148
VERBOSE=false
143-
TEST_AUTH_TYPE="keycloak"
144-
TEST_EXCLUDE=""
149+
TEST_AUTH_TYPE="${TEST_AUTH_TYPE:-keycloak}"
150+
TEST_EXCLUDE="${TEST_EXCLUDE:-}"
145151
IS_CI=true
146152

147153
check_required_cmds

test/integration/scenarios/chart-full-setup/Taskfile.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ tasks:
152152
}"
153153
{{ end }}
154154
- |
155-
{{ if eq .TEST_VALUES_SCENARIO "opensearch" }}
155+
{{ if and (eq .TEST_VALUES_SCENARIO "opensearch") .TEST_OPENSEARCH_PREFIX }}
156156
sed -i 's/custom/{{ .TEST_OPENSEARCH_PREFIX }}/g' {{ .TEST_VALUES_BASE_DIR }}/chart-full-setup/values-integration-test-ingress-{{ .TEST_VALUES_SCENARIO }}.yaml
157157
{{ end }}
158158
- |

0 commit comments

Comments
 (0)