Skip to content

Eggplant DAI Runner enable integration of DAI test configuration execution in pipeline

License

Notifications You must be signed in to change notification settings

keysight-eggplant/eggplant-github-action

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 

Repository files navigation

Eggplant DAI Runner

Introduction

The Eggplant DAI Runner is an Eggplant DAI 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. For more information about Eggplant, visit https://www.eggplantsoftware.com.

The core integration of the Eggplant DAI Runner are with 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

Step 1: Search for Eggplant DAI Runner in GitHub Marketplace

image

Step 2: Click on Use latest version image

Step 3: Copy and paste the following snippet into your .yml file.

image

Sample work flow YML content

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/eggplant-github-action@v1.0.0
        with:
          serverURL: "" # Required. Details below
          testConfigID: "" # Required. Details below
          clientID: "" # Required. Details below
          clientSecret: "" # Required. Details below

Inputs

serverURL

[Required] The URL of the Eggplant DAI server, http(s)://dai_server_hostname:portnumber.

testConfigID

[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. image
Alternatively, use testConfigName and remove this input.

testConfigName

[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:

  • modelName

DAI model name for the specified test configuration. (Use this argument if only testConfigName is provided)

  • suiteName

DAI suite name for the specified test configuration. (Use this argument if only testConfigName is provided)

clientID

[Required] The client ID to use to authenticate with the Eggplant DAI server.

clientSecret

[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)

image

requestTimeout

[Optional] The timeout in seconds for each HTTP request to the Eggplant DAI server.
Default: 30

requestRetries

[Optional] The number of times to attempt each HTTP request to the Eggplant DAI server.
Default: 5

backoffFactor

[Optional] The exponential backoff factor between each HTTP request.
Default: 0.5

pollInterval

[Optional] The number of seconds to wait between each call to the Eggplant DAI server.
Default: 5

testEnvironmentTimeout

[Optional] The timeout in seconds for checking test environment readiness.
Default: 15

logLevel

[Optional] The logging level.
Default: INFO

CACertPath

[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.
Example: C:\results\result.xml

eggplantRunnerPath

[Optional] The path to eggplant runner CLI executable.

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.

image

Console output

image

Release for DAI

DAI Version Release
7.3.0-3 latest
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

Notes

  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.

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

  3. Eggplant DAI Runner supports 3 type of operating system:

  • Linux
  • Windows
  • MacOS

License

The scripts and documentation in this project are released under the MIT License