From bb2334d0e612c164f854a829051ce5200c64faf4 Mon Sep 17 00:00:00 2001 From: RonnyFray Date: Mon, 15 Aug 2022 08:39:27 -0700 Subject: [PATCH 01/11] Update InstallerTest for CI. Update SecurityTest. --- .../test/java/jpl/cws/test/InstallerTest.java | 57 +++++++++++++++++-- .../test/java/jpl/cws/test/SecurityTest.java | 1 - .../test/resources/configure_with_jacoco.sh | 4 ++ cws-test/src/test/resources/installerTest.sh | 3 +- 4 files changed, 58 insertions(+), 7 deletions(-) diff --git a/cws-test/src/test/java/jpl/cws/test/InstallerTest.java b/cws-test/src/test/java/jpl/cws/test/InstallerTest.java index f39f22a0..af6a34a6 100644 --- a/cws-test/src/test/java/jpl/cws/test/InstallerTest.java +++ b/cws-test/src/test/java/jpl/cws/test/InstallerTest.java @@ -3,6 +3,7 @@ import static org.junit.Assert.assertTrue; import java.io.BufferedReader; +import java.io.File; import java.io.IOException; import java.io.InputStreamReader; import java.nio.charset.Charset; @@ -20,19 +21,18 @@ * Tests related to Security * */ -@Ignore public class InstallerTest { private static Charset charset = StandardCharsets.UTF_8; private static final String NL = System.getProperty("line.separator"); @Before - public void setup() { - + public void setup() throws IOException { + shutdownConsole(); } @After - public void tearDown() { - + public void tearDown() throws IOException { + startConsole(); } /** @@ -109,4 +109,51 @@ public static void writeToFile(Path filePath, String content) throws IOException Files.write(filePath, content.getBytes(charset)); } + public static void shutdownConsole() throws IOException { + try { + String cwsDir = new File(System.getProperty("user.dir")).getParent(); + System.out.println(cwsDir); + String stopConsoleScript = cwsDir + "/dist/console-only/cws/stop_cws.sh"; + String[] command = {"bash", "-c", "bash " + stopConsoleScript}; + + Process proc = Runtime.getRuntime().exec(command); + proc.waitFor(); + StringBuffer output = new StringBuffer(); + BufferedReader reader = new BufferedReader(new InputStreamReader(proc.getInputStream())); + String line = ""; + while ((line = reader.readLine())!= null) { + output.append(line + "\n"); + } + System.out.println("### " + output); + + //Thread.sleep(75000); //wait for shutdown of console. + } + catch (Throwable e) { + System.out.println(e.toString()); + } + } + + public static void startConsole() throws IOException { + try { + String startConsoleScript = new File(System.getProperty("user.dir")).getParent() + "/dist/console-only/cws/start_cws.sh"; + String commandStart = "bash " + startConsoleScript; + + Process procStart = Runtime.getRuntime().exec(commandStart); + procStart.waitFor(); + StringBuffer outputStart = new StringBuffer(); + BufferedReader readerStart = new BufferedReader(new InputStreamReader(procStart.getInputStream())); + String lineStart = ""; + while ((lineStart = readerStart.readLine())!= null) { + outputStart.append(lineStart + "\n"); + } + System.out.println("### " + outputStart); + + //wait for start up of console. + // Thread.sleep(75000); + } + catch (Throwable e) { + System.out.println(e.toString()); + } + } + } diff --git a/cws-test/src/test/java/jpl/cws/test/SecurityTest.java b/cws-test/src/test/java/jpl/cws/test/SecurityTest.java index c7bd52ca..b5ba5640 100644 --- a/cws-test/src/test/java/jpl/cws/test/SecurityTest.java +++ b/cws-test/src/test/java/jpl/cws/test/SecurityTest.java @@ -21,7 +21,6 @@ * Tests related to Security * */ -@Ignore public class SecurityTest { private static Charset charset = StandardCharsets.UTF_8; private static final String NL = System.getProperty("line.separator"); diff --git a/cws-test/src/test/resources/configure_with_jacoco.sh b/cws-test/src/test/resources/configure_with_jacoco.sh index f78e4afa..a37f72ce 100755 --- a/cws-test/src/test/resources/configure_with_jacoco.sh +++ b/cws-test/src/test/resources/configure_with_jacoco.sh @@ -11,6 +11,10 @@ source ${ROOT}/utils.sh CONF_FILE=$1 PROMPT_VALUE=$2 +# ================ +# SETUP VARIABLES +# ================ +export CWS_HOME=${ROOT} export CWS_INSTALLER_PRESET_FILE=${ROOT}/configuration.properties cd $ROOT diff --git a/cws-test/src/test/resources/installerTest.sh b/cws-test/src/test/resources/installerTest.sh index ca4ed43a..ebea28d0 100755 --- a/cws-test/src/test/resources/installerTest.sh +++ b/cws-test/src/test/resources/installerTest.sh @@ -22,7 +22,8 @@ cd $ROOT/../../../newCWSDir/console-only tar zxf cws_server.tar.gz cd cws -cp $ROOT/configuration.properties ./ +#cp $ROOT/configuration.properties ./ +cp $ROOT/../../../../dist/console-only/cws/configuration.properties ./ cp $ROOT/configure_with_jacoco.sh ./ echo "CONFIGURING CWS..." From a7bc66e7fe11be3aae8932281744f78220f73e4b Mon Sep 17 00:00:00 2001 From: RonnyFray Date: Tue, 16 Aug 2022 10:15:33 -0700 Subject: [PATCH 02/11] Update workflow file. Enable run of workflow using the Actions tab. --- .github/workflows/maven.yml | 49 +++++++++++++++++++++---------------- 1 file changed, 28 insertions(+), 21 deletions(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 8cee3da9..0ab16eb9 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -1,9 +1,9 @@ name: CWS CI -# Triggers the workflow on push or pull request -#on: [push, pull_request] +# Triggers the workflow on push or run the workflow using the Actions tab on: push: + workflow_dispatch: schedule: # trigger a build and test of CWS daily at 5 AM PST / 12 PM UTC - cron: '0 12 * * *' @@ -68,6 +68,12 @@ jobs: chmod +x test.sh ./test.sh shell: bash + - name: Run Unit Tests + run: mvn -Dmaven.compiler.debug=true -Dmaven.compiler.debuglevel=lines,vars,source clean test jacoco:report-aggregate + shell: bash + - name: Run Integration Tests + run: mvn -Dmaven.compiler.debug=true -Dmaven.compiler.debuglevel=lines,vars,source integration-test verify -DskipTests + shell: bash - name: Upload Jacoco report uses: actions/upload-artifact@v3 with: @@ -78,23 +84,24 @@ jobs: with: name: test-screenshots path: test-screenshots/ - - name: Send custom JSON data to Slack workflow - id: slack - uses: slackapi/slack-github-action@v1.19.0 - with: + #- name: Send custom JSON data to Slack workflow + #if: ${{ always() }} + #id: slack + #uses: slackapi/slack-github-action@v1.19.0 + #with: # This data can be any valid JSON from a previous step in the GitHub Action - payload: | - { - "status": "GitHub Action build result: ${{ job.status }}\n${{ github.event.pull_request.html_url || github.event.head_commit.url }}", - "blocks": [ - { - "type": "section", - "text": { - "type": "mrkdwn", - "text": "GitHub Action build result: ${{ job.status }}\n${{ github.event.pull_request.html_url || github.event.head_commit.url }}" - } - } - ] - } - env: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + #payload: | + #{ + #"status": "GitHub Action build result: ${{ job.status }}\n${{ github.event.pull_request.html_url || github.event.head_commit.url }}", + #"blocks": [ + #{ + #"type": "section", + #"text": { + #"type": "mrkdwn", + #"text": "GitHub Action build result: ${{ job.status }}\n${{ github.event.pull_request.html_url || github.event.head_commit.url }}" + #} + #} + #] + #} + #env: + #SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} From 79d514d66512e82bfe3db16b432d8774ce1961d1 Mon Sep 17 00:00:00 2001 From: RonnyFray Date: Tue, 16 Aug 2022 10:19:31 -0700 Subject: [PATCH 03/11] Update workflow file. --- .github/workflows/maven.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 0ab16eb9..a4194587 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -63,11 +63,11 @@ jobs: ls -al - uses: browser-actions/setup-chrome@latest - run: chrome --version - - name: Run Unit and Integration Tests - run: | - chmod +x test.sh - ./test.sh - shell: bash + #- name: Run Unit and Integration Tests + #run: | + #chmod +x test.sh + #./test.sh + #shell: bash - name: Run Unit Tests run: mvn -Dmaven.compiler.debug=true -Dmaven.compiler.debuglevel=lines,vars,source clean test jacoco:report-aggregate shell: bash From 43b0d581cf99aa70ac2d73fe539fabb7ffbf52e6 Mon Sep 17 00:00:00 2001 From: RonnyFray Date: Tue, 16 Aug 2022 14:19:24 -0700 Subject: [PATCH 04/11] Test sending workflow failure message. Add webhook payload variable. --- .github/workflows/maven.yml | 38 +++++++++---------- .../src/test/java/jpl/cws/test/WebTest.java | 2 +- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index a4194587..4c7b432e 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -84,24 +84,24 @@ jobs: with: name: test-screenshots path: test-screenshots/ - #- name: Send custom JSON data to Slack workflow - #if: ${{ always() }} - #id: slack - #uses: slackapi/slack-github-action@v1.19.0 - #with: - # This data can be any valid JSON from a previous step in the GitHub Action - #payload: | - #{ - #"status": "GitHub Action build result: ${{ job.status }}\n${{ github.event.pull_request.html_url || github.event.head_commit.url }}", - #"blocks": [ - #{ - #"type": "section", - #"text": { + - name: Send custom JSON data to Slack workflow + if: ${{ always() }} + id: slack + uses: slackapi/slack-github-action@v1.19.0 + with: + This data can be any valid JSON from a previous step in the GitHub Action + payload: | + { + "status": "GitHub Action build result: ${{ job.status }}\n${{ github.event.pull_request.html_url || github.event.head_commit.url }}"\n${{ github.event_name }}, + "blocks": [ + { + "type": "section", + "text": { #"type": "mrkdwn", #"text": "GitHub Action build result: ${{ job.status }}\n${{ github.event.pull_request.html_url || github.event.head_commit.url }}" - #} - #} - #] - #} - #env: - #SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + } + } + ] + } + env: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} diff --git a/cws-test/src/test/java/jpl/cws/test/WebTest.java b/cws-test/src/test/java/jpl/cws/test/WebTest.java index 65af8491..a0d17f3a 100644 --- a/cws-test/src/test/java/jpl/cws/test/WebTest.java +++ b/cws-test/src/test/java/jpl/cws/test/WebTest.java @@ -38,7 +38,7 @@ public void runProcessTest() { log.info("------ START runProcessTest ------"); gotoLoginPage(); login(); - startProcDef("test_simplest", "Test Simplest", 90000); + startProcDef("tes", "Test Simplest", 90000); // simulate unit test failure deleteProc("test_simplest"); logout(); log.info("------ END runProcessTest ------"); From 23ef189da1f12f2be1327ec58fa326443b80fea4 Mon Sep 17 00:00:00 2001 From: RonnyFray Date: Tue, 16 Aug 2022 14:23:07 -0700 Subject: [PATCH 05/11] Test sending workflow failure message. --- .github/workflows/maven.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 4c7b432e..db1f8ea6 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -89,16 +89,16 @@ jobs: id: slack uses: slackapi/slack-github-action@v1.19.0 with: - This data can be any valid JSON from a previous step in the GitHub Action + # This data can be any valid JSON from a previous step in the GitHub Action payload: | { - "status": "GitHub Action build result: ${{ job.status }}\n${{ github.event.pull_request.html_url || github.event.head_commit.url }}"\n${{ github.event_name }}, + "status": "GitHub Action build result: ${{ job.status }}\n${{ github.event.pull_request.html_url || github.event.head_commit.url }}\n${{ github.event_name }}", "blocks": [ { "type": "section", "text": { - #"type": "mrkdwn", - #"text": "GitHub Action build result: ${{ job.status }}\n${{ github.event.pull_request.html_url || github.event.head_commit.url }}" + "type": "mrkdwn", + "text": "GitHub Action build result: ${{ job.status }}\n${{ github.event.pull_request.html_url || github.event.head_commit.url }}\n${{ github.event_name }}" } } ] From a302bc25a56012f6d49802294a9ac9ee5b522f8f Mon Sep 17 00:00:00 2001 From: RonnyFray Date: Thu, 18 Aug 2022 12:09:51 -0700 Subject: [PATCH 06/11] Show webhook payload. Add workflow job URL to Slack message. --- .github/workflows/maven.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index db1f8ea6..8c6e34b6 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -84,6 +84,11 @@ jobs: with: name: test-screenshots path: test-screenshots/ + - name: Show Webhook Payload + if: ${{ always() }} + run: | + cd ${{ github.event_path }} + ls -al - name: Send custom JSON data to Slack workflow if: ${{ always() }} id: slack @@ -92,13 +97,13 @@ jobs: # This data can be any valid JSON from a previous step in the GitHub Action payload: | { - "status": "GitHub Action build result: ${{ job.status }}\n${{ github.event.pull_request.html_url || github.event.head_commit.url }}\n${{ github.event_name }}", + "status": "GitHub Action build result: ${{ job.status }}\n${{ github.event.pull_request.html_url || github.event.head_commit.url }}\n${{ github.event.workflow_job.html_url }}", "blocks": [ { "type": "section", "text": { "type": "mrkdwn", - "text": "GitHub Action build result: ${{ job.status }}\n${{ github.event.pull_request.html_url || github.event.head_commit.url }}\n${{ github.event_name }}" + "text": "GitHub Action build result: ${{ job.status }}\n${{ github.event.pull_request.html_url || github.event.head_commit.url }}\n${{ github.event.workflow_job.html_url }}" } } ] From 487692a6db1db98c5a21e1614e986d8a2691e470 Mon Sep 17 00:00:00 2001 From: RonnyFray Date: Thu, 18 Aug 2022 13:19:12 -0700 Subject: [PATCH 07/11] Add workflow job URL to Slack message. --- .github/workflows/maven.yml | 40 +++++++++---------- .../src/test/java/jpl/cws/test/WebTest.java | 2 +- 2 files changed, 20 insertions(+), 22 deletions(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 8c6e34b6..cdcbe779 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -68,27 +68,25 @@ jobs: #chmod +x test.sh #./test.sh #shell: bash - - name: Run Unit Tests - run: mvn -Dmaven.compiler.debug=true -Dmaven.compiler.debuglevel=lines,vars,source clean test jacoco:report-aggregate - shell: bash - - name: Run Integration Tests - run: mvn -Dmaven.compiler.debug=true -Dmaven.compiler.debuglevel=lines,vars,source integration-test verify -DskipTests - shell: bash - - name: Upload Jacoco report - uses: actions/upload-artifact@v3 - with: - name: jacoco-report - path: jacoco-reports/aggregate/index.html - - name: Upload test screenshots - uses: actions/upload-artifact@v3 - with: - name: test-screenshots - path: test-screenshots/ + #- name: Run Unit Tests + #run: mvn -Dmaven.compiler.debug=true -Dmaven.compiler.debuglevel=lines,vars,source clean test jacoco:report-aggregate + #shell: bash + #- name: Run Integration Tests + #run: mvn -Dmaven.compiler.debug=true -Dmaven.compiler.debuglevel=lines,vars,source integration-test verify -DskipTests + #shell: bash + #- name: Upload Jacoco report + #uses: actions/upload-artifact@v3 + #with: + #name: jacoco-report + #path: jacoco-reports/aggregate/index.html + #- name: Upload test screenshots + #uses: actions/upload-artifact@v3 + #with: + #name: test-screenshots + #path: test-screenshots/ - name: Show Webhook Payload if: ${{ always() }} - run: | - cd ${{ github.event_path }} - ls -al + run: cat ${{ github.event_path }} - name: Send custom JSON data to Slack workflow if: ${{ always() }} id: slack @@ -97,13 +95,13 @@ jobs: # This data can be any valid JSON from a previous step in the GitHub Action payload: | { - "status": "GitHub Action build result: ${{ job.status }}\n${{ github.event.pull_request.html_url || github.event.head_commit.url }}\n${{ github.event.workflow_job.html_url }}", + "status": "GitHub Action build result: ${{ job.status }}\n${{ github.event.pull_request.html_url || github.event.head_commit.url }}\n${{ github.action.workflow_job.html_url }}", "blocks": [ { "type": "section", "text": { "type": "mrkdwn", - "text": "GitHub Action build result: ${{ job.status }}\n${{ github.event.pull_request.html_url || github.event.head_commit.url }}\n${{ github.event.workflow_job.html_url }}" + "text": "GitHub Action build result: ${{ job.status }}\n${{ github.event.pull_request.html_url || github.event.head_commit.url }}\n${{ github.action.workflow_job.html_url }}" } } ] diff --git a/cws-test/src/test/java/jpl/cws/test/WebTest.java b/cws-test/src/test/java/jpl/cws/test/WebTest.java index a0d17f3a..65af8491 100644 --- a/cws-test/src/test/java/jpl/cws/test/WebTest.java +++ b/cws-test/src/test/java/jpl/cws/test/WebTest.java @@ -38,7 +38,7 @@ public void runProcessTest() { log.info("------ START runProcessTest ------"); gotoLoginPage(); login(); - startProcDef("tes", "Test Simplest", 90000); // simulate unit test failure + startProcDef("test_simplest", "Test Simplest", 90000); deleteProc("test_simplest"); logout(); log.info("------ END runProcessTest ------"); From 0ac914042952351a70d8d5a23e856f8a6a091d2f Mon Sep 17 00:00:00 2001 From: RonnyFray Date: Thu, 18 Aug 2022 16:04:38 -0700 Subject: [PATCH 08/11] Run Unit and Integration Tests Separately. --- .github/workflows/maven.yml | 73 ++++++++++++++++++------------------- 1 file changed, 35 insertions(+), 38 deletions(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index cdcbe779..a4194587 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -68,43 +68,40 @@ jobs: #chmod +x test.sh #./test.sh #shell: bash - #- name: Run Unit Tests - #run: mvn -Dmaven.compiler.debug=true -Dmaven.compiler.debuglevel=lines,vars,source clean test jacoco:report-aggregate - #shell: bash - #- name: Run Integration Tests - #run: mvn -Dmaven.compiler.debug=true -Dmaven.compiler.debuglevel=lines,vars,source integration-test verify -DskipTests - #shell: bash - #- name: Upload Jacoco report - #uses: actions/upload-artifact@v3 - #with: - #name: jacoco-report - #path: jacoco-reports/aggregate/index.html - #- name: Upload test screenshots - #uses: actions/upload-artifact@v3 - #with: - #name: test-screenshots - #path: test-screenshots/ - - name: Show Webhook Payload - if: ${{ always() }} - run: cat ${{ github.event_path }} - - name: Send custom JSON data to Slack workflow - if: ${{ always() }} - id: slack - uses: slackapi/slack-github-action@v1.19.0 + - name: Run Unit Tests + run: mvn -Dmaven.compiler.debug=true -Dmaven.compiler.debuglevel=lines,vars,source clean test jacoco:report-aggregate + shell: bash + - name: Run Integration Tests + run: mvn -Dmaven.compiler.debug=true -Dmaven.compiler.debuglevel=lines,vars,source integration-test verify -DskipTests + shell: bash + - name: Upload Jacoco report + uses: actions/upload-artifact@v3 with: + name: jacoco-report + path: jacoco-reports/aggregate/index.html + - name: Upload test screenshots + uses: actions/upload-artifact@v3 + with: + name: test-screenshots + path: test-screenshots/ + #- name: Send custom JSON data to Slack workflow + #if: ${{ always() }} + #id: slack + #uses: slackapi/slack-github-action@v1.19.0 + #with: # This data can be any valid JSON from a previous step in the GitHub Action - payload: | - { - "status": "GitHub Action build result: ${{ job.status }}\n${{ github.event.pull_request.html_url || github.event.head_commit.url }}\n${{ github.action.workflow_job.html_url }}", - "blocks": [ - { - "type": "section", - "text": { - "type": "mrkdwn", - "text": "GitHub Action build result: ${{ job.status }}\n${{ github.event.pull_request.html_url || github.event.head_commit.url }}\n${{ github.action.workflow_job.html_url }}" - } - } - ] - } - env: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + #payload: | + #{ + #"status": "GitHub Action build result: ${{ job.status }}\n${{ github.event.pull_request.html_url || github.event.head_commit.url }}", + #"blocks": [ + #{ + #"type": "section", + #"text": { + #"type": "mrkdwn", + #"text": "GitHub Action build result: ${{ job.status }}\n${{ github.event.pull_request.html_url || github.event.head_commit.url }}" + #} + #} + #] + #} + #env: + #SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} From 92b0c83d0ce4ad9a692b160c96fb8f9c1271f5af Mon Sep 17 00:00:00 2001 From: RonnyFray Date: Wed, 31 Aug 2022 10:42:56 -0700 Subject: [PATCH 09/11] Add processEnginePlugins property to camunda.cfg.xml Restore EmailTaskTest Update workflow file --- .github/workflows/maven.yml | 52 ++++----- ci/run_ci.sh | 2 +- .../jpl/cws/test/CmdLineExecTaskTest.java | 2 - .../jpl/cws/test/CustomMethodCallTest.java | 1 - .../test/java/jpl/cws/test/Cws331Test.java | 1 - .../test/java/jpl/cws/test/CwsTestBase.java | 1 - .../test/java/jpl/cws/test/CwsTestBase2.java | 1 - .../test/java/jpl/cws/test/EmailTaskTest.java | 13 +-- .../test/java/jpl/cws/test/Issue16Test.java | 1 - .../test/java/jpl/cws/test/SleepTaskTest.java | 1 - .../cws/test/SubProcessBoundaryCatchTest.java | 1 - .../jpl/cws/test/TaskInstanceCountTest.java | 1 - .../test/resources/bpmn/test_email_task.bpmn | 101 +++++++++--------- cws-test/src/test/resources/camunda.cfg.xml | 7 ++ 14 files changed, 86 insertions(+), 99 deletions(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index a4194587..59232ada 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -1,9 +1,8 @@ name: CWS CI -# Triggers the workflow on push or run the workflow using the Actions tab +# Triggers the workflow on push on: push: - workflow_dispatch: schedule: # trigger a build and test of CWS daily at 5 AM PST / 12 PM UTC - cron: '0 12 * * *' @@ -47,10 +46,6 @@ jobs: run: | sleep 5s docker ps -a - - name: Stop CWS - run: | - chmod +x stop_dev.sh - ./stop_dev.sh - name: Run CWS run: | cd ci @@ -63,11 +58,6 @@ jobs: ls -al - uses: browser-actions/setup-chrome@latest - run: chrome --version - #- name: Run Unit and Integration Tests - #run: | - #chmod +x test.sh - #./test.sh - #shell: bash - name: Run Unit Tests run: mvn -Dmaven.compiler.debug=true -Dmaven.compiler.debuglevel=lines,vars,source clean test jacoco:report-aggregate shell: bash @@ -84,24 +74,24 @@ jobs: with: name: test-screenshots path: test-screenshots/ - #- name: Send custom JSON data to Slack workflow - #if: ${{ always() }} - #id: slack - #uses: slackapi/slack-github-action@v1.19.0 - #with: + - name: Send custom JSON data to Slack workflow + if: ${{ always() }} + id: slack + uses: slackapi/slack-github-action@v1.19.0 + with: # This data can be any valid JSON from a previous step in the GitHub Action - #payload: | - #{ - #"status": "GitHub Action build result: ${{ job.status }}\n${{ github.event.pull_request.html_url || github.event.head_commit.url }}", - #"blocks": [ - #{ - #"type": "section", - #"text": { - #"type": "mrkdwn", - #"text": "GitHub Action build result: ${{ job.status }}\n${{ github.event.pull_request.html_url || github.event.head_commit.url }}" - #} - #} - #] - #} - #env: - #SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + payload: | + { + "status": "GitHub Action build result: ${{ job.status }}\n${{ github.event.pull_request.html_url || github.event.head_commit.url }}", + "blocks": [ + { + "type": "section", + "text": { + "type": "mrkdwn", + "text": "GitHub Action build result: ${{ job.status }}\n${{ github.event.pull_request.html_url || github.event.head_commit.url }}" + } + } + ] + } + env: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} diff --git a/ci/run_ci.sh b/ci/run_ci.sh index af40b703..8dc8f470 100755 --- a/ci/run_ci.sh +++ b/ci/run_ci.sh @@ -17,7 +17,7 @@ DB_TYPE=mariadb DB_HOST=127.0.0.1 DB_NAME=cws_dev # needs to match the db you set up beforehand DB_USER=root # needs to match the user you set up beforehand -DB_PASS=rootpw # could also be specified with environment vars +DB_PASS=adminpw # could also be specified with environment vars DB_PORT=3306 # mariadb default USER=cwsci diff --git a/cws-test/src/test/java/jpl/cws/test/CmdLineExecTaskTest.java b/cws-test/src/test/java/jpl/cws/test/CmdLineExecTaskTest.java index 771f3cf9..1d9bb035 100644 --- a/cws-test/src/test/java/jpl/cws/test/CmdLineExecTaskTest.java +++ b/cws-test/src/test/java/jpl/cws/test/CmdLineExecTaskTest.java @@ -1,6 +1,5 @@ package jpl.cws.test; -//import static org.camunda.bpm.engine.test.assertions.ProcessEngineAssertions.assertThat; import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.*; import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.runtimeService; import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.withVariables; @@ -18,7 +17,6 @@ * Tests related to EmailTask * */ -@Ignore public class CmdLineExecTaskTest extends CwsTestBase { @Rule diff --git a/cws-test/src/test/java/jpl/cws/test/CustomMethodCallTest.java b/cws-test/src/test/java/jpl/cws/test/CustomMethodCallTest.java index 34e16ef0..2c3bb9c1 100644 --- a/cws-test/src/test/java/jpl/cws/test/CustomMethodCallTest.java +++ b/cws-test/src/test/java/jpl/cws/test/CustomMethodCallTest.java @@ -1,6 +1,5 @@ package jpl.cws.test; -//import static org.camunda.bpm.engine.test.assertions.ProcessEngineAssertions.assertThat; import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.*; import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.runtimeService; import static org.junit.Assert.fail; diff --git a/cws-test/src/test/java/jpl/cws/test/Cws331Test.java b/cws-test/src/test/java/jpl/cws/test/Cws331Test.java index 43271c02..87187bed 100644 --- a/cws-test/src/test/java/jpl/cws/test/Cws331Test.java +++ b/cws-test/src/test/java/jpl/cws/test/Cws331Test.java @@ -1,6 +1,5 @@ package jpl.cws.test; -//import static org.camunda.bpm.engine.test.assertions.ProcessEngineAssertions.assertThat; import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.*; import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.execute; import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.job; diff --git a/cws-test/src/test/java/jpl/cws/test/CwsTestBase.java b/cws-test/src/test/java/jpl/cws/test/CwsTestBase.java index d01bcf9b..8772e4b4 100644 --- a/cws-test/src/test/java/jpl/cws/test/CwsTestBase.java +++ b/cws-test/src/test/java/jpl/cws/test/CwsTestBase.java @@ -1,6 +1,5 @@ package jpl.cws.test; -//import static org.camunda.bpm.engine.test.assertions.ProcessEngineAssertions.assertThat; import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.*; import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.claim; import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.complete; diff --git a/cws-test/src/test/java/jpl/cws/test/CwsTestBase2.java b/cws-test/src/test/java/jpl/cws/test/CwsTestBase2.java index f617fad3..b9cf1a00 100644 --- a/cws-test/src/test/java/jpl/cws/test/CwsTestBase2.java +++ b/cws-test/src/test/java/jpl/cws/test/CwsTestBase2.java @@ -1,6 +1,5 @@ package jpl.cws.test; -//import static org.camunda.bpm.engine.test.assertions.ProcessEngineAssertions.assertThat; import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.*; import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.claim; import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.complete; diff --git a/cws-test/src/test/java/jpl/cws/test/EmailTaskTest.java b/cws-test/src/test/java/jpl/cws/test/EmailTaskTest.java index 29bf1638..1606ac68 100644 --- a/cws-test/src/test/java/jpl/cws/test/EmailTaskTest.java +++ b/cws-test/src/test/java/jpl/cws/test/EmailTaskTest.java @@ -1,6 +1,5 @@ package jpl.cws.test; -//import static org.camunda.bpm.engine.test.assertions.ProcessEngineAssertions.assertThat; import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.*; import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.runtimeService; import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.withVariables; @@ -13,10 +12,7 @@ import org.camunda.bpm.engine.test.Deployment; import org.camunda.bpm.engine.test.ProcessEngineRule; import org.camunda.bpm.engine.test.mock.Mocks; -import org.junit.After; -import org.junit.Before; -import org.junit.Ignore; -import org.junit.Rule; +import org.junit.*; import com.dumbster.smtp.SimpleSmtpServer; import com.dumbster.smtp.SmtpMessage; @@ -50,8 +46,7 @@ public void tearDown() { * Tests BPMN process that sends an email using EmailTask. * */ - //@Test - @Ignore + @Test @Deployment(resources = {"bpmn/test_email_task.bpmn"}) public void testCase1() { try { @@ -81,8 +76,8 @@ public void testCase1() { assertTrue(email.getBody().contains("this
has
line
breaks!")); // verify to/from - assertTrue(email.getHeaderValue("From").equals("user@localhost")); - assertTrue(email.getHeaderValue("To").equals("user@localhost")); + assertTrue(email.getHeaderValue("From").equals("user@domain.com")); + assertTrue(email.getHeaderValue("To").equals("user@domain.org")); } } \ No newline at end of file diff --git a/cws-test/src/test/java/jpl/cws/test/Issue16Test.java b/cws-test/src/test/java/jpl/cws/test/Issue16Test.java index 590c24ad..3afe54f3 100644 --- a/cws-test/src/test/java/jpl/cws/test/Issue16Test.java +++ b/cws-test/src/test/java/jpl/cws/test/Issue16Test.java @@ -15,7 +15,6 @@ /** * */ -@Ignore public class Issue16Test extends CwsTestBase { private static final Logger log = LoggerFactory.getLogger(Issue16Test.class); diff --git a/cws-test/src/test/java/jpl/cws/test/SleepTaskTest.java b/cws-test/src/test/java/jpl/cws/test/SleepTaskTest.java index 93100b4c..e6e859e8 100644 --- a/cws-test/src/test/java/jpl/cws/test/SleepTaskTest.java +++ b/cws-test/src/test/java/jpl/cws/test/SleepTaskTest.java @@ -1,6 +1,5 @@ package jpl.cws.test; -//import static org.camunda.bpm.engine.test.assertions.ProcessEngineAssertions.assertThat; import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.*; import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.runtimeService; import static org.junit.Assert.assertTrue; diff --git a/cws-test/src/test/java/jpl/cws/test/SubProcessBoundaryCatchTest.java b/cws-test/src/test/java/jpl/cws/test/SubProcessBoundaryCatchTest.java index 5590131f..1ab022f8 100644 --- a/cws-test/src/test/java/jpl/cws/test/SubProcessBoundaryCatchTest.java +++ b/cws-test/src/test/java/jpl/cws/test/SubProcessBoundaryCatchTest.java @@ -1,6 +1,5 @@ package jpl.cws.test; -//import static org.camunda.bpm.engine.test.assertions.ProcessEngineAssertions.assertThat; import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.*; import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.runtimeService; import static org.junit.Assert.fail; diff --git a/cws-test/src/test/java/jpl/cws/test/TaskInstanceCountTest.java b/cws-test/src/test/java/jpl/cws/test/TaskInstanceCountTest.java index 85f117ad..8d00a121 100644 --- a/cws-test/src/test/java/jpl/cws/test/TaskInstanceCountTest.java +++ b/cws-test/src/test/java/jpl/cws/test/TaskInstanceCountTest.java @@ -1,6 +1,5 @@ package jpl.cws.test; -//import static org.camunda.bpm.engine.test.assertions.ProcessEngineAssertions.assertThat; import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.*; import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.runtimeService; import static org.junit.Assert.fail; diff --git a/cws-test/src/test/resources/bpmn/test_email_task.bpmn b/cws-test/src/test/resources/bpmn/test_email_task.bpmn index c6125946..91ed23eb 100644 --- a/cws-test/src/test/resources/bpmn/test_email_task.bpmn +++ b/cws-test/src/test/resources/bpmn/test_email_task.bpmn @@ -1,56 +1,61 @@ - - - - - - - - - - - - - SequenceFlow_1 - SequenceFlow_2 - - - SequenceFlow_1 - - - - - SequenceFlow_2 - - + + + + SequenceFlow_1 + + + + + ${execution.getVariable('smtpHost') == null ? 'localhost' : smtpHost} + + + ${execution.getVariable('smtpPort') == null ? '25' : smtpPort} + + + user@domain.com + + + user@domain.org + + + test from CWS + + + ${body} + + + html + + + SequenceFlow_1 + SequenceFlow_2 + + + SequenceFlow_2 + + + + - + + + + + + + + + - - - - + - - + + - - - - - + + - - - - - - - - - - - - \ No newline at end of file + diff --git a/cws-test/src/test/resources/camunda.cfg.xml b/cws-test/src/test/resources/camunda.cfg.xml index 4180f3ae..70987a4a 100644 --- a/cws-test/src/test/resources/camunda.cfg.xml +++ b/cws-test/src/test/resources/camunda.cfg.xml @@ -11,5 +11,12 @@ + + + + + + + From 37dee2dd410fdcaa95b1ba8c7e36a02ef173cae5 Mon Sep 17 00:00:00 2001 From: RonnyFray Date: Wed, 31 Aug 2022 10:51:06 -0700 Subject: [PATCH 10/11] Update workflow file. --- .github/workflows/maven.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 59232ada..5f8f14b0 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -41,7 +41,7 @@ jobs: cd install/docker/es-only docker-compose up -d - name: Set up CWS database using Docker - run: docker run -d -p 3306:3306 -e MYSQL_DATABASE=cws_dev -e MYSQL_ROOT_PASSWORD=rootpw --name mdb103 mariadb:10.3 + run: docker run -d -p 3306:3306 -e MYSQL_DATABASE=cws_dev -e MYSQL_ROOT_PASSWORD=adminpw --name mdb103 mariadb:10.3 - name: Show Docker containers run: | sleep 5s From 9f71d49c8cc1be14f353254061fa6e621cd44a90 Mon Sep 17 00:00:00 2001 From: RonnyFray Date: Wed, 31 Aug 2022 13:39:04 -0700 Subject: [PATCH 11/11] Display actual JSON data in history page --- .../src/main/java/jpl/cws/service/CwsConsoleService.java | 4 ++-- install/cws-ui/applicationContext.xml | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/cws-service/src/main/java/jpl/cws/service/CwsConsoleService.java b/cws-service/src/main/java/jpl/cws/service/CwsConsoleService.java index 4d21bff1..6ecfdfaa 100644 --- a/cws-service/src/main/java/jpl/cws/service/CwsConsoleService.java +++ b/cws-service/src/main/java/jpl/cws/service/CwsConsoleService.java @@ -481,8 +481,8 @@ private void getHistoryVarDetails(List history, String processIns if (variable.getSerializerName().equals("json")) { - // TODO: Update this to display the actual JSON data in history (Collapsible table hopefully?) - message = "Setting (json) " + variable.getVariableName() + " = " + " "; + // TODO: Update this to be a collapsible table + message = "Setting (json) " + variable.getVariableName() + " = " + variable.getValue(); } else { message = "Setting (" + variable.getTypeName() + ") " + variable.getVariableName() + " = " + variable.getValue(); diff --git a/install/cws-ui/applicationContext.xml b/install/cws-ui/applicationContext.xml index 7387350a..8f438875 100644 --- a/install/cws-ui/applicationContext.xml +++ b/install/cws-ui/applicationContext.xml @@ -57,6 +57,7 @@ + __LDAP_PLUGIN_REF__