7

I am using denvazh/gatling container and everything works well except one thing i try to pass list of simulations like this:

Attaching to gatling
gatling_1 | GATLING_HOME is set to /opt/gatling
gatling_1 | Choose a simulation number:
gatling_1 |      [0] AppsPods
gatling_1 |      [1] ServerSimulation
gatling_1 |      [2] computerdatabase.BasicSimulation
gatling_1 |      [3] computerdatabase.advanced.AdvancedSimulationStep01
gatling_1 |      [4] computerdatabase.advanced.AdvancedSimulationStep02
gatling_1 |      [5] computerdatabase.advanced.AdvancedSimulationStep03 

I write such command as:

docker run -it --rm -v /home/core/gatling/conf:/opt/gatling/conf \
-v /home/core/gatling/user-files:/opt/gatling/user-files \
-v /home/core/gatling/results:/opt/gatling/results \
denvazh/gatling -s AdvancedSimulationStep01

but nothing make sense simulation list shows again and i need to choose test from list to start the simulation. So is it possible to run only that test witch i specify starting docker run command???

giampaolo
  • 6,906
  • 5
  • 45
  • 73
user6329667
  • 447
  • 1
  • 5
  • 16

2 Answers2

8

You need to give the fully qualified classname i.e

docker run -it --rm -v /home/core/gatling/conf:/opt/gatling/conf \ -v /home/core/gatling/user-files:/opt/gatling/user-files \ -v /home/core/gatling/results:/opt/gatling/results \ denvazh/gatling -s computerdatabase.advanced.AdvancedSimulationStep01

niharika_neo
  • 8,441
  • 1
  • 19
  • 31
  • Thank you and another question is it possible to lunch 2 or more at once test for example AdvancedSimulationStep01 and AdvancedSimulationStep02? – user6329667 Sep 21 '16 at 08:15
  • http://gatling.io/docs/2.0.0-RC2/project/faq.html - as per this it is not possible to launch simulations sequentially. – niharika_neo Sep 21 '16 at 09:09
  • but if i have a package of test for example computerdatabase.advanced witch consist of 3 tests is it possible to test them sequentially?? – user6329667 Sep 21 '16 at 10:37
  • To run more than one test sequentially you have to use 3rd party (not gatling) solutions. So for example you can use Jenkins [Multiple Job Plugin](https://wiki.jenkins-ci.org/display/JENKINS/Multijob+Plugin) or your own shell script - [ready to use solution](http://stackoverflow.com/a/41453908/5003181) or gatling-maven-plugin [example](https://gist.github.com/davidkeen/5ecac586cb46c3519808) – rkarczmarczyk Feb 06 '17 at 21:21
  • 1
    There is also possibility to use **gatling-maven-plugin** with **runMultipleSimulations** flag set to true. Than you can use **includes/exludes** like in example [here](http://gatling.io/docs/2.2.3/extensions/maven_plugin.html) or with **simulationsFolder** param like in example [here](http://gatling.io/docs/2.1.6/extensions/maven_plugin.html) – rkarczmarczyk Feb 06 '17 at 22:21
1

I run my simulations a little different, perhaps like this within Taurus harness, where bzt-configs is the folder containing scripts, and artifacts is the folder containing test output:

#!/bin/bash
clear
## use en0, not en1, if your on WIFI
OSX_HOST=`ipconfig getifaddr en0`
MACHINE_HOST=$OSX_HOST
CURRENT_DIR=`pwd`
if [[ -z "${GATLING_HOME}" ]]; then
  GATLING_HOME=~/gatling
fi
EXEC_SUB_FOLDER=out-taurus
EXEC_FOLDER="$CURRENT_DIR/${EXEC_SUB_FOLDER}"
[ -d $EXEC_FOLDER ] || mkdir $EXEC_FOLDER
yes | cp -rf performance/my-simulation/scripts/* $EXEC_FOLDER
cd $EXEC_FOLDER
docker run -it --rm -e MY_ENV='dev' --add-host "machine-host:${MACHINE_HOST}" \
 -v ~/.bzt-rc::/bzt-configs/.bzt-rc -v $PWD:/bzt-configs -v $PWD:/tmp/artifacts \
 blazemeter/taurus:latest /tmp/artifacts/performance.yml
cd ..

Where .yml contains your Gatling bzt config:

execution:
- executor: gatling
  scenario: MySimulation
modules:
  console:
    disable: 'true'
  local:
    sequential: 'true'
reporting:
- module: final-stats
scenarios:
  MySimulation:
    script: computerdatabase.advanced.AdvancedSimulationStep01.scala
    simulation: MySimulation
settings:
  check-interval: 1s

Then your gatling script can use the machine-host name in /etc/hosts to call back to the test target.

djangofan
  • 28,471
  • 61
  • 196
  • 289