Running Gatling from container
Asked Answered
C

2

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???

Closefitting answered 20/9, 2016 at 14:3 Comment(0)
O
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

Overspread answered 21/9, 2016 at 3:59 Comment(5)
Thank you and another question is it possible to lunch 2 or more at once test for example AdvancedSimulationStep01 and AdvancedSimulationStep02?Closefitting
gatling.io/docs/2.0.0-RC2/project/faq.html - as per this it is not possible to launch simulations sequentially.Overspread
but if i have a package of test for example computerdatabase.advanced witch consist of 3 tests is it possible to test them sequentially??Closefitting
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 or your own shell script - ready to use solution or gatling-maven-plugin exampleStriation
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 or with simulationsFolder param like in example hereStriation
D
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.

Discontinuity answered 26/8, 2018 at 21:46 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.