Hey,
im trying to build and run the script inside eclipse, but unfortunately i got no simulation script found.
i changed IDEPathHelper to have my simulation folder.
import scala.tools.nsc.io.File
import scala.tools.nsc.io.Path.string2path
object IDEPathHelper {
val gatlingConfUrl = getClass.getClassLoader.getResource(“recorder.conf”).getPath
val projectRootDir = File(gatlingConfUrl).parents(2)
val mavenSourcesDirectory = projectRootDir / “simulations”
val mavenResourcesDirectory = projectRootDir
val mavenTargetDirectory = projectRootDir / “target”
val mavenBinariesDirectory = mavenTargetDirectory / “test-classes”
val dataDirectory = mavenResourcesDirectory / “data”
val requestBodiesDirectory = mavenResourcesDirectory / “request-bodies”
val recorderOutputDirectory = mavenSourcesDirectory
val resultsDirectory = mavenTargetDirectory / “results”
val recorderConfigFile = (mavenResourcesDirectory / “recorder.conf”).toFile
}
and changed Engine.scala to pick it up
import io.gatling.app.Gatling
import io.gatling.core.config.GatlingPropertiesBuilder
object Engine extends App {
val props = new GatlingPropertiesBuilder
System.out.println(IDEPathHelper.mavenSourcesDirectory.toString)
props.sourcesDirectory(IDEPathHelper.mavenSourcesDirectory.toString) // by default this line is not there.
props.dataDirectory(IDEPathHelper.dataDirectory.toString)
props.resultsDirectory(IDEPathHelper.resultsDirectory.toString)
props.requestBodiesDirectory(IDEPathHelper.requestBodiesDirectory.toString)
props.binariesDirectory(IDEPathHelper.mavenBinariesDirectory.toString)
Gatling.fromMap(props.build)
}
my simulations folder is parallel to src folder (for some reason i cant change that). to run engine.scala, i always got this message: There is no simulation script. Please check that your scripts are in user-files/simulations.
if i put my simulations into /src/test/scala, engine.scala can pick it up.
Any ideas why it can’t use projectRootDir / “simulations” as the simulation folder?
Thanks,