Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
Signed-off-by: Ahmed AbouZaid <[email protected]>
  • Loading branch information
aabouzaid committed Jun 24, 2024
1 parent be4abe7 commit ec7ef93
Show file tree
Hide file tree
Showing 13 changed files with 95 additions and 159 deletions.
59 changes: 30 additions & 29 deletions .github/workflows/test-regression.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,38 +35,39 @@ jobs:
with:
charts-path: "charts/camunda-platform-8*"

validation:
if: ${{ needs.init.outputs.matrix != '[]' }}
name: Validation - Camunda ${{ matrix.version }}
needs: init
strategy:
fail-fast: false
matrix:
version: ${{ fromJson(needs.init.outputs.matrix) }}
uses: ./.github/workflows/chart-validate-template.yaml
with:
identifier: "${{ github.event.pull_request.number }}-vald-${{ matrix.version }}"
camunda-helm-dir: "camunda-platform-${{ matrix.version }}"
camunda-helm-git-ref: "${{ github.event.pull_request.head.sha }}"
# validation:
# if: ${{ needs.init.outputs.matrix != '[]' }}
# name: Validation - Camunda ${{ matrix.version }}
# needs: init
# strategy:
# fail-fast: false
# matrix:
# version: ${{ fromJson(needs.init.outputs.matrix) }}
# uses: ./.github/workflows/chart-validate-template.yaml
# with:
# identifier: "${{ github.event.pull_request.number }}-vald-${{ matrix.version }}"
# camunda-helm-dir: "camunda-platform-${{ matrix.version }}"
# camunda-helm-git-ref: "${{ github.event.pull_request.head.sha }}"

unit:
if: ${{ needs.init.outputs.matrix != '[]' }}
name: Unit Test - Camunda ${{ matrix.version }}
needs: [init]
strategy:
fail-fast: false
matrix:
version: ${{ fromJson(needs.init.outputs.matrix) }}
uses: ./.github/workflows/test-unit-template.yml
with:
identifier: "${{ github.event.pull_request.number }}-unit-${{ matrix.version }}"
camunda-helm-dir: "camunda-platform-${{ matrix.version }}"
camunda-helm-git-ref: "${{ github.event.pull_request.head.sha }}"
# unit:
# if: ${{ needs.init.outputs.matrix != '[]' }}
# name: Unit Test - Camunda ${{ matrix.version }}
# needs: [init]
# strategy:
# fail-fast: false
# matrix:
# version: ${{ fromJson(needs.init.outputs.matrix) }}
# uses: ./.github/workflows/test-unit-template.yml
# with:
# identifier: "${{ github.event.pull_request.number }}-unit-${{ matrix.version }}"
# camunda-helm-dir: "camunda-platform-${{ matrix.version }}"
# camunda-helm-git-ref: "${{ github.event.pull_request.head.sha }}"

integration:
if: ${{ needs.init.outputs.matrix != '[]' }}
name: Integration Test - Camunda ${{ matrix.version }}
needs: [init, validation, unit]
#needs: [init, validation, unit]
needs: [init]
strategy:
fail-fast: false
matrix:
Expand All @@ -81,7 +82,7 @@ jobs:
identifier: "${{ github.event.pull_request.number }}-intg-${{ matrix.version }}"
deployment-ttl: "${{ contains(github.event.pull_request.labels.*.name, 'test-persistent') && '1w' || '' }}"
platforms: "gke"
flows: "install,upgrade"
test-enabled: false
flows: "install"
# flows: "install,upgrade"
camunda-helm-dir: "camunda-platform-${{ matrix.version }}"
camunda-helm-git-ref: "${{ github.event.pull_request.head.sha }}"
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# NOTE: WebModeler has its own step because Venom doesn't support skip in loops yet.
# https://github.com/ovh/venom/issues/651
name: Test core functionality of Camunda
name: Test core functionality of Camunda Platform

# Vars without defaults are passed as a Venom var, e.g. "VENOM_VAR_TEST_CLIENT_SECRET".
vars:
Expand All @@ -14,10 +14,6 @@ testcases:

# https://docs.camunda.io/docs/self-managed/identity/user-guide/generating-m2m-tokens/
- name: TEST - Generating machine-to-machine token
description: |
Test generating tokens from Keycloak for components that use client type "CONFIDENTIAL".
This test will not work with type "PUBLIC" because "Public client not allowed to retrieve service account".
https://datatracker.ietf.org/doc/html/rfc6749#section-2.1
steps:
- name: "{{ .value.component }}"
type: http
Expand Down Expand Up @@ -64,15 +60,15 @@ testcases:
jwt:
from: result.bodyjson.access_token

- name: TEST - Interacting with Camunda login page
# TODO: Use Venom "web" module to test actual login. It's easy but requires "PhantomJS"
# which is not available on Alpine, so it needs to be installed first.
- name: TEST - Interacting with Camunda Platform login page
steps:
- name: "{{ .value.component }}"
skip:
- skiptestingress ShouldBeFalse
type: http
range:
- component: Console
url: "{{ .coreVars.baseURLs.console }}"
- component: Keycloak
url: "{{ .coreVars.baseURLs.keycloak }}"
- component: Identity
Expand All @@ -83,6 +79,8 @@ testcases:
url: "{{ .coreVars.baseURLs.optimize }}"
- component: Tasklist
url: "{{ .coreVars.baseURLs.tasklist }}"
- component: Connectors
url: "{{ .coreVars.baseURLs.connectors }}"
- component: WebModeler
url: "{{ .coreVars.baseURLs.webModeler }}"
method: GET
Expand All @@ -98,36 +96,12 @@ testcases:
- result.statuscode ShouldEqual 200
- result.body ShouldNotContainSubstring error

# Connectors Inbound doesn't have the same flow like the rest of the components.
# So it needs different check.
- name: TEST - Interacting with Camunda login page - Connectors
steps:
- name: "Check Inbound Connectors"
skip:
- skiptestingress ShouldBeFalse
type: http
method: GET
url: "{{ .coreVars.baseURLs.connectors }}"
retry: 3
delay: 15
info: |
= Request Method: {{ .value.method }}
= Request Body: {{ .result.request.body }}
= Response Body: {{ .result.body }}
assertions:
- result.statuscode ShouldEqual 200
# - result.bodyjson.items.items0.health.status ShouldEqual UP

# TODO: Add Optimize.
- name: TEST - Interacting with Camunda web API
- name: TEST - Interacting with Camunda Platform web API
steps:
- name: "{{ .value.component }}"
type: http
range:
- component: Console
url: "{{ .coreVars.baseURLs.console }}/api/clusters"
method: GET
body: ''
- component: Identity
url: "{{ .coreVars.baseURLs.identity }}/api/users"
method: GET
Expand Down Expand Up @@ -160,22 +134,21 @@ testcases:
# Hence, this test is added in the extra tests when Ingress is enabled.
- name: TEST - Interacting with WebModeler
steps:
# TODO: Check why WM 8.3.0 cannot be accessed internally.
# - name: Check WebModeler internal API
# skip:
# - skiptestwebmodeler ShouldBeFalse
# type: http
# method: GET
# url: "{{ .coreVars.baseURLs.webModelerRestapi }}/api/v1/info"
# headers:
# Content-Type: application/json
# Authorization: "Bearer {{ .helperVenomToken.jwt }}"
# # info: |
# # = Request Body: {{ .result.request.body }}
# # = Response Body: {{ .result.body }}
# assertions:
# - result.statuscode ShouldEqual 200
# - result.bodyjson.version ShouldNotBeEmpty
- name: Check WebModeler internal API
skip:
- skiptestwebmodeler ShouldBeFalse
type: http
method: GET
url: "{{ .coreVars.baseURLs.webModelerRestapi }}/api/beta/info"
headers:
Content-Type: application/json
Authorization: "Bearer {{ .helperVenomToken.jwt }}"
# info: |
# = Request Body: {{ .result.request.body }}
# = Response Body: {{ .result.body }}
assertions:
- result.statuscode ShouldEqual 200
- result.bodyjson.version ShouldNotBeEmpty
- name: Check WebModeler login page
skip:
- skiptestingress ShouldBeFalse
Expand All @@ -196,12 +169,12 @@ testcases:

- name: TEST - Interacting with Zeebe Gateway
steps:
- name: Check Zeebe Gateway status - gRPC
- name: Check Zeebe Gateway status
type: exec
script: |
zbctl --clientCache=/tmp/zeebe \
--clientId {{ .venomClientID }} --clientSecret {{ .venomClientSecret }} \
--authzUrl "{{ .coreVars.authURL }}" --address "{{ .coreVars.baseURLs.zeebeGatewayGRPC }}" \
--authzUrl "{{ .coreVars.authURL }}" --address "{{ .coreVars.baseURLs.zeebeGateway }}" \
{{ .coreVars.zbctl.extraArgs }} \
status
retry: 2
Expand All @@ -214,21 +187,6 @@ testcases:
- result.systemout ShouldContainSubstring "Leader, Healthy"
- result.systemout ShouldNotContainSubstring Unhealthy
- result.timeseconds ShouldBeLessThan 1
- name: Check Zeebe Gateway status - REST
type: http
method: GET
url: "{{ .coreVars.baseURLs.zeebeGatewayREST }}/v1/topology"
headers:
Content-Type: application/json
Authorization: "Bearer {{ .helperVenomToken.jwt }}"
retry: 2
delay: 10
info: |
= Request Body: {{ .result.request.body }}
= Response Body: {{ .result.body }}
assertions:
- result.statuscode ShouldEqual 200
- result.bodyjson ShouldContainKey brokers

- name: TEST - Deploying BPMN process
steps:
Expand All @@ -242,7 +200,7 @@ testcases:
script: |
zbctl --clientCache=/tmp/zeebe \
--clientId {{ .venomClientID }} --clientSecret {{ .venomClientSecret }} \
--authzUrl "{{ .coreVars.authURL }}" --address "{{ .coreVars.baseURLs.zeebeGatewayGRPC }}" \
--authzUrl "{{ .coreVars.authURL }}" --address "{{ .coreVars.baseURLs.zeebeGateway }}" \
{{ .coreVars.zbctl.extraArgs }} \
deploy /mnt/fixtures/{{ .value.file }}
# info: |
Expand All @@ -268,9 +226,10 @@ testcases:
body: '{}'
retry: 3
delay: 15
# info: |
# = Request Body: {{ .result.request.body }}
# = Response Body: {{ .result.body }}
# TODO: Remove it after debugging Operate issue.
info: |
= Request Body: {{ .result.request.body }}
= Response Body: {{ .result.body }}
assertions:
- result.statuscode ShouldEqual 200
# NOTE: JSON keys are lowercased automatically, the original key is "bpmnProcessId".
Expand All @@ -292,25 +251,4 @@ testcases:
# = Request Body: {{ .result.request.body }}
# = Response Body: {{ .result.body }}
assertions:
- result.statuscode ShouldEqual 200

# - name: TEST - Check ServiceMonitor
# steps:
# - name: Check prometheus could query containers
# type: http
# method: GET
# url: "http://{{ .coreVars.baseURLs.prometheus }}/api/v1/query?query=system_cpu_count%7Bnamespace%3D%22{{ .coreVars.testNamespace }}%22%7D"
# retry: 4
# delay: 15
# # info: |
# # = Request Body: {{ .result.request.body }}
# # = Response Body: {{ .result.body }}
# assertions:
# - result.body ShouldContainSubstring connectors
# - result.body ShouldContainSubstring identity
# - result.body ShouldContainSubstring operate
# - result.body ShouldContainSubstring optimize
# - result.body ShouldContainSubstring tasklist
# - result.body ShouldContainSubstring web-modeler-restapi
# - result.body ShouldContainSubstring zeebe
# - result.body ShouldContainSubstring zeebe-gateway
- result.statuscode ShouldEqual 200
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# NOTE: WebModeler has its own step because Venom doesn't support skip in loops yet.
# https://github.com/ovh/venom/issues/651
name: Run preflight checks for Camunda
name: Run preflight checks for Camunda Platform

# Vars without defaults are passed as a Venom var, e.g. "VENOM_VAR_TEST_CLIENT_SECRET".
vars:
Expand Down Expand Up @@ -30,8 +30,8 @@ testcases:
url: "{{ .preflightVars.baseURLs.tasklist }}/actuator/health/readiness"
- component: Connectors
url: "{{ .preflightVars.baseURLs.connectors }}/actuator/health/readiness"
- component: ZeebeGateway
url: "{{ .preflightVars.baseURLs.zeebeGateway }}/actuator/health/readiness"
- component: Zeebe-Gateway
url: "{{ .preflightVars.baseURLs.zeebeGateway }}/health"
method: GET
url: "{{ .value.url }}"
retry: 3
Expand All @@ -41,6 +41,7 @@ testcases:
# Response Body: {{ .result.body }}
assertions:
- result.statuscode ShouldEqual 200

- name: "WebModeler - {{ .value.component }}"
skip:
- skiptestwebmodeler ShouldBeFalse
Expand Down Expand Up @@ -81,7 +82,7 @@ testcases:
url: "{{ .preflightVars.baseURLs.tasklist }}/actuator/health/liveness"
- component: Connectors
url: "{{ .preflightVars.baseURLs.connectors }}/actuator/health/liveness"
- component: ZeebeGateway
- component: Zeebe-Gateway
url: "{{ .preflightVars.baseURLs.zeebeGateway }}/actuator/health/liveness"
method: GET
url: "{{ .value.url }}"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,29 +1,26 @@
preflightVars:
baseURLs:
elasticsearch: http://integration-elasticsearch:9200
console: http://integration-console:9100
elasticsearch: http://elasticsearch-master:9200
keycloak: http://integration-keycloak
identity: http://integration-identity:82
optimize: http://integration-optimize
operate: http://integration-operate
tasklist: http://integration-tasklist
connectors: http://integration-connectors:8080
zeebeGateway: http://integration-zeebe-gateway:9600
webModelerRestapi: http://integration-web-modeler-restapi:8091
webModelerWebapp: http://integration-web-modeler-webapp:8071
zeebeGateway: http://integration-zeebe-gateway:9600

coreVars:
authURL: "http://integration-keycloak/auth/realms/camunda-platform/protocol/openid-connect/token"
baseURLs:
console: http://integration-console
keycloak: http://integration-keycloak
identity: http://integration-identity
optimize: http://integration-optimize
operate: http://integration-operate
tasklist: http://integration-tasklist
connectors: http://integration-connectors:8080/inbound
webModelerRestapi: http://integration-web-modeler-restapi
zeebeGatewayGRPC: http://integration-zeebe-gateway:9600
zeebeGatewayREST: http://integration-zeebe-gateway:8080
zeebeGateway: integration-zeebe-gateway:26500
zbctl:
extraArgs: "--insecure"
Original file line number Diff line number Diff line change
@@ -1,32 +1,27 @@
preflightVars:
baseURLs:
elasticsearch: http://integration-elasticsearch:9200
console: http://integration-console:9100
elasticsearch: http://elasticsearch-master:9200
keycloak: http://integration-keycloak
identity: http://integration-identity:82
optimize: http://integration-optimize/optimize
operate: http://integration-operate/operate
tasklist: http://integration-tasklist/tasklist
connectors: http://integration-connectors:8080/connectors
zeebeGateway: http://integration-zeebe-gateway:9600
webModelerRestapi: http://integration-web-modeler-restapi:8091
webModelerWebapp: http://integration-web-modeler-webapp:8071
zeebeGateway: http://integration-zeebe-gateway:9600/zeebe

coreVars:
authURL: "https://{{ .TEST_INGRESS_HOST }}/auth/realms/camunda-platform/protocol/openid-connect/token"
testNamespace: "{{ .K8S_NAMESPACE }}"
baseURLs:
console: "https://{{ .TEST_INGRESS_HOST }}"
keycloak: "https://{{ .TEST_INGRESS_HOST }}/auth/"
keycloak: "https://{{ .TEST_INGRESS_HOST }}/auth"
identity: "https://{{ .TEST_INGRESS_HOST }}/identity"
operate: "https://{{ .TEST_INGRESS_HOST }}/operate"
optimize: "https://{{ .TEST_INGRESS_HOST }}/optimize"
tasklist: "https://{{ .TEST_INGRESS_HOST }}/tasklist"
connectors: "https://{{ .TEST_INGRESS_HOST }}/connectors/inbound"
webModeler: "https://{{ .TEST_INGRESS_HOST }}/modeler"
webModelerRestapi: http://integration-web-modeler-restapi
zeebeGatewayGRPC: "zeebe-{{ .TEST_INGRESS_HOST }}:443"
zeebeGatewayREST: "https://{{ .TEST_INGRESS_HOST }}/zeebe"
prometheus: "prometheus-operated.kube-prometheus-stack.svc.cluster.local:9090"
zeebeGateway: "zeebe-{{ .TEST_INGRESS_HOST }}:443"
zbctl:
extraArgs: ""
Loading

0 comments on commit ec7ef93

Please sign in to comment.