Skip to content
You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?

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/[email protected]
        with:
          serverURL: "" # Required. Details below
          testConfigID: "" # Required. Details below
          clientSecret: "" # Required. Details below

Inputs

serverURL

Required The URL of the Eggplant DAI server, e.g. http:https://localhost:8000.

testConfigID

Required The ID of the Eggplant DAI test configuration that you want to run, e.g. 09c48b7d-fc5b-481d-af80-fcffad5d9587. Test configuration ID can be obtain by go to test config > look for a particular test config > test config id can be obtain from url. image

clientSecret

Required The client secret to use to authenticate with the Eggplant DAI server, e.g. e9c15662-8c1b-472e-930d-aa0b11726093.
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 obtain by go to http:https://kc-localhost:8000/auth > clients > search for client:dai:agent:integration > credential > secret image

clientID

Optional The client ID to use to authenticate with the Eggplant DAI server.
Default: client:dai:agent:integration

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

logLevel

Optional The logging level
Default: INFO

CACertPath

Optional The path to an alternative Certificate Authority pem file

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

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