From fb376a1bd2f4682fb502119595b1ed724a8e5e22 Mon Sep 17 00:00:00 2001 From: Nolan Ehrstrom Date: Thu, 9 Apr 2026 12:32:09 -0700 Subject: [PATCH 1/5] Add testbench --- .github/workflows/deploy-pm4.yml | 37 ++++++++++++++++++++++++++++++-- 1 file changed, 35 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy-pm4.yml b/.github/workflows/deploy-pm4.yml index 25850ab..d14fe5e 100644 --- a/.github/workflows/deploy-pm4.yml +++ b/.github/workflows/deploy-pm4.yml @@ -104,6 +104,9 @@ jobs: if: contains(github.event.pull_request.body, 'ci:deploy') needs: imageEKS runs-on: ${{ vars.RUNNER }} + outputs: + instance: ${{ steps.deploy-instance.outputs.instance }} + instance_url: ${{ steps.deploy-instance.outputs.instance_url }} steps: - name: Checkout .github repo uses: actions/checkout@v4 @@ -141,6 +144,7 @@ jobs: - name: Deploy instance EKS + id: deploy-instance env: IMAGE_TAG: ${{ env.IMAGE_TAG }} CURRENT_DATE: ${{ env.CURRENT_DATE }} @@ -193,6 +197,10 @@ jobs: export INSTANCE_URL="https://ci-$instance.engk8s.processmaker.net" fi echo "Instance URL: $INSTANCE_URL" + { + echo "instance=$instance" + echo "instance_url=$INSTANCE_URL" + } >> "$GITHUB_OUTPUT" bash .github/scripts/gh_comment.sh "$CI_PROJECT" "$pull_req_id" runAPITest: @@ -236,8 +244,7 @@ jobs: - name: Run the API tests run: | - INSTANCE=$(echo -n ${{env.IMAGE_TAG}} | md5sum | head -c 10) - namespace="ci-$INSTANCE-ns-pm4" + namespace="ci-${{ needs.deployEKS.outputs.instance }}-ns-pm4" pr_body=$(jq -r .pull_request.body < "$GITHUB_EVENT_PATH" | base64) kubectl get pods --namespace=$namespace pod_names=$(kubectl get pods --namespace=$namespace --field-selector=status.phase=Running -o jsonpath="{.items[*].metadata.name}" | tr ' ' '\n' | grep -E '(-processmaker-scheduler-)') @@ -275,6 +282,32 @@ jobs: -H "Accept: application/vnd.github.v3+json" \ -d "$json_payload" \ "${URL}" + + runTestbench: + name: Run Testbench + needs: [deployEKS] + if: contains(github.event.pull_request.body, 'ci:run-testbench') + runs-on: ${{ vars.RUNNER }} + steps: + - name: Checkout testbench + uses: actions/checkout@v4 + with: + repository: ProcessMaker/testbench + path: testbench + + - name: Run testbench + working-directory: testbench + env: + SITE_NAME: CI + URL: ${{ needs.deployEKS.outputs.instance_url }} + INSTANCE_PASSWORD: ${{ secrets.CI_INSTANCE_PASSWORD }} + CONTEXT_PATH: ./context + TCP_TUNNELS: "mailserver:587 mailserver:993" + run: | + export USER_GROUP="$(id -u):$(id -g)" + chmod +x ./start.sh + ./start.sh + deleteEKS: name: Delete Instance if: github.event.action == 'closed' || inputs.delete != '' From 7182b5bb4d72d6948e06211ba56df973c7468bf5 Mon Sep 17 00:00:00 2001 From: Nolan Ehrstrom Date: Thu, 9 Apr 2026 13:54:26 -0700 Subject: [PATCH 2/5] Fix secrets output --- .github/workflows/deploy-pm4.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/deploy-pm4.yml b/.github/workflows/deploy-pm4.yml index d14fe5e..d002fa1 100644 --- a/.github/workflows/deploy-pm4.yml +++ b/.github/workflows/deploy-pm4.yml @@ -192,14 +192,16 @@ jobs: chmod +x .github/scripts/deploy-instance.sh bash .github/scripts/deploy-instance.sh if [ "$MULTITENANCY" = "true" ]; then - export INSTANCE_URL="https://tenant-1.ci-$instance.engk8s.processmaker.net" + export INSTANCE_URL_PREFIX="https://tenant-1.ci-$instance" else - export INSTANCE_URL="https://ci-$instance.engk8s.processmaker.net" + export INSTANCE_URL_PREFIX="https://ci-$instance" fi + export INSTANCE_URL="${INSTANCE_URL_PREFIX}.engk8s.processmaker.net" echo "Instance URL: $INSTANCE_URL" + echo "INSTANCE_URL_PREFIX: $INSTANCE_URL_PREFIX" { echo "instance=$instance" - echo "instance_url=$INSTANCE_URL" + echo "instance_url_prefix=$INSTANCE_URL_PREFIX" } >> "$GITHUB_OUTPUT" bash .github/scripts/gh_comment.sh "$CI_PROJECT" "$pull_req_id" @@ -299,7 +301,7 @@ jobs: working-directory: testbench env: SITE_NAME: CI - URL: ${{ needs.deployEKS.outputs.instance_url }} + URL: ${{ needs.deployEKS.outputs.instance_url_prefix }}.engk8s.processmaker.net INSTANCE_PASSWORD: ${{ secrets.CI_INSTANCE_PASSWORD }} CONTEXT_PATH: ./context TCP_TUNNELS: "mailserver:587 mailserver:993" From 0ba6b4df8cb298356dfe7aba5311c73ade7f54c6 Mon Sep 17 00:00:00 2001 From: Nolan Ehrstrom Date: Thu, 9 Apr 2026 14:20:38 -0700 Subject: [PATCH 3/5] Allow skip redeploy --- .github/workflows/deploy-pm4.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/deploy-pm4.yml b/.github/workflows/deploy-pm4.yml index d002fa1..52a3cf1 100644 --- a/.github/workflows/deploy-pm4.yml +++ b/.github/workflows/deploy-pm4.yml @@ -33,6 +33,7 @@ env: MULTITENANCY: ${{ (contains(github.event.pull_request.body, 'ci:multitenancy')) && 'true' || 'false' }} BASE_IMAGE: ${{ secrets.REGISTRY_HOST }}/processmaker/processmaker:base CUSTOMER_LICENSES_PAT: ${{ secrets.CUSTOMER_LICENSES_PAT }} + SKIP_REDEPLOY: ${{ (contains(github.event.pull_request.body, 'ci:skip-redeploy')) && 'true' || 'false' }} # K8S_BRANCH: ${{ contains(github.event.pull_request.body, 'ci:next') && 'next' || 'release-2024-fall' }} concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}-${{ inputs.delete }} @@ -173,6 +174,9 @@ jobs: instance=$(echo -n ${{env.IMAGE_TAG}} | md5sum | head -c 10) echo "INSTANCE: $instance" echo "IMAGE_TAG: $IMAGE_TAG" + + if [[ "${{ env.SKIP_REDEPLOY }}" != "true" ]]; then + sed -i "s#{{INSTANCE}}#$instance#g" .github/scripts/deploy-instance.sh sed -i "s#{{INSTANCE}}#$instance#g" .github/templates/instance.yaml sed -i "s#{{INSTANCE}}#$instance#g" .github/templates/db.yaml @@ -191,6 +195,7 @@ jobs: cat .github/templates/db.yaml chmod +x .github/scripts/deploy-instance.sh bash .github/scripts/deploy-instance.sh + fi if [ "$MULTITENANCY" = "true" ]; then export INSTANCE_URL_PREFIX="https://tenant-1.ci-$instance" else From 0132f03fb613bd0eb5d3669326567d7ddc80cd21 Mon Sep 17 00:00:00 2001 From: Nolan Ehrstrom Date: Thu, 9 Apr 2026 14:51:11 -0700 Subject: [PATCH 4/5] . --- .github/workflows/deploy-pm4.yml | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/.github/workflows/deploy-pm4.yml b/.github/workflows/deploy-pm4.yml index 52a3cf1..880240b 100644 --- a/.github/workflows/deploy-pm4.yml +++ b/.github/workflows/deploy-pm4.yml @@ -105,9 +105,6 @@ jobs: if: contains(github.event.pull_request.body, 'ci:deploy') needs: imageEKS runs-on: ${{ vars.RUNNER }} - outputs: - instance: ${{ steps.deploy-instance.outputs.instance }} - instance_url: ${{ steps.deploy-instance.outputs.instance_url }} steps: - name: Checkout .github repo uses: actions/checkout@v4 @@ -145,7 +142,6 @@ jobs: - name: Deploy instance EKS - id: deploy-instance env: IMAGE_TAG: ${{ env.IMAGE_TAG }} CURRENT_DATE: ${{ env.CURRENT_DATE }} @@ -194,20 +190,14 @@ jobs: echo "=== Checking db.yaml after replacements ===" cat .github/templates/db.yaml chmod +x .github/scripts/deploy-instance.sh - bash .github/scripts/deploy-instance.sh fi + bash .github/scripts/deploy-instance.sh if [ "$MULTITENANCY" = "true" ]; then - export INSTANCE_URL_PREFIX="https://tenant-1.ci-$instance" + export INSTANCE_URL="https://tenant-1.ci-$instance.engk8s.processmaker.net" else - export INSTANCE_URL_PREFIX="https://ci-$instance" + export INSTANCE_URL="https://ci-$instance.engk8s.processmaker.net" fi - export INSTANCE_URL="${INSTANCE_URL_PREFIX}.engk8s.processmaker.net" echo "Instance URL: $INSTANCE_URL" - echo "INSTANCE_URL_PREFIX: $INSTANCE_URL_PREFIX" - { - echo "instance=$instance" - echo "instance_url_prefix=$INSTANCE_URL_PREFIX" - } >> "$GITHUB_OUTPUT" bash .github/scripts/gh_comment.sh "$CI_PROJECT" "$pull_req_id" runAPITest: @@ -251,7 +241,8 @@ jobs: - name: Run the API tests run: | - namespace="ci-${{ needs.deployEKS.outputs.instance }}-ns-pm4" + INSTANCE=$(echo -n ${{env.IMAGE_TAG}} | md5sum | head -c 10) + namespace="ci-$INSTANCE-ns-pm4" pr_body=$(jq -r .pull_request.body < "$GITHUB_EVENT_PATH" | base64) kubectl get pods --namespace=$namespace pod_names=$(kubectl get pods --namespace=$namespace --field-selector=status.phase=Running -o jsonpath="{.items[*].metadata.name}" | tr ' ' '\n' | grep -E '(-processmaker-scheduler-)') @@ -306,11 +297,18 @@ jobs: working-directory: testbench env: SITE_NAME: CI - URL: ${{ needs.deployEKS.outputs.instance_url_prefix }}.engk8s.processmaker.net INSTANCE_PASSWORD: ${{ secrets.CI_INSTANCE_PASSWORD }} CONTEXT_PATH: ./context TCP_TUNNELS: "mailserver:587 mailserver:993" run: | + instance=$(echo -n ${{env.IMAGE_TAG}} | md5sum | head -c 10) + echo "INSTANCE: $instance" + if [ "${{ env.MULTITENANCY }}" = "true" ]; then + export URL="https://tenant-1.ci-$instance.engk8s.processmaker.net" + else + export URL="https://ci-$instance.engk8s.processmaker.net" + fi + echo "URL: $URL" export USER_GROUP="$(id -u):$(id -g)" chmod +x ./start.sh ./start.sh From d809d6795d27f899bcf62ff121f6f3351062258c Mon Sep 17 00:00:00 2001 From: Nolan Ehrstrom Date: Thu, 9 Apr 2026 15:01:11 -0700 Subject: [PATCH 5/5] Fix conditional --- .github/workflows/deploy-pm4.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy-pm4.yml b/.github/workflows/deploy-pm4.yml index 880240b..3b34a2d 100644 --- a/.github/workflows/deploy-pm4.yml +++ b/.github/workflows/deploy-pm4.yml @@ -190,8 +190,8 @@ jobs: echo "=== Checking db.yaml after replacements ===" cat .github/templates/db.yaml chmod +x .github/scripts/deploy-instance.sh - fi bash .github/scripts/deploy-instance.sh + fi if [ "$MULTITENANCY" = "true" ]; then export INSTANCE_URL="https://tenant-1.ci-$instance.engk8s.processmaker.net" else