Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Update DAI version support 7.5.0-8" #33

Merged
merged 1 commit into from
Nov 7, 2024
Merged
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
27 changes: 6 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

## Introduction

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 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 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.
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.

## Using Eggplant DAI Runner in your workflow

Expand Down Expand Up @@ -108,17 +108,11 @@ 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]** The path to a file where the test results will be stored in JUnit XML format. <br />
**[Optional]** 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 />

### `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`
**[Optional]** The path to eggplant runner CLI executable. <br />

## Output
### Pipeline triggered
Expand All @@ -138,17 +132,13 @@ Based on the pipeline .yml configuration, when there is commits or pull request
</tr>
</thead>
<tbody>
<tr>
<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>
<td><a href="https://github.com/marketplace/actions/eggplant-runner">latest</a></td>
</tr>
<tr>
<td>7.3.0-3</td>
<td><a href="https://github.com/marketplace/actions/eggplant-runner?version=v1.0.11">v1.0.11</a></td>
<td><a href="https://github.com/marketplace/actions/eggplant-runner?version=v1.0.10">v1.0.11</a></td>
</tr>
<tr>
<td>7.2.0-4</td>
Expand Down Expand Up @@ -206,11 +196,6 @@ 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: 11 additions & 24 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,6 @@ 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 @@ -88,7 +85,7 @@ runs:
echo "DOWNLOAD_URL=https://assets.eggplantsoftware.com/EggplantRunner/$EXE_FILENAME" >> $GITHUB_ENV
shell: bash
env:
DAI_VERSION: 7.5.0-8 # AUB-13519_CICD_Junit_file_implementation
DAI_VERSION: 7.4.0-4 # AUB-13519_CICD_Junit_file_implementation

- name: Fetch CLI
if: ${{ inputs.eggplantRunnerPath }}
Expand Down Expand Up @@ -180,7 +177,7 @@ runs:

if [[ -n "${{ inputs.testConfigID }}" ]]; then
echo "testConfigID=${{ inputs.testConfigID }}"
COMMANDARGS=("${{ inputs.serverURL }}" "${{ inputs.testConfigID }}")
COMMANDSTR="${{ inputs.serverURL }} ${{ inputs.testConfigID }}"
elif [[ -n "${{ inputs.testConfigName }}" ]]; then
echo "testConfigName=${{ inputs.testConfigName }}"
if [[ ( -n "${{ inputs.modelName }}" ) && ( -n "${{ inputs.suiteName }}" ) ]]; then
Expand All @@ -189,10 +186,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 }}"
COMMANDARGS=("modelbased" "${{ inputs.serverURL }}" "--test-config-name=${{ inputs.testConfigName }}" "--model-name=${{ inputs.modelName }}")
COMMANDSTR="modelbased ${{ inputs.serverURL }} --test-config-name=${{ inputs.testConfigName }} --model-name=${{ inputs.modelName }}"
elif [[ -n "${{ inputs.suiteName }}" ]]; then
echo "suiteName=${{ inputs.suiteName }}"
COMMANDARGS=("scriptbased" "${{ inputs.serverURL }}" "--test-config-name=${{ inputs.testConfigName }}" "--suite-name=${{ inputs.suiteName }}")
COMMANDSTR="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 @@ -203,39 +200,29 @@ runs:
echo "Test config data validation complete."

if [ -n "${{ inputs.clientID }}" ]; then
COMMANDARGS+=("--client-id=${{ inputs.clientID }}")
COMMANDSTR+=" --client-id=${{ inputs.clientID }}"
fi

COMMANDARGS+=("--request-timeout=${{ inputs.requestTimeout }}" "--request-retries=${{ inputs.requestRetries }}" "--backoff-factor=${{ inputs.backoffFactor }}" "--log-level=${{ inputs.logLevel }}")
COMMANDSTR+=" --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
COMMANDARGS+=("--ca-cert-path=${{ inputs.CACertPath }}")
COMMANDSTR+=" --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
COMMANDARGS+=("--test-result-path=${{ inputs.testResultPath }}")
COMMANDSTR+=" --test-result-path=${{ inputs.testResultPath }}"
fi

if [ ${{ inputs.dryRun }} == true ]; then
COMMANDARGS+=("--dry-run")
COMMANDSTR+=" --dry-run"
fi

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[@]}"
echo "Executing: $CLI_PATH $COMMANDSTR"
"$CLI_PATH" $COMMANDSTR
shell: bash