Introduction
The Eggplant DAI Plugin for Jenkins launches DAI tests from within a Jenkins pipeline. You can use it to continuously test your application using Eggplant's model-based approach to testing. For more information about Eggplant, visit https://www.eggplantsoftware.com.
Install Eggplant DAI Plugin for Jenkins
Step 1: Login to your Jenkins
Go to your Jenkins home page and login into your Jenkins account
Step 2: Manage Jenkins
-
Go to Available and enter Eggplant Runner in the search feature
-
Check on the Eggplant Runner and click on Install without restart
How to use Eggplant DAI Plugin for Jenkins
Freestyle project
Step 1 : Create new project -> Freestyle project -> Click OK
Step 2: Add Eggplant Runner as build step
Step 3: Fill in Eggplant Runner parameter's value -> Click Save
Inputs
serverURL
Required The URL of the Eggplant DAI server, http(s)://dai_server_hostname:portnumber
.
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.
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 obtain by go to http(s):/dai_server_hostname:portnumber/ > System > API Access > "Add New" (for new API access creation)
clientID
Required 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
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
Build the project to run the step
Execution details are shown in Console Output
Advanced Usage
Pipeline project
Step 1: Create Pipeline project
Step 2: Copy and paste below scrips into Pipiline script section
pipeline {
agent any
environment {
DAI_CLIENT_SECRET = credentials('eggplant-runner-client-secret')
}
stages {
stage('Eggplant Runner') {
steps {
eggplantRunner serverURL: 'Your DAI server URL', testConfigId: 'Your test configuration that want to execute'
}
}
}
}
⚠️ Usage of backslashes in script: Remember to escape backslashes by replace all instances of\
with\\
inside a string.
For example, rather than:CACertPath: "C:\certs\rootCA.cer"
you would use:CACertPath: "C:\\certs\\rootCA.cer"
Step 3: Setup Public Credential for Client Secret -> Click Ok
Step 4: Build the pipeline project Output are shown in Console Output
Release for DAI
DAI Version | Release |
---|---|
6.4.0-5 | latest |
6.3.0-3 | 0.0.1.191.v72dea_07931b_6 | 0.0.1.189.v1e3397db_cee8 |
6.2.1-2 | 0.0.1.185.v9617008ee458 | 0.0.1.159.v8ed1d9f67f00 |
6.1.2-1 | 0.0.1.108.v32f1564b_19d0 |
License
This plug-in is licensed under the terms of the MIT license
Releases Note
30th May 2022
- Fix Jenkins Plugins "Eggplant Runner" Client Secret textbox behaviour
Contributing
You need to install the following dependencies if you want to contribute to the Eggplant DAI Runner for Jenkins:
- You can download and install Java 11 from the Eclipse Temurin website.
- Download Maven from the Apache Maven website. Make sure to download one of the binary archives (with bin in their name).
- To verify that Maven is installed, run the following command:
mvn -version
- You can use
launch.json
to run 'Debug (Attach)' to launch an local Jenkins instance for development.