Revert "Add Jenkinsfile & update gatling version"

This reverts commit a2314c69d9.
This commit is contained in:
matt.rossi 2020-01-08 18:12:18 +01:00
parent 58e3ab4deb
commit ef1c761607
6 changed files with 140 additions and 140 deletions

View File

@ -1,20 +0,0 @@
pipeline {
agent any
stages {
stage("Build Maven") {
steps {
sh 'mvn -B clean package'
}
}
stage("Run Gatling") {
steps {
sh 'mvn gatling:test'
}
post {
always {
gatlingArchive()
}
}
}
}
}

View File

@ -15,7 +15,6 @@
<relativePath>../../</relativePath> <relativePath>../../</relativePath>
</parent> </parent>
<dependencyManagement> <dependencyManagement>
<dependencies> <dependencies>
<dependency> <dependency>
@ -95,26 +94,43 @@
</execution> </execution>
</executions> </executions>
</plugin> </plugin>
</plugins>
</build>
<profiles>
<profile>
<id>simulation</id>
<build>
<plugins>
<plugin> <plugin>
<groupId>io.gatling</groupId> <groupId>io.gatling</groupId>
<artifactId>gatling-maven-plugin</artifactId> <artifactId>gatling-maven-plugin</artifactId>
<version>${gatling-maven-plugin.version}</version> <version>${gatling-maven-plugin.version}</version>
<executions>
<execution>
<phase>test</phase>
<goals>
<goal>execute</goal>
</goals>
<configuration> <configuration>
<simulationClass>org.baeldung.RecordedSimulation</simulationClass> <disableCompiler>true</disableCompiler>
</configuration> </configuration>
</execution>
</executions>
</plugin> </plugin>
</plugins> </plugins>
</build> </build>
</profile>
</profiles>
<properties> <properties>
<maven.compiler.source>1.8</maven.compiler.source> <maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target> <maven.compiler.target>1.8</maven.compiler.target>
<encoding>UTF-8</encoding> <encoding>UTF-8</encoding>
<scala.version>2.12.6</scala.version> <!--2.11.12 --> <!--2.12.6 --> <scala.version>2.12.6</scala.version> <!--2.11.12 --> <!--2.12.6 -->
<gatling.version>3.3.1</gatling.version> <!--2.2.5 --> <!--2.3.1 --> <gatling.version>2.3.1</gatling.version> <!--2.2.5 --> <!--2.3.1 -->
<scala-maven-plugin.version>4.3.0</scala-maven-plugin.version> <!--3.2.2 --> <!--3.3.2 --> <scala-maven-plugin.version>3.2.2</scala-maven-plugin.version> <!--3.2.2 --> <!--3.3.2 -->
<gatling-maven-plugin.version>3.0.4</gatling-maven-plugin.version> <!--2.2.1 --> <!--2.2.4 --> <gatling-maven-plugin.version>2.2.4</gatling-maven-plugin.version> <!--2.2.1 --> <!--2.2.4 -->
</properties> </properties>
</project> </project>

View File

@ -3,10 +3,11 @@ import io.gatling.core.config.GatlingPropertiesBuilder
object Engine extends App { object Engine extends App {
val props = new GatlingPropertiesBuilder() val props = new GatlingPropertiesBuilder
.resourcesDirectory(IDEPathHelper.resourcesDirectory.toString) props.dataDirectory(IDEPathHelper.dataDirectory.toString)
.resultsDirectory(IDEPathHelper.resultsDirectory.toString) props.resultsDirectory(IDEPathHelper.resultsDirectory.toString)
.binariesDirectory(IDEPathHelper.mavenBinariesDirectory.toString) props.bodiesDirectory(IDEPathHelper.bodiesDirectory.toString)
props.binariesDirectory(IDEPathHelper.mavenBinariesDirectory.toString)
Gatling.fromMap(props.build) Gatling.fromMap(props.build)
} }

View File

@ -4,7 +4,7 @@ import io.gatling.commons.util.PathHelper._
object IDEPathHelper { object IDEPathHelper {
val gatlingConfUrl: Path = getClass.getClassLoader.getResource("gatling.conf") val gatlingConfUrl: Path = getClass.getClassLoader.getResource("gatling.conf").toURI
val projectRootDir = gatlingConfUrl.ancestor(3) val projectRootDir = gatlingConfUrl.ancestor(3)
val mavenSourcesDirectory = projectRootDir / "src" / "test" / "scala" val mavenSourcesDirectory = projectRootDir / "src" / "test" / "scala"
@ -12,8 +12,11 @@ object IDEPathHelper {
val mavenTargetDirectory = projectRootDir / "target" val mavenTargetDirectory = projectRootDir / "target"
val mavenBinariesDirectory = mavenTargetDirectory / "test-classes" val mavenBinariesDirectory = mavenTargetDirectory / "test-classes"
val resourcesDirectory = mavenResourcesDirectory val dataDirectory = mavenResourcesDirectory / "data"
val recorderSimulationsDirectory = mavenSourcesDirectory val bodiesDirectory = mavenResourcesDirectory / "bodies"
val recorderOutputDirectory = mavenSourcesDirectory
val resultsDirectory = mavenTargetDirectory / "gatling" val resultsDirectory = mavenTargetDirectory / "gatling"
val recorderConfigFile = mavenResourcesDirectory / "recorder.conf" val recorderConfigFile = mavenResourcesDirectory / "recorder.conf"
} }

View File

@ -3,10 +3,10 @@ import io.gatling.recorder.config.RecorderPropertiesBuilder
object Recorder extends App { object Recorder extends App {
val props = new RecorderPropertiesBuilder() val props = new RecorderPropertiesBuilder
.simulationsFolder(IDEPathHelper.recorderSimulationsDirectory.toString) props.simulationOutputFolder(IDEPathHelper.recorderOutputDirectory.toString)
.simulationPackage("org.baeldung") props.simulationPackage("org.baeldung")
.resourcesFolder(IDEPathHelper.resourcesDirectory.toString) props.bodiesFolder(IDEPathHelper.bodiesDirectory.toString)
GatlingRecorder.fromMap(props.build, Some(IDEPathHelper.recorderConfigFile)) GatlingRecorder.fromMap(props.build, Some(IDEPathHelper.recorderConfigFile))
} }

View File

@ -9,7 +9,7 @@ import io.gatling.jdbc.Predef._
class RecordedSimulation extends Simulation { class RecordedSimulation extends Simulation {
val httpProtocol = http val httpProtocol = http
.baseUrl("http://computer-database.gatling.io") .baseURL("http://computer-database.gatling.io")
.inferHtmlResources(BlackList(""".*\.css""", """.*\.js""", """.*\.ico"""), WhiteList()) .inferHtmlResources(BlackList(""".*\.css""", """.*\.js""", """.*\.ico"""), WhiteList())
.acceptHeader("text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8") .acceptHeader("text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8")
.acceptEncodingHeader("gzip, deflate") .acceptEncodingHeader("gzip, deflate")