You can watch our tutorial or you can go through our documentation about Jenkins integration :
There are various ways to launch tests of an ATS project: just with Jenkins several solutions are possible.
We will present here a very simple solution requiring only a few minutes of installation and configuration.
Use this procedure only if you need a specific Jenkins installation : Agilitest is able to automatically download, install a Jenkins instance, and configure jobs on the computer where it runs.
- Download a Jenkins for Windows here: https://jenkins.io/download/
- Install it as standard
- Launch it in command line with java (do not launch it in service for this configuration example and if necessary stop the Jenkins service)
- Example command to launch Jenkins: java -jar -Xms768m -Xmx1024m jenkins.war
- Connect to "http: // localhost: 8080" and follow the instructions for the password.
Be careful : the initial password when launching manually is changed and printed in the launching logs.
- You can then choose to "install the suggested plugins" or install some plugins you want.
- Then enter the administrator account information and click on "Save and continue"
- Configure the instance (address and port) then click on finish
- Your Jenkins instance is ready to be customized
Configure a JDK (minimum 10)
Using a browser, connect to your Jenkins instance.
(in some cases, if you have a blank screen, restart your command line instance).
- Click on "Manage Jenkins" then choose "Global Tool Configuration": in the "JDK" section choose the JDK you want to use (minimum 10), either automatically proposed by Jenkins, or by defining a local directory containing a JDK 10 .
From "Manage Jenkins" click on "Manage Plugins". The necessary plugins for ATS are:
- Environment Injector Plugin
- GitHub Integration Plugin
- Maven Invoker plugin
- TestNG Results Plugin
- Unleash Maven Plugin
(Note: You can add all the plugins that interest you)
- On the “Available” section, filter with the names of the plugins above to select them:
(These plugins will normally be already installed on most existing Jenkins infra with the possible exception of TestNG)
The installation of these plugins will recover all the necessary dependencies.
Define the ATS directory
Prerequisite: Download the ATS components (More information on the GitHub Action Test Script project in the "installing" section)
From the "Manage Jenkins" menu click on "Configure System" then in the "Global Properties" section add an environment variable:
Name = ATS_HOME
Value = [chemin vers votre répertoire local ATS]
- Back to Jenkins home page
- Click on "New Item"
- Name your new job
- Click on "Maven Project" then click OK
- In the "Source Code Management" section, click on the "git" radio button and enter the git URL of an ATS project (for example: https://github.com/pierrehub2b/ats_test.git )
- You can also click on "none" to use a local project (the path will be defined in your project POM file).
- In the “Build Environment” section, optionally add a variable (eg browser.name = chrome) after checking: “inject environment variables to the build process”
- To be used by ATS, this variable name must be the same as a variable used in the ATS project. (for example, in the Agilitest editor you will find these variables in the "Execution parameters" part of a project)
- On jenkins, in the "Build" section, enter the value "test" in the "Goals and options" field:
- Your job is configured and is ready to be launched by clicking on "Build Now":
- Once the job is finished, you will have access to the usual reports resulting from the execution of tests (details by tests, regressions, passed, failed etc ...)
If you want to share or exchange on another example configuration, you can do it via the following github project:https://github.com/pierrehub2b/actiontestscript