[gatling 1.5.4]: trying to run simulation from command-line results in ZincCompiler errors (object x is not a member of package y)

I started crafting my simulations using https://gist.github.com/groovybayo/4691670 to bootstrap the whole project, thinking I would be able to just run gatling from the command-line under CI. Once I had a complete simulation working, complete with composition and some run-time behavior controls, my next task is to get it running from the command-line.

I wrote a wrapper script to pass the configuration settings based on Engine.scala, wrapper.sh.

–wrapper.sh--------------------

export GATLING_HOME=/kando/server/gatling
export GATLING_CONF=${GATLING_HOME}/src/test/resources

TARGET=${GATLING_HOME}/target
RESULTS=${TARGET}/results
REQUESTS=${GATLING_CONF}/request-bodies
BINARIES=${TARGET}/test-classes
SOURCES=${GATLING_HOME}/src/test/scala/com/company/group/gatling/simulations

DESCRIPTION=nutty

#echo running TestSimulation via Gatling

-s ${SIMULATION}

#cmd="${GATLING_HOME}/bin/gatling.sh -rf ${RESULTS} -bf ${REQUESTS} -sbf ${BINARIES} -sd ${DESCRIPTION}"
cmd="${GATLING_HOME}/bin/gatling.sh -rf ${RESULTS} -bf ${REQUESTS} -sf ${SOURCES} -sd ${DESCRIPTION}"
echo ${cmd}
${cmd}

–wrapper.sh--------------------

I have my project organized as follows:

src/test/scala/com/company/group/gatling:

  • core/
  • services/
  • simulations/
  • titles.title/
  • tools/

with Engine, IDEPathHelper, & Recorder under src/test/scala.

Took me a few runs (and digging into the Gatling source) that -sbf & -sf are mutually exclusive.

When run as above, I get the following errors:

00:04:18.740 [ERROR] c.e.e.g.a.ZincCompiler$ - /kando/server/gatling/src/test/scala/com/company/group/gatling/simulations/titleSimulation.scala:5: object titles is not a member of package com.company.group.gatling
00:04:18.744 [ERROR] c.e.e.g.a.ZincCompiler$ - import com.company.group.gatling.titles.title.SessionProfile
00:04:18.746 [ERROR] c.e.e.g.a.ZincCompiler$ - ^
00:04:18.749 [ERROR] c.e.e.g.a.ZincCompiler$ - /kando/server/gatling/src/test/scala/com/company/group/gatling/simulations/titleSimulation.scala:6: object core is not a member of package com.company.group.gatling
00:04:18.749 [ERROR] c.e.e.g.a.ZincCompiler$ - import com.company.group.gatling.core.{Properties, Common}
00:04:18.749 [ERROR] c.e.e.g.a.ZincCompiler$ - ^
00:04:19.006 [ERROR] c.e.e.g.a.ZincCompiler$ - /kando/server/gatling/src/test/scala/com/company/group/gatling/simulations/LogonDefault.scala:5: object services is not a member of package com.company.group.gatling
00:04:19.006 [ERROR] c.e.e.g.a.ZincCompiler$ - import com.company.group.gatling.services.{Strings, Sso, Doorman}
00:04:19.006 [ERROR] c.e.e.g.a.ZincCompiler$ - ^
00:04:19.008 [ERROR] c.e.e.g.a.ZincCompiler$ - /kando/server/gatling/src/test/scala/com/company/group/gatling/simulations/LogonDefault.scala:6: object core is not a member of package com.company.group.gatling
00:04:19.008 [ERROR] c.e.e.g.a.ZincCompiler$ - import com.company.group.gatling.core.Properties
00:04:19.008 [ERROR] c.e.e.g.a.ZincCompiler$ - ^
00:04:19.429 [ERROR] c.e.e.g.a.ZincCompiler$ - /kando/server/gatling/src/test/scala/com/company/group/gatling/simulations/TelemetrySimulation.scala:5: object core is not a member of package com.company.group.gatling
00:04:19.429 [ERROR] c.e.e.g.a.ZincCompiler$ - import com.company.group.gatling.core.Common
00:04:19.429 [ERROR] c.e.e.g.a.ZincCompiler$ - ^
00:04:19.430 [ERROR] c.e.e.g.a.ZincCompiler$ - /kando/server/gatling/src/test/scala/com/company/group/gatling/simulations/TelemetrySimulation.scala:6: object services is not a member of package com.company.group.gatling
00:04:19.431 [ERROR] c.e.e.g.a.ZincCompiler$ - import com.company.group.gatling.services.Telemetry
00:04:19.431 [ERROR] c.e.e.g.a.ZincCompiler$ - ^
00:04:19.437 [ERROR] c.e.e.g.a.ZincCompiler$ - /kando/server/gatling/src/test/scala/com/company/group/gatling/simulations/TestSimulation.scala:5: object core is not a member of package com.company.group.gatling
00:04:19.438 [ERROR] c.e.e.g.a.ZincCompiler$ - import com.company.group.gatling.core.{Properties, Common}
00:04:19.438 [ERROR] c.e.e.g.a.ZincCompiler$ - ^
00:04:19.440 [ERROR] c.e.e.g.a.ZincCompiler$ - /kando/server/gatling/src/test/scala/com/company/group/gatling/simulations/TestSimulation.scala:6: object titles is not a member of package com.company.group.gatling
00:04:19.440 [ERROR] c.e.e.g.a.ZincCompiler$ - import com.company.group.gatling.titles.title.SessionProfile
00:04:19.440 [ERROR] c.e.e.g.a.ZincCompiler$ - ^
00:04:19.463 [ERROR] c.e.e.g.a.ZincCompiler$ - 8 errors found
Exception in thread “main” Compilation failed
at sbt.compiler.AnalyzingCompiler.call(AnalyzingCompiler.scala:76)
at sbt.compiler.AnalyzingCompiler.compile(AnalyzingCompiler.scala:35)
at sbt.compiler.AnalyzingCompiler.compile(AnalyzingCompiler.scala:29)
at sbt.compiler.AggressiveCompile$$anonfun$4$$anonfun$compileScala$1$1.apply$mcV$sp(AggressiveCompile.scala:71)
at sbt.compiler.AggressiveCompile$$anonfun$4$$anonfun$compileScala$1$1.apply(AggressiveCompile.scala:71)
at sbt.compiler.AggressiveCompile$$anonfun$4$$anonfun$compileScala$1$1.apply(AggressiveCompile.scala:71)
at sbt.compiler.AggressiveCompile.sbt$compiler$AggressiveCompile$$timed(AggressiveCompile.scala:101)
at sbt.compiler.AggressiveCompile$$anonfun$4.compileScala$1(AggressiveCompile.scala:70)
at sbt.compiler.AggressiveCompile$$anonfun$4.apply(AggressiveCompile.scala:88)
at sbt.compiler.AggressiveCompile$$anonfun$4.apply(AggressiveCompile.scala:60)
at sbt.inc.IncrementalCompile$$anonfun$doCompile$1.apply(Compile.scala:24)
at sbt.inc.IncrementalCompile$$anonfun$doCompile$1.apply(Compile.scala:22)
at sbt.inc.Incremental$.cycle(Incremental.scala:52)
at sbt.inc.Incremental$.compile(Incremental.scala:29)
at sbt.inc.IncrementalCompile$.apply(Compile.scala:20)
at sbt.compiler.AggressiveCompile.compile2(AggressiveCompile.scala:96)
at sbt.compiler.AggressiveCompile.compile1(AggressiveCompile.scala:44)
at com.typesafe.zinc.Compiler.compile(Compiler.scala:158)
at com.typesafe.zinc.Compiler.compile(Compiler.scala:142)
at com.excilys.ebi.gatling.app.ZincCompiler$.apply(ZincCompiler.scala:104)
at com.excilys.ebi.gatling.app.SimulationClassLoader$.fromSourcesDirectory(SimulationClassLoader.scala:34)
at com.excilys.ebi.gatling.app.Gatling$$anonfun$12.apply(Gatling.scala:89)
at com.excilys.ebi.gatling.app.Gatling$$anonfun$12.apply(Gatling.scala:89)
at scala.Option.getOrElse(Option.scala:108)
at com.excilys.ebi.gatling.app.Gatling.start(Gatling.scala:89)
at com.excilys.ebi.gatling.app.Gatling$.fromMap(Gatling.scala:54)
at com.excilys.ebi.gatling.app.Gatling$.runGatling(Gatling.scala:74)
at com.excilys.ebi.gatling.app.Gatling$.main(Gatling.scala:49)
at com.excilys.ebi.gatling.app.Gatling.main(Gatling.scala)

I’ve tried, instead, to run using the binaries compiled from the IDE. That simply results in this error:

Exception in thread “main” java.lang.ClassNotFoundException: Engine$
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at com.excilys.ebi.gatling.app.FileSystemBackedSimulationClassLoader$$anonfun$3.apply(SimulationClassLoader.scala:72)
at com.excilys.ebi.gatling.app.FileSystemBackedSimulationClassLoader$$anonfun$3.apply(SimulationClassLoader.scala:72)
at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:233)
at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:233)
at scala.collection.LinearSeqOptimized$class.foreach(LinearSeqOptimized.scala:59)
at scala.collection.immutable.List.foreach(List.scala:76)
at scala.collection.TraversableLike$class.map(TraversableLike.scala:233)
at scala.collection.immutable.List.map(List.scala:76)
at com.excilys.ebi.gatling.app.FileSystemBackedSimulationClassLoader.simulationClasses(SimulationClassLoader.scala:72)
at com.excilys.ebi.gatling.app.Gatling.start(Gatling.scala:90)
at com.excilys.ebi.gatling.app.Gatling$.fromMap(Gatling.scala:54)
at com.excilys.ebi.gatling.app.Gatling$.runGatling(Gatling.scala:74)
at com.excilys.ebi.gatling.app.Gatling$.main(Gatling.scala:49)
at com.excilys.ebi.gatling.app.Gatling.main(Gatling.scala)

My preference would be to have gatling build the sources on the fly and not have to re-org all the classes. I will if I have to, though.

Several things look weird to me:
SOURCES=${GATLING_HOME}/src/test/scala/com/company/group/gatling/simulations

should be ${GATLING_HOME}/src/test/scala

Then folder “titles.title” might cause problems depending on the environment. 2 folders (titles/title) would be more safe.

Yep, the SOURCES was too deep, making it impossible for the compiler to resolve symbols correctly. [I literally found it right before dinner last night].

The “titles.title” is fine.

Thanks!

–sky
[Looking forward to Gatling 2.0]

[Looking forward to Gatling 2.0]

Yeah, so am I... :wink: