Configure Gatling Stress Tests command line for Jenkins

Install Gatling

In order to let jenkins jobs run gatling bundle you should install the bundle under jenkins home (by default /var/lib/jenkins)

sudo mkdir /var/lib/jenkins/tools
mv gatling-charts-highcharts-bundle-2.1.7 /var/lib/jenkins/tools/
cd /var/lib/jenkins/
chown -R jenkins:jenkins tools

Call Galing Task in a Jenkins Jobs

Install Gatling Plugins

On your source we propose this tree source
|-data : contains all data needed for gatling secnario
|-simulations : contains your scala files

#!/bin/bash --login
cp -r $WORKSPACE/data/* $JENKINS_HOME/tools/gatling-charts-highcharts-bundle-2.1.7/user-files/data/
cp -r $WORKSPACE/simulations/* $JENKINS_HOME/tools/gatling-charts-highcharts-bundle-2.1.7/user-files/simulations/
#Set gatling parameters
export JAVA_OPTS="-Durl=$url 
cd $JENKINS_HOME/tools/gatling-charts-highcharts-bundle-2.1.7/bin
./ -s MyScenario -rf $WORKSPACE/results


Gatling charts and results may got bug when display them inside jenkins. This is a security issue and to correcte it :

edit /etc/default/jenkins and change the JAVA_ARGS value :

JAVA_ARGS="-Djava.awt.headless=true -Dhudson.model.DirectoryBrowserSupport.CSP="

عن Wicem

اترك تعليقاً

لن يتم نشر عنوان بريدك الإلكتروني. الحقول الإلزامية مشار إليها بـ *