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.
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
Required The URL of the DAI server, e.g. http://localhost:8000
.
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.
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
Optional The client ID to use to authenticate with the DAI server.
Default: client:dai:agent:integration
Optional The timeout in seconds for each HTTP request to the DAI server
Default: 30
Optional The number of times to attempt each HTTP request to the DAI server
Default: 5
Optional The exponential backoff factor between each HTTP request
Default: 0.5
Optional The number of seconds to wait between each call to the DAI server
Default: 5
Optional The logging level
Default: INFO
Optional The path to an alternative Certificate Authority pem file
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
.
-
This pipeline .yml file needs to in the root directory of your repository.
-
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. -
Eggplant Runner supports these OS: Linux, Windows, MacOS.
-
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, populateresources: repositories: endpoint
with the newly createdService connection name
.