The Eggplant DAI Runner for Github is an Eggplant DAI 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. For more information about Eggplant, visit https://www.eggplantsoftware.com.
The core integration of the Eggplant DAI Runner are DAI test configurations. The Eggplant DAI Runner communicates with the API services provided by Eggplant DAI to perform test configuration execution.
Step 1: Search for Eggplant DAI Runner in GitHub Marketplace
Step 2: Click on Use latest version
Step 3: Copy and paste the following snippet into your .yml file.
name: "YOUR WORK FLOW NAME"
# Configure which branch that will trigger Eggplant DAI GitHub Action
# on:
# push:
# branches:
# - main
# pull_request:
# branches:
# - main
jobs:
Run-DAI-Test-Configuration:
strategy: # Optional configuration by using matrix strategy
max-parallel: 1 # To set the maximum number of jobs that can run simultaneously
matrix:
os: [ubuntu-latest, windows-latest, macos-latest] # Operating support by Eggplant DAI GitHub Action
runs-on: ${{ matrix.os }} # Provide OS matrix
name: Run Test Configuration
steps:
- run: echo "Trigger event.. ${{ github.event_name }}. Runner OS.. ${{ runner.os }}."
- name: Eggplant Runner
uses: keysight-eggplant/[email protected]
with:
serverURL: "" # Required. Details below
testConfigID: "" # Required. Details below
clientID: "" # Required. Details below
clientSecret: "" # Required. Details below
[Required] The URL of the Eggplant DAI server, http(s)://dai_server_hostname:portnumber
.
[Required if testConfigName is not given] The ID of the Eggplant DAI test configuration that you want to run, e.g. 389fee3e-9d6b-43e6-b31e-f1d379f27cdf
.
Test configuration ID can be obtained by go to Test Config > Look for a particular test config > Test config id can be obtain from url
.
Alternatively, use testConfigName and remove this input.
[Required if testConfigID is not given] The name of the Eggplant DAI test configuration that you want to run.
Must provide one of the following supporting arguments:
DAI model name for the specified test configuration. (Use this argument if only testConfigName is provided)
DAI suite name for the specified test configuration. (Use this argument if only testConfigName is provided)
[Required] The client ID to use to authenticate with the Eggplant DAI server.
[Required] The client secret to use to authenticate with the Eggplant DAI server.
Alternatively, you could set a repo secret in Repo Settings > Secrets > Actions
and refer to it like below:
clientSecret: "${{ secrets.DAI_CLIENT_SECRET }}"
.
The DAI Client Secret can be obtained by go to http(s):/dai_server_hostname:portnumber/ > System > API Access > Add New
(for new API access creation)
[Optional] The timeout in seconds for each HTTP request to the Eggplant DAI server.
Default: 30
[Optional] The number of times to attempt each HTTP request to the Eggplant DAI server.
Default: 5
[Optional] The exponential backoff factor between each HTTP request.
Default: 0.5
[Optional] The logging level.
Default: INFO
[Optional] The path to an alternative Certificate Authority pem file.
[Optional] The path to a file where the test results will be stored in JUnit XML format.
Example: C:\results\result.xml
[Optional] The path to Eggplant runner CLI executable.
[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
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.
DAI Version | Release |
---|---|
7.5.0-10 | latest |
7.5.0-9 | v1.0.14 |
7.4.0-4 | v1.0.12 |
7.3.0-3 | v1.0.11 |
7.2.0-4 | v1.0.10 |
7.1.0-5 | v1.0.9 |
7.0.1-1 | v1.0.8 |
7.0.0-3 | v1.0.7 |
6.5.0-3 | v1.0.6 |
6.4.0-5 | v1.0.5 |
6.3.0-3 | v1.0.4 |
6.2.1-2 | v1.0.3 | v1.0.2 |
6.1.2-1 | v1.0.1 |
-
This workflow .yml file needs to in the
.github/workflows
directory in your repository on GitHub.
Reading: https://docs.github.com/en/actions/quickstart. -
On
strategy: max-parallel: 1
: SUT(System Under Test) is locked for one Eggplant DAI test configuration run at a time.
Hence, we can only do unilateral testing. -
Eggplant DAI Runner supports 3 type of operating system:
- Linux
- Windows
- MacOS
-
Starting from v1.0.12 (DAI 7.4.0-4) onwards, Inputs
pollInterval
andtestEnvironmentTimeout
were removed. Warnings are expected if inputs are still in the workflow file. -
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\\\""
-
Release v1.0.15 (DAI 7.5.0-10) now allows passes after re-run.
The scripts and documentation in this project are released under the MIT License