Giter VIP home page Giter VIP logo

eggplant-runner-plugin's Introduction

Eggplant DAI Plugin for Jenkins

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 image

Step 2: Manage Jenkins

  • Go to Manage Jenkins > Manage Plugins image

  • Go to Available and enter Eggplant Runner in the search feature

  • Check on the Eggplant Runner and click on Install without restart image

How to use Eggplant DAI Plugin for Jenkins

Freestyle project

Step 1 : Create new project -> Freestyle project -> Click OK

image

Step 2: Add Eggplant Runner as build step

image

Step 3: Fill in Eggplant Runner parameter's value -> Click Save image

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 obtain 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

Build the project to run the step image

Execution details are shown in Console Output image

Advanced Usage

Pipeline project

Step 1: Create Pipeline project

Step 2: Copy and paste below scripts into Pipiline script section

pipeline {
    agent any

    environment {
        DAI_CLIENT_SECRET = credentials('eggplant-runner-client-secret')
    }

    stages {
        stage('Eggplant Runner') {
            steps {
                // To run DAI test configuration by test config Id, use the following command
                eggplantRunner serverURL: 'Your DAI server URL', testConfigId: 'Your test configuration that want to execute', clientId: 'Your DAI client ID'
                //  To run DAI Test Configuration by Test Config Name with model name, use the following command
                // eggplantRunner serverURL: 'Your DAI server URL', testConfigName: 'Your model-based test configuration name', modelName: 'Your model name', clientId: 'Your DAI client ID'
                //  To run DAI Test Configuration by Test Config Name with suite name, use the following command
                // eggplantRunner serverURL: 'Your DAI server URL', testConfigName: 'Your script-based test configuration name', suiteName: 'Your suite name', clientId: 'Your DAI client ID'
                
                //Note: Only execute one of the command per each build step
            }
        }
    }
}

โš ๏ธ 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"

image

Step 3: Setup Public Credential for Client Secret -> Click Ok image

Step 4: Build the pipeline project Output are shown in Console Output image

Release for DAI

DAI Version Release
7.2.0-4 latest
7.1.0-5 0.0.1.259.va_548428d4b_79
7.0.1-1 0.0.1.255.vd38258d75ca_6
7.0.0-3 0.0.1.252.v8e47de80211e
6.5.0-3 0.0.1.247.va_7031a_586298
6.4.0-5 0.0.1.226.v1a_ff67035775
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:

  1. You can download and install Java 11 from the Eclipse Temurin website.
  2. Download Maven from the Apache Maven website. Make sure to download one of the binary archives (with bin in their name).
  3. To verify that Maven is installed, run the following command: mvn -version
  4. You can use launch.json to run 'Debug (Attach)' to launch an local Jenkins instance for development.

eggplant-runner-plugin's People

Contributors

curveenk avatar poasungoh avatar pohkheng2 avatar tingweichoo avatar ziliangyeoh avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

eggplant-runner-plugin's Issues

Error Eggplant DAI 6.4.0-5 with latest Eggplant Runner

Jenkins and plugins versions report

Error Eggplant Runner plugin with Eggplant DAI 6.4.0-5.

What Operating System are you using (both controller, and any agents involved in the problem)?

Ubuntu

Reproduction steps

N/A.

Expected Results

N/A

Actual Results

Running as SYSTEM
Building in workspace /var/jenkins_home/jobs/eggplant-demo/workspace
Default locale:C.UTF-8
Exported locale: C.UTF-8

Downloading runner...
GET https://downloads.eggplantsoftware.com/downloads/EggplantRunner/eggplant-runner-Linux-7.0.1-1
Download successfully.
command: [/var/jenkins_home/jobs/eggplant-demo/workspace/downloads/eggplant-runner-Linux-7.0.1-1, modelbased, http://35.231.132.149:8000/, --test-config-name=cloudbees-test, --model-name=poc-test, --client-id=XXXXX, --client-secret=XXXXXXXX, --log-level=INFO, --poll-interval=5, --request-timeout=30, --request-retries=5, --test-environment-timeout=15, --backoff-factor=0.5]
Executing /var/jenkins_home/jobs/eggplant-demo/workspace/downloads/eggplant-runner-Linux-7.0.1-1
[1] $ /var/jenkins_home/jobs/eggplant-demo/workspace/downloads/eggplant-runner-Linux-7.0.1-1 modelbased http://35.231.132.149:8000/ --test-config-name=cloudbees-test --model-name=poc-test-latam --client-id=XXXXXX --client-secret=XXXXXXX --log-level=INFO --poll-interval=5 --request-timeout=30 --request-retries=5 --test-environment-timeout=15 --backoff-factor=0.5
2023-10-13 01:00:35,872 INFO Verifying server http://35.231.132.149:8000/
2023-10-13 01:00:35,930 ERROR Failed to run test config cloudbees-test
Traceback (most recent call last):
File "dai/runner.py", line 104, in modelbased
File "dai/runner.py", line 217, in run
File "dai/client.py", line 91, in check_version_compatibility
eggplant.dai.exceptions.CompatibilityError: Detected server is running Eggplant DAI 6.4.0-5. Please update Eggplant Runner to the same version to continue.
ERROR: Eggplant Runner CLI exited with code '2'.
Finished: FAILURE

Anything else?

No response

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.