I have created a gatling maven based application; wrote some actions, scenario and able to successfully run them locally in IDE using
$mvn gatling:test
to build project and view the gatling reports.
Now I'm trying to have a jenkins job configured to automate this however using the same command in bash script is failing with :
Build step 'Execute shell' marked build as failure
Archiving Gatling reports...
Could not find a Gatling report in results folder.
My pom.xml is same as :https://github.com/gatling/gatling-maven-plugin-demo/blob/master/pom.xml except i also tried to add:
<configuration>
<resultsFolder>/jenkinsworkspace/projectName/target/gatling</resultsFolder>
</configuration>
pom.xml:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>io.gatling</groupId>
<artifactId>project-id</artifactId>
<version>3.1.2</version>
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<gatling.version>${project.version}</gatling.version>
<gatling-plugin.version>3.0.1</gatling-plugin.version>
</properties>
<dependencies>
<dependency>
<groupId>io.gatling.highcharts</groupId>
<artifactId>gatling-charts-highcharts</artifactId>
<version>${gatling.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>io.gatling</groupId>
<artifactId>gatling-maven-plugin</artifactId>
<version>${gatling-plugin.version}</version>
</plugin>
</plugins>
</build>
</project>
Firstly, Do I need to use a Maven jenkins project type instead of a freestyle project?
Secondly, from testing in local my gatling reports are generated in target folder in the project structure on every execution. And in my repo I have ignored this folder (in .gitignore) so is that the reason of not being able to find in workspace when ran the job?
Not sure if its something wrong with either the maven command I'm using in execute shell Build step or is my pom.xml wrong.
From jenkins console output, it seems to download all the maven dependencies mentioned in pom.xml but then results in build failure. I'm new to this, kindly provide any suggestions and help.