Docker Community Forums

Share and learn in the Docker community.

Dockerize in Jmeter - problem with run all tests one by one


#1

I must do dockerize with Jmeter - to run Jmeter tests in Jenkins. , so I have a 40 testy plan (this is functional test, using web socker sampler)(in jmx format) and I want to launch this in docker container. I created container, using this dockerfile - I using this dockerfile https://hub.docker.com/r/egaillardon/jmeter-plugins/~/dockerfile/ and adding in this : From egaillardon/jmeter:5.0.0-1.2.0 ENV JMETER_VERSION 5.0 COPY entrypoint.sh /jmeter RUN chmod +x /jmeter/entrypoint.sh WORKDIR /jmeter ENTRYPOINT [“entrypoint.sh”] ENTRYPOINT [“sleep”, “1000”] and when I run this in docker container - (docker exec) i with command jmeter -m I receive a answer" incorrect usage:non-gui runs require a test plan docker" but when I write jmeter -n -t AuthorizationSuccess.jmx this test run correctly but I want to execute all my tests, so I want to run all my tests in loop - so that, by the test run one after the other after entering one command, all tests started, one after the other.

I created script in bash, and save this script as entrypoint.sh

mkdir -p /jmeter/results && for script in ls /jmeter/testy/*.jmx ; do /opt/apache-jmeter-5.0/bin/jmeter.sh -n -t /jmeter/testy/{script} -l /jmeter/results/{script}.jtl; done

but this script didnt run. I also want to this script generate results to csv file

In my system I run Jmeter tests with this script

scripDir=$(dirname “$0”) rm $scripDir/log.csv for entry in “$scripDir/pluginsTests”/ / do echo “$entry” $jmeter -n -t $entry -q $scripDir/properties/local.properties -l $scripDir/log.csv done

and results from this tests save to csv.file

In docker I also want results will save to csv file

What I do wrong in docker? what I can improve this? What should be look like my script to run all tests in loop and generate results to csv file on docker?

I didnt copy tests project to container,becouse I run in command line command with volume to my project

Is anyone who will have today time to help me with this? $