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-azure-devops

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

65 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Eggplant Runner with Azure DevOps

Introduction

The Eggplant Runner is an Eggplant DAI integration tool that enables the functionality to launch DAI tests from within a Azure DevOps 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 Runner are with DAI Test Configuration. Eggplant Runner basically will communicate with the API services provided by Eggplant DAI to perform test configuration execution. Eggplant Runner currently provides "Run Test Config" as its main action.

Using run-test-config.yml in your pipeline

In order to use the Eggplant Runner with Azure DevOps, you need to add this to your Azure Pipelines .yml file:
Reading: https://docs.microsoft.com/en-us/azure/devops/pipelines/process/templates?view=azure-devops#use-other-repositories

trigger:
  - main
  
resources:
  repositories:
    - repository: sourceRepo
      type: github
      name: TestPlant/eggplant-azure-devops
      endpoint: # your service connection name. Details below under Notes(4).
jobs:
  - job: Run_Test_Config
    strategy:
      maxParallel: 1
      matrix:
        linux:
          imageName: 'ubuntu-latest'
        mac:
          imageName: 'macOS-latest'
        windows:
          imageName: 'windows-latest'
    pool: 
      vmImage: $(imageName)
    steps:
      - template: templates/run-test-config.yml@sourceRepo
        parameters:
          serverURL: # Required. Details below
          testConfigID: # Required. Details below
          clientSecret: # Required. Details below

Inputs

serverURL

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

testConfigID

Required The ID of the test config 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 DAI server, e.g. e9c15662-8c1b-472e-930d-aa0b11726093.
Alternatively, you could set a pipeline secret and refer to it like below:
clientSecret: $(DAI_CLIENT_SECRET).
Reading: https://docs.microsoft.com/en-us/azure/devops/pipelines/process/variables?view=azure-devops&tabs=yaml%2Cbatch#secret-variables

The DAI Client Secret can be obtain by go to http://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 DAI server.
Default: client:dai:agent:integration

requestTimeout

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

requestRetries

Optional The number of times to attempt each HTTP request to the 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 DAI server
Default: 5

logLevel

Optional The logging level
Default: INFO

CACertPath

Optional The path to an alternative Certificate Authority pem file

dryRun

Optional Dry Run mode only validates the parameters without executing a test config run. It does not require a connection to the DAI server.
Default: False.

Notes

  1. This pipeline .yml file needs to in the root directory of your repository.

  2. On strategy: max-parallel: 1: SUT(System Under Test) is locked for one test config run at a time.
    Hence, we can only do unilateral testing.

  3. Eggplant Runner supports these OS: Linux, Windows, MacOS.

  4. In order to reference our template run-test-config.yml script, you need to create a GitHub Service Connection.
    In Azure DevOps page: Project settings > Pipelines > Service connections > New service connection > GitHub.
    Then, populate resources: repositories: endpoint with the newly created Service connection name.

About

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

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published