Skip to content

Commit

Permalink
Merge pull request #32 from keysight-eggplant/Release_1_0_14
Browse files Browse the repository at this point in the history
Update DAI version support 7.5.0-8
  • Loading branch information
foomunleong authored Nov 7, 2024
2 parents 14127d1 + da8c30b commit eebf366
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 17 deletions.
27 changes: 21 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -108,11 +108,17 @@ 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. <br />

### `testResultPath`
**[Optional]** Path to a file where the test results will be stored in junit xml format. <br />
**[Optional]** The path to a file where the test results will be stored in JUnit XML format. <br />
**Example:** `C:\results\result.xml`

### `eggplantRunnerPath`
**[Optional]** The path to eggplant runner CLI executable. <br />
**[Optional]** The path to Eggplant runner CLI executable. <br />

### `parameters`
**[Optional]** The global parameter(s) to override in the format `parameter_name=parameter_value`. </br>
**Example:** `username=Lily` </br>
You can override multiple parameters by separating them with a delimiter of two semi-colons (`;;`).</br>
**Example:** `username=Lily;;city=Paris;;hobby=Jogging`

## Output
### Pipeline triggered
Expand All @@ -133,12 +139,16 @@ Based on the pipeline .yml configuration, when there is commits or pull request
</thead>
<tbody>
<tr>
<td>7.4.0-4</td>
<td>7.5.0-8</td>
<td><a href="https://github.com/marketplace/actions/eggplant-runner">latest</a></td>
</tr>
<tr>
<td>7.4.0-4</td>
<td><a href="https://github.com/marketplace/actions/eggplant-runner?version=v1.0.12">v1.0.12</a></td>
</tr>
<tr>
<td>7.3.0-3</td>
<td><a href="https://github.com/marketplace/actions/eggplant-runner?version=v1.0.10">v1.0.11</a></td>
<td><a href="https://github.com/marketplace/actions/eggplant-runner?version=v1.0.11">v1.0.11</a></td>
</tr>
<tr>
<td>7.2.0-4</td>
Expand Down Expand Up @@ -196,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 (`\\\"`).<br />
This is because double quotes (`"`) that are not escaped are used to wrap all the parameter input.<br />
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.<br />
Example: `parameters: "value=\\\"double quote with one dollar \\$ sign\\\""`

# License

The scripts and documentation in this project are released under the [MIT License](LICENSE)
35 changes: 24 additions & 11 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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-8 # AUB-13519_CICD_Junit_file_implementation

- name: Fetch CLI
if: ${{ inputs.eggplantRunnerPath }}
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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

0 comments on commit eebf366

Please sign in to comment.