From 3b6ed1c9522421b0033e99d653f076274133979c Mon Sep 17 00:00:00 2001 From: "KEYSIGHT\\ziliyeoh" Date: Tue, 15 Oct 2024 10:00:56 +0800 Subject: [PATCH 1/5] Update DAI version support 7.5.0-3 --- README.md | 14 ++++++++++++-- action.yml | 35 ++++++++++++++++++++++++----------- 2 files changed, 36 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 5550916..0eca964 100644 --- a/README.md +++ b/README.md @@ -114,6 +114,12 @@ The **DAI Client Secret** can be obtained by go to `http(s):/dai_server_hostname ### `eggplantRunnerPath` **[Optional]** The path to eggplant runner CLI executable.
+### `parameters` +**[Optional]** The global parameter(s) to override in the format `parameter_name=parameter_value`
+Multiple parameters can be overriden with a `;;` delimiter between them
+**Example:** `username=Lily`
+**Example:** `username=Lily;;city=Paris;;hobby=Jogging` + ## Output ### Pipeline triggered Based on the pipeline .yml configuration, when there is commits or pull request action performed. The pipeline will be triggered and Eggplant DAI Runner will be executed. @@ -133,12 +139,16 @@ Based on the pipeline .yml configuration, when there is commits or pull request - 7.4.0-4 + 7.5.0-3 latest + + 7.4.0-4 + v1.0.12 + 7.3.0-3 - v1.0.11 + v1.0.11 7.2.0-4 diff --git a/action.yml b/action.yml index 729d3ae..e3ce178 100644 --- a/action.yml +++ b/action.yml @@ -51,6 +51,9 @@ inputs: eggplantRunnerPath: description: "The path to eggplant runner CLI executable" required: false + parameters: + description: "The global parameter(s) to override in the format parameter_name=parameter_value" + required: false dryRun: description: "Perform a dry run only" required: false @@ -85,7 +88,7 @@ runs: echo "DOWNLOAD_URL=https://assets.eggplantsoftware.com/EggplantRunner/$EXE_FILENAME" >> $GITHUB_ENV shell: bash env: - DAI_VERSION: 7.4.0-4 # AUB-13519_CICD_Junit_file_implementation + DAI_VERSION: 7.5.0-3 # AUB-13519_CICD_Junit_file_implementation - name: Fetch CLI if: ${{ inputs.eggplantRunnerPath }} @@ -177,7 +180,7 @@ runs: if [[ -n "${{ inputs.testConfigID }}" ]]; then echo "testConfigID=${{ inputs.testConfigID }}" - COMMANDSTR="${{ inputs.serverURL }} ${{ inputs.testConfigID }}" + COMMANDARGS=("${{ inputs.serverURL }}" "${{ inputs.testConfigID }}") elif [[ -n "${{ inputs.testConfigName }}" ]]; then echo "testConfigName=${{ inputs.testConfigName }}" if [[ ( -n "${{ inputs.modelName }}" ) && ( -n "${{ inputs.suiteName }}" ) ]]; then @@ -186,10 +189,10 @@ runs: echo "Error: modelName and suiteName found, Use testConfigName with only suiteName or modelName to continue."; exit 1; elif [[ -n "${{ inputs.modelName }}" ]]; then echo "modelName=${{ inputs.modelName }}" - COMMANDSTR="modelbased ${{ inputs.serverURL }} --test-config-name=${{ inputs.testConfigName }} --model-name=${{ inputs.modelName }}" + COMMANDARGS=("modelbased" "${{ inputs.serverURL }}" "--test-config-name=${{ inputs.testConfigName }}" "--model-name=${{ inputs.modelName }}") elif [[ -n "${{ inputs.suiteName }}" ]]; then echo "suiteName=${{ inputs.suiteName }}" - COMMANDSTR="scriptbased ${{ inputs.serverURL }} --test-config-name=${{ inputs.testConfigName }} --suite-name=${{ inputs.suiteName }}" + COMMANDARGS=("scriptbased" "${{ inputs.serverURL }}" "--test-config-name=${{ inputs.testConfigName }}" "--suite-name=${{ inputs.suiteName }}") else echo "Error: testConfigName found, suiteName or modelName is required."; exit 1; fi @@ -200,29 +203,39 @@ runs: echo "Test config data validation complete." if [ -n "${{ inputs.clientID }}" ]; then - COMMANDSTR+=" --client-id=${{ inputs.clientID }}" + COMMANDARGS+=("--client-id=${{ inputs.clientID }}") fi - COMMANDSTR+=" --request-timeout=${{ inputs.requestTimeout }} --request-retries=${{ inputs.requestRetries }} --backoff-factor=${{ inputs.backoffFactor }} --log-level=${{ inputs.logLevel }}" + COMMANDARGS+=("--request-timeout=${{ inputs.requestTimeout }}" "--request-retries=${{ inputs.requestRetries }}" "--backoff-factor=${{ inputs.backoffFactor }}" "--log-level=${{ inputs.logLevel }}") if [ -n "${{ inputs.CACertPath }}" ]; then if [ ! -e "${{ inputs.CACertPath }}" ]; then echo "Error: Invalid CA Cert Path"; exit 1; fi - COMMANDSTR+=" --ca-cert-path=${{ inputs.CACertPath }}" + COMMANDARGS+=("--ca-cert-path=${{ inputs.CACertPath }}") fi if [ -n "${{ inputs.testResultPath }}" ]; then if [ "${{ inputs.testResultPath }}" = *[!\ ]* ] || [[ "${{ inputs.testResultPath }}" = *[\?\"\*\<\>\|]* ]] || [[ "${{ inputs.testResultPath }}" != *.xml ]]; then echo "Error: Invalid Test Result Path"; exit 1; fi - COMMANDSTR+=" --test-result-path=${{ inputs.testResultPath }}" + COMMANDARGS+=("--test-result-path=${{ inputs.testResultPath }}") fi if [ ${{ inputs.dryRun }} == true ]; then - COMMANDSTR+=" --dry-run" + COMMANDARGS+=("--dry-run") fi - echo "Executing: $CLI_PATH $COMMANDSTR" - "$CLI_PATH" $COMMANDSTR + if [ -n "${{ inputs.parameters}}" ]; then + IFS=';;' read -ra values <<< "${{ inputs.parameters }}" + for value in "${values[@]}"; do + if [ -n "$value" ]; then + COMMANDARGS+=("--param") + COMMANDARGS+=("$value") + fi + done + fi + + echo "Executing: $CLI_PATH ${COMMANDARGS[@]}" + "$CLI_PATH" "${COMMANDARGS[@]}" shell: bash From 6238cd012806e936620b25baf021dc2e43cb1868 Mon Sep 17 00:00:00 2001 From: "KEYSIGHT\\ziliyeoh" Date: Mon, 21 Oct 2024 10:08:44 +0800 Subject: [PATCH 2/5] update readme --- README.md | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 0eca964..eb488aa 100644 --- a/README.md +++ b/README.md @@ -4,9 +4,9 @@ ## Introduction -The Eggplant DAI Runner is an [Eggplant DAI](https://www.eggplantsoftware.com/digital-automation-intelligence) integration tool that build as GitHub Action. It enables the functionality to launch DAI tests from within a GitHub workflow pipeline. You can use it to continuously test your application's [model-based approach to testing](https://docs.eggplantsoftware.com/docs/dai-using-eggplant-dai/). For more information about Eggplant, visit https://www.eggplantsoftware.com. +The Eggplant DAI Runner for Github is an [Eggplant DAI](https://www.eggplantsoftware.com/digital-automation-intelligence) integration tool that is built as or builds as a GitHub Action. It enables the functionality to launch DAI tests from within a GitHub workflow pipeline. You can use it to continuously test your application's [model-based tests](https://docs.eggplantsoftware.com/docs/dai-using-eggplant-dai/). For more information about Eggplant, visit https://www.eggplantsoftware.com. -The core integration of the **Eggplant DAI Runner** are with [**DAI Test Configuration**](https://docs.eggplantsoftware.com/docs/dai-test-configuration/). **Eggplant DAI Runner** basically will communicate with the API services provided by **Eggplant DAI** to perform test configuration execution. +The core integration of the **Eggplant DAI Runner** are [**DAI test configurations**](https://docs.eggplantsoftware.com/docs/dai-test-configuration/). The **Eggplant DAI Runner** communicates with the API services provided by **Eggplant DAI** to perform test configuration execution. ## Using Eggplant DAI Runner in your workflow @@ -108,16 +108,16 @@ The **DAI Client Secret** can be obtained by go to `http(s):/dai_server_hostname **[Optional]** The path to an alternative Certificate Authority pem file.
### `testResultPath` -**[Optional]** Path to a file where the test results will be stored in junit xml format.
+**[Optional]** The path to a file where the test results will be stored in JUnit XML format.
**Example:** `C:\results\result.xml` ### `eggplantRunnerPath` -**[Optional]** The path to eggplant runner CLI executable.
+**[Optional]** The path to Eggplant runner CLI executable.
### `parameters` -**[Optional]** The global parameter(s) to override in the format `parameter_name=parameter_value`
-Multiple parameters can be overriden with a `;;` delimiter between them
+**[Optional]** The global parameter(s) to override in the format `parameter_name=parameter_value`.
**Example:** `username=Lily`
+You can override multiple parameters by separating them with a delimiter of two semi-colons (`;;`).
**Example:** `username=Lily;;city=Paris;;hobby=Jogging` ## Output @@ -206,6 +206,11 @@ Hence, we can only do unilateral testing. 4. Starting from v1.0.12 (DAI 7.4.0-4) onwards, Inputs `pollInterval` and `testEnvironmentTimeout` were removed. Warnings are expected if inputs are still in the workflow file. +5. If the inputs for your parameters in the workflow contain double-quote (`"`) special characters, you must escape them with three backslashes (`\\\"`).
+This is because double quotes (`"`) that are not escaped are used to wrap all the parameter input.
+Furthermore, if your parameter inputs contain a dollar sign (`$`) special character, you must escape it with two backslashes `\\$` because the dollar sign is a reserved keyword for the workflow.
+Example: `parameters: "value=\\\"double quote with one dollar \\$ sign\\\""` + # License The scripts and documentation in this project are released under the [MIT License](LICENSE) From 57b292d28d85e8646de98166d018883eaee3fdfd Mon Sep 17 00:00:00 2001 From: "KEYSIGHT\\ziliyeoh" Date: Wed, 30 Oct 2024 09:34:38 +0800 Subject: [PATCH 3/5] Update DAI version support 7.5.0-4 --- README.md | 2 +- action.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index eb488aa..d34eda6 100644 --- a/README.md +++ b/README.md @@ -139,7 +139,7 @@ Based on the pipeline .yml configuration, when there is commits or pull request - 7.5.0-3 + 7.5.0-4 latest diff --git a/action.yml b/action.yml index e3ce178..5948333 100644 --- a/action.yml +++ b/action.yml @@ -88,7 +88,7 @@ runs: echo "DOWNLOAD_URL=https://assets.eggplantsoftware.com/EggplantRunner/$EXE_FILENAME" >> $GITHUB_ENV shell: bash env: - DAI_VERSION: 7.5.0-3 # AUB-13519_CICD_Junit_file_implementation + DAI_VERSION: 7.5.0-4 # AUB-13519_CICD_Junit_file_implementation - name: Fetch CLI if: ${{ inputs.eggplantRunnerPath }} From dc4ea9e632190551054682d9e5d0238eb69aee2c Mon Sep 17 00:00:00 2001 From: "KEYSIGHT\\ziliyeoh" Date: Mon, 4 Nov 2024 10:49:46 +0800 Subject: [PATCH 4/5] Update DAI version support 7.5.0-7 --- README.md | 2 +- action.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d34eda6..f77c6da 100644 --- a/README.md +++ b/README.md @@ -139,7 +139,7 @@ Based on the pipeline .yml configuration, when there is commits or pull request - 7.5.0-4 + 7.5.0-7 latest diff --git a/action.yml b/action.yml index 5948333..aaa870e 100644 --- a/action.yml +++ b/action.yml @@ -88,7 +88,7 @@ runs: echo "DOWNLOAD_URL=https://assets.eggplantsoftware.com/EggplantRunner/$EXE_FILENAME" >> $GITHUB_ENV shell: bash env: - DAI_VERSION: 7.5.0-4 # AUB-13519_CICD_Junit_file_implementation + DAI_VERSION: 7.5.0-7 # AUB-13519_CICD_Junit_file_implementation - name: Fetch CLI if: ${{ inputs.eggplantRunnerPath }} From da8c30b6a664afbe7257c42d760355b3d7423997 Mon Sep 17 00:00:00 2001 From: FM Leong Date: Thu, 7 Nov 2024 10:22:07 +0800 Subject: [PATCH 5/5] Update DAI version support 7.5.0-8 --- README.md | 2 +- action.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index f77c6da..69d3e1c 100644 --- a/README.md +++ b/README.md @@ -139,7 +139,7 @@ Based on the pipeline .yml configuration, when there is commits or pull request - 7.5.0-7 + 7.5.0-8 latest diff --git a/action.yml b/action.yml index aaa870e..b436e38 100644 --- a/action.yml +++ b/action.yml @@ -88,7 +88,7 @@ runs: echo "DOWNLOAD_URL=https://assets.eggplantsoftware.com/EggplantRunner/$EXE_FILENAME" >> $GITHUB_ENV shell: bash env: - DAI_VERSION: 7.5.0-7 # AUB-13519_CICD_Junit_file_implementation + DAI_VERSION: 7.5.0-8 # AUB-13519_CICD_Junit_file_implementation - name: Fetch CLI if: ${{ inputs.eggplantRunnerPath }}