Skip to content
Closed
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
254 changes: 254 additions & 0 deletions .github/workflows/webapp-e2e-tests-on-demand.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,254 @@
name: WebApp E2E Tests On Demand

on:
workflow_dispatch:
inputs:
version:
description: "Target version"
type: choice
required: true
options:
- "8.6"
- "8.7"
- "8.8"
- "8.9"

permissions:
contents: read

jobs:
validate-branch:
runs-on: ubuntu-latest
outputs:
base: ${{ steps.detect-base.outputs.base }}
config_path: ${{ steps.detect-base.outputs.config_path }}
non_standalone: ${{ steps.detect-base.outputs.non_standalone }}

steps:
- name: Detect base branch and config dir
id: detect-base
shell: bash
run: |
set -euo pipefail

version="${{ inputs.version }}"

case "$version" in
"8.6") base="stable/8.6" ;;
"8.7") base="stable/8.7" ;;
"8.8") base="stable/8.8" ;;
"8.9") base="main" ;;
*) echo "Error: unsupported version '$version'"; exit 1 ;;
esac

echo "base=$base" >> "$GITHUB_OUTPUT"

case "$version" in
"8.6")
cfg="fiori-app/webapp/config/8.6"
non_standalone=true
;;
"8.7")
cfg="fiori-app/webapp/config/8.7"
non_standalone=true
;;
"8.8")
cfg="fiori-app/webapp/config/8.8"
non_standalone=false
;;
"8.9")
cfg="fiori-app/webapp/config/8.9"
non_standalone=false
;;
esac

echo "config_path=$cfg" >> "$GITHUB_OUTPUT"
echo "non_standalone=$non_standalone" >> "$GITHUB_OUTPUT"

echo "Version input: $version"
echo "Detected base: $base"
echo "Using config path: $cfg"
echo "NON_STANDALONE: $non_standalone"

webapp-e2e-tests:
name: WebApp E2E Tests (Tasklist ${{ matrix.tasklist_mode }} mode)
needs: [validate-branch]
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
tasklist_mode: ${{ fromJSON((needs.validate-branch.outputs.base == 'stable/8.6' || needs.validate-branch.outputs.base == 'stable/8.7') && '["v1"]' || '["v1","v2"]') }}

steps:
- name: Print base branch and tasklist mode
run: |
echo "Base branch: ${{ needs.validate-branch.outputs.base }}"
echo "Tasklist mode: ${{ matrix.tasklist_mode }}"
echo "Config path: ${{ needs.validate-branch.outputs.config_path }}"
echo "Non-standalone: ${{ needs.validate-branch.outputs.non_standalone }}"

- uses: actions/checkout@v4

- name: Export config variables
shell: bash
run: |
echo "CONFIG_PATH=${{ needs.validate-branch.outputs.config_path }}" >> "$GITHUB_ENV"
echo "NON_STANDALONE=${{ needs.validate-branch.outputs.non_standalone }}" >> "$GITHUB_ENV"

- name: Start Camunda
run: |
if [[ "$NON_STANDALONE" == "true" ]]; then
echo "Using single services for older branches (8.6/8.7)"
DATABASE=elasticsearch docker compose up -d operate tasklist
else
echo "Using standalone camunda container"
if [[ "${{ matrix.tasklist_mode }}" == "v1" ]]; then
echo "Starting with Tasklist V1 mode enabled"
CAMUNDA_TASKLIST_V2_MODE_ENABLED=false DATABASE=elasticsearch docker compose up -d camunda
else
echo "Starting with default Tasklist V2 mode"
DATABASE=elasticsearch docker compose up -d camunda
fi
fi
working-directory: ${{ env.CONFIG_PATH }}

- name: List running Docker containers
run: docker ps -a
working-directory: ${{ env.CONFIG_PATH }}

- name: Wait for services to be ready
id: wait-for-services
run: |
echo "Checking if services are up..."
ready=false

for i in {1..90}; do
if [[ "$NON_STANDALONE" == "true" ]]; then
tasklist_status=$(curl -s -m 5 http://localhost:8080 || echo "Failed")
operate_status=$(curl -s -m 5 http://localhost:8081 || echo "Failed")
else
tasklist_status=$(curl -s -m 5 http://localhost:8080/tasklist || echo "Failed")
operate_status=$(curl -s -m 5 http://localhost:8080/operate || echo "Failed")
identity_status=$(curl -s -m 5 http://localhost:8080/identity || echo "Failed")
fi

if [[ "$NON_STANDALONE" == "true" ]]; then
if [[ "$tasklist_status" != "Failed" && "$operate_status" != "Failed" ]]; then
ready=true
break
fi
else
if [[ "$tasklist_status" != "Failed" && "$operate_status" != "Failed" && "$identity_status" != "Failed" ]]; then
ready=true
break
fi
fi

echo "Waiting for services... ($i/90)"
sleep 10
done

if [[ "$ready" == true ]]; then
echo "ready=true" >> "$GITHUB_OUTPUT"
else
echo "Services failed to start in time."
exit 1
fi
working-directory: ${{ env.CONFIG_PATH }}

- name: Print Docker logs before failing
if: failure()
run: |
if [[ "$NON_STANDALONE" == "true" ]]; then
docker compose logs tasklist
docker compose logs operate
else
docker compose logs camunda
fi
working-directory: ${{ env.CONFIG_PATH }}

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: npm

# - name: Clean install dependencies
# shell: bash
# run: |
# rm -rf node_modules package-lock.json
# npm install
# working-directory: fiori-app/webapp
#
# - name: Import Secrets
# id: secrets
# uses: hashicorp/vault-action@734c523c4fbdb289cdf26dd2dc177f3627d1e140
# with:
# url: ${{ secrets.VAULT_ADDR }}
# method: approle
# roleId: ${{ secrets.VAULT_ROLE_ID }}
# secretId: ${{ secrets.VAULT_SECRET_ID }}
# exportEnv: false
# secrets: |
# secret/data/github.com/organizations/camunda TESTRAIL_QA_EMAIL;
# secret/data/github.com/organizations/camunda TESTRAIL_QA_PSW;
#
# - name: Install Playwright Browsers
# shell: bash
# run: npx playwright install --with-deps chromium
# working-directory: fiori-app/webapp
#
# - name: Python setup
# uses: actions/setup-python@v5
# with:
# python-version: "3.x"
#
#
# - name: Run tests
# shell: bash
# env:
# LOCAL_TEST: "false"
# CAMUNDA_AUTH_STRATEGY: "BASIC"
# CAMUNDA_BASIC_AUTH_USERNAME: "demo"
# CAMUNDA_BASIC_AUTH_PASSWORD: "demo"
# CAMUNDA_TASKLIST_V2_MODE_ENABLED: ${{ matrix.tasklist_mode == 'v2' && 'true' || 'false' }}
# run: |
# if [[ "$NON_STANDALONE" == "true" ]]; then
# export CORE_APPLICATION_TASKLIST_URL="http://localhost:8080"
# export CORE_APPLICATION_OPERATE_URL="http://localhost:8081"
# export ZEEBE_REST_ADDRESS="http://localhost:8089"
# TEST_ARGS=(--project=chromium)
# else
# export CORE_APPLICATION_URL="http://localhost:8080"
# export ZEEBE_REST_ADDRESS="http://localhost:8080"
# TEST_ARGS=(--project=chromium)
# echo "Running tests with args: ${TEST_ARGS[*]}"
# npm run test -- "${TEST_ARGS[@]}"
# working-directory: fiori-app/webapp
#
# - name: Publish test results to TestRail
# if: always()
# shell: bash
# env:
# TESTRAIL_HOST: "https://camunda.testrail.com/"
# TESTRAIL_USERNAME: ${{ steps.secrets.outputs.TESTRAIL_QA_EMAIL }}
# TESTRAIL_KEY: ${{ steps.secrets.outputs.TESTRAIL_QA_PSW }}
# JUNIT_RESULTS_FILE: "fiori-app/webapp/test-results/junit-report.xml"
# run: |
# pip install trcli
# trcli -y -h "$TESTRAIL_HOST" \
# --project 'C8' \
# --username "$TESTRAIL_USERNAME" \
# --key "$TESTRAIL_KEY" \
# parse_junit --suite-id 36641 \
# --title "On Demand C8 SAP BTP Plugin Fiori App Test Run Results - ${{ github.event.inputs.branch }} (Tasklist ${{ matrix.tasklist_mode }} mode) - $(date '+%Y-%m-%d %H:%M:%S')" \
# --close-run \
# -f "$JUNIT_RESULTS_FILE"
#
# - uses: actions/upload-artifact@v4
# if: failure()
# with:
# name: SAP BTP Plugin Fiori App (Tasklist ${{ matrix.tasklist_mode }} mode)
# path: fiori-app/webapp/html-report
# retention-days: 10
90 changes: 90 additions & 0 deletions fiori-app/webapp/config/8.6/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
networks:
zeebe_network: {}

services:
postgres:
container_name: postgres
image: postgres:16.4-alpine
ports:
- '5432:5432'
environment:
POSTGRES_DB: identity
POSTGRES_USER: identity
POSTGRES_PASSWORD: 't2L@!AqSMg8%I%NmHM'
networks:
- zeebe_network

elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:8.15.5
container_name: elasticsearch
environment:
- discovery.type=single-node
- cluster.name=elasticsearch
- bootstrap.memory_lock=true
- xpack.security.enabled=false
- 'ES_JAVA_OPTS=-Xms1024m -Xmx1024m'
- path.repo=/usr/local/els-snapshots
ulimits:
memlock:
soft: -1
hard: -1
ports:
- 9200:9200
- 9300:9300
networks:
- zeebe_network
restart: always
volumes:
- ./els-snapshots:/usr/local/els-snapshots

zeebe: &zeebe
container_name: zeebe-${DATABASE}
image: camunda/zeebe:8.6-SNAPSHOT
environment:
- 'JAVA_TOOL_OPTIONS=-Xms512m -Xmx512m'
#- "JAVA_OPTS=-agentlib:jdwp=transport=dt_socket,address=8000,server=y,suspend=n"
ports:
- 26500:26500
- 9601:9600
- 8089:8080
depends_on:
- ${DATABASE}
networks:
- zeebe_network
env_file:
- envs/.env.database.${DATABASE}
restart: always

tasklist: &tasklist
container_name: tasklist-${DATABASE}
image: camunda/tasklist:8.6-SNAPSHOT
ports:
- 8080:8080
environment:
- SPRING_PROFILES_ACTIVE=dev,auth,e2e-test
depends_on:
- ${DATABASE}
- zeebe
env_file:
- envs/.env.database.${DATABASE}
networks:
- zeebe_network
volumes:
- ./config/custom.css:/usr/local/tasklist/config/custom.css
restart: always

operate: &operate
container_name: operate-${DATABASE}
image: camunda/operate:8.6-SNAPSHOT
ports:
- 8081:8080
environment:
- SPRING_PROFILES_ACTIVE=dev,auth
depends_on:
- ${DATABASE}
- zeebe
env_file:
- envs/.env.database.${DATABASE}
networks:
- zeebe_network
restart: always
44 changes: 44 additions & 0 deletions fiori-app/webapp/config/8.6/envs/.env.database.elasticsearch
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Elasticsearch Configuration for Zeebe, Operate & Tasklist

# Variables
ZEEBE_CONTAINER_NAME=zeebe-${DATABASE}
TASKLIST_CONTAINER_NAME=tasklist-${DATABASE}
DATABASE_CONTAINER_NAME=${DATABASE}

# Zeebe Configuration
ZEEBE_BROKER_CLUSTER_PARTITIONS_COUNT=2
ZEEBE_BROKER_EXPORTERS_ELASTICSEARCH_CLASSNAME=io.camunda.zeebe.exporter.ElasticsearchExporter
ZEEBE_BROKER_EXPORTERS_ELASTICSEARCH_ARGS_URL=http://${DATABASE_CONTAINER_NAME}:9200
ZEEBE_BROKER_EXPORTERS_ELASTICSEARCH_ARGS_BULK_SIZE=1
ZEEBE_BROKER_EXPORTERS_ELASTICSEARCH_ARGS_INDEX_DEPLOYMENT=false
ZEEBE_BROKER_GATEWAY_ENABLE=true
ZEEBE_BROKER_NETWORK_HOST=zeebe
ZEEBE_HOST=${ZEEBE_HOST:-}

# Tasklist Configuration
CAMUNDA_TASKLIST_ELASTICSEARCH_URL=http://${DATABASE_CONTAINER_NAME}:9200
CAMUNDA_TASKLIST_ZEEBEELASTICSEARCH_URL=http://${DATABASE_CONTAINER_NAME}:9200
CAMUNDA_TASKLIST_ZEEBE_GATEWAYADDRESS=${ZEEBE_CONTAINER_NAME}:26500
CAMUNDA_TASKLIST_ZEEBE_RESTADDRESS=http://${ZEEBE_CONTAINER_NAME}:8080
CAMUNDA_TASKLIST_BACKUP_REPOSITORYNAME=test
CAMUNDA_TASKLIST_DATABASE=${DATABASE}
CAMUNDA_TASKLIST_CSRF_PREVENTION_ENABLED=false

# Operate Configuration
CAMUNDA_OPERATE_TASKLIST_URL=http://localhost:8080
CAMUNDA_OPERATE_ZEEBE_GATEWAYADDRESS=${ZEEBE_CONTAINER_NAME}:26500
CAMUNDA_OPERATE_ZEEBE_RESTADDRESS=http://${ZEEBE_CONTAINER_NAME}:8080
CAMUNDA_OPERATE_ELASTICSEARCH_URL=http://${DATABASE_CONTAINER_NAME}:9200
CAMUNDA_OPERATE_ZEEBEELASTICSEARCH_URL=http://${DATABASE_CONTAINER_NAME}:9200
CAMUNDA_OPERATE_BACKUP_REPOSITORYNAME=test
CAMUNDA_OPERATE_DATABASE=${DATABASE}
CAMUNDA_OPERATE_CSRF_PREVENTION_ENABLED=false

# General Configuration
SPRINGFOX_DOCUMENTATION_SWAGGER_V2_PATH=/documentation
CAMUNDA_REST_QUERY_ENABLED=true

# External URLs
EXT_CAMUNDA_TASKLIST_ZEEBE_GATEWAYADDRESS=localhost:26500
EXT_CAMUNDA_TASKLIST_ZEEBE_RESTADDRESS=http://localhost:8089
EXT_ELASTICSEARCH_URL=http://localhost:9200
Loading