Bamboo Script Task using inline bat commands failing - jmeter

Im new to Bamboo and just trying to run this two lines of code in the script task.
cd C:\apache-jmeter-2.11\bin\
jmeter-n.cmd Test.jmx​
It is failing and it is showing this message on the logs.
Failing task since return code of [c:\Program Files\Bamboo\temp\TEST-16-ScriptBuildTask-4637676047487491491.bat] was -1 while expected 0

Is path to JMeter correct?
Does Test.jmx script live in JMeter's bin directory
Do you have "java.exe" in your PATH environment variable? Does Bamboo pick it up?
Can you look into "C:\apache-jmeter-2.11\bin\Test.log" file to see whether they are errors there. If there is no such a file one of points 1-3 isn't met.
Are you aware of Bamboo JMeter Plugin?
By the way, Bamboo is capable of executing Ant or Maven tasks and JMeter test can be kicked off using these build systems as well.
References:
Automated Performance Testing using Maven and JMeter
JMeter Maven Plugin
5 Ways To Launch a JMeter Test without Using the JMeter GUI

Related

How to install Jmeter on Gitlab runner machine?

I am new to using JMeter with GitLab CI/CD. I have created loadTest suite and want to configure it in Gitlab CI/CD pipeline. I have run.sh file in my loadTest project which do following:
Create and set up test data
Download JMeter dependencies and plugins (if JMeter already exists, skip this step)
Run the test
Clean up test data
Questions:
Is it a good idea to download JMeter in your project folder while you run the script or use JMeter docker image and run the tests ? I am concern about keeping JMeter folder in GitLab repo and occupying unnecessary space.
How to install Jmeter on Gitlab runner machine ?
Thank you in advance.
If your run.sh script downloads JMeter you don't need to put JMeter into Github repo. Using Docker is also possible, you can either check existing images or create your own with your own test data and plugins.
Gitlab runners are normal Linux machines (if you choose the relevant executor), my expectation is that your run.sh should work just fine there as it is (or with minimal amendments, like installing Java prior to installing JMeter)

How to run JMeter test from Jenkins

How to run jmeter test from Jenkins, here i want to run my jmeter test with jenkins and tried to configure the Jenkins with Performance plugin based on the information got after googling.
In Google the solution is provided where jenkins is hosted locally and in Build we configure command line execution by providing jmx file path and so on...
the problem comes when my jenkins is in other server like http://172.27.80.57:8080/... here if i give Command line execution by providing jmx file path my build will fail..because my path is in different location..
So How to over come this as i am new to Jmeter and my boss want this result to be shown in jenkins ....and if there is any plugins which i need to install or is there any place where i am missing, please let me know ....this is very important for me....
OR is there any possibility that where we can push our changes to Git lab using CI tools such as Sourcetree...etc and then run those in Jenkins.
Thanks in advance.
You will need to install Jenkins build agent to the machine which you plan to use as JMeter load generator, check out Distributed Builds Jenkins Wiki page.
Also JMeter test is possible using Jenkins Pipeline feature. For more information check Running a JMeter Test via Jenkins Pipeline
Hope this helps.

How to execute a shell script in maven

I am trying to incorporate a shell script in my maven build. This is what I want:
Transfer unit tests to a server, run the tests on the server, transfer the output of the tests back to the maven build, maven then parses the test results and continues/fails based on the output. (I know this is a weird way but because there are no testing plugins for the chosen programming language on maven, this is the most efficient way of introducing unit tests).
I have written a shell script on the server, which does run the tests and places the outputs in a /testOutput folder on the server. But I have 2 problems:
How would I be able to run the shell script, located on the server, using maven and how would I be able to run it with sudo?

Atlassian Bamboo - Display JMeter test results using JMeter Aggregator plugin

I've been tasked to install and figure out how to use the JMeter Aggregator plugin for Bamboo on a locally built vagrant server with Bamboo on it on my machine so I can learn how to use it before putting it on the project that I'm working on's Bamboo instance but I can't figure out how to get the Aggregator plugin to actually read any of the test results properly so it keeps failing the assertions.
Currently, I've just set up a JMeter test through the gui client and saved the .jmx to my jmeter folder on the vagrant server so I can run it headless from a bash script and send the results to a .jtl file in another directory. Below is the bash script:
I've got the Aggregator plugin installed and I've pointed it to the resulting .jtl file but when I try and put any assertions on it, it breaks the build and says the assertion failed because the value was 0, which is not actually the case. Below is the current configuration I've got on the plugin - I've tried changing the filepath to an absolute one but that didn't fix it so I don't know if it's pointed at the wrong file or if it needs to be XML to do anything with the data it gets out?
If anyone could offer any guidance on this, I'd really appreciate the assist - been struggling with this for a couple of days now and there's precious little in the way of documentation on it...
I know it is an old post, I recently came across a similar issue.
hope this helps.
Bamboo looks for .jtl files in working directory of the job. So instead changing directory give absolute/relative path of the JMeter executable file changing the command to
bash <path to jmeter executable>jmeter -n -t <path to jmx>/steve.jmx -l results.jtl
While giving Build log file path use expression like
**/<file_name>.jtl (for picking up specific file)
or you can also use
**/*.jtl (to pickup all files available in working dir).

Create multiple jmeter.log files

I am using Jmeter for performance testing and running our tests via Jenkins build server.
We have Jmeter installed on our jenkins box and I am using an Ant build file to launch the jmx file and create the jtl report; which is then evaluated via the Performance plugin in Jenkins.
My problem is that we only have one instance of Jmeter and as such it only creates one jmeter.log file in the /bin directory.
As we will have multiple jobs calling the one Jmeter installation I don't want it, potentially, writing to the same log.
Is there a way of specifying multiple jmeter.log files per plan/job or amending the location?
Thanks for your suggestions. Using a Jmeter Ant Task and have managed to place the log file into the workspace of the jenkins job by the following:
jmeterlogfile="${basedir}/jmeter.log"
This sits within the JMeter tags within the build file.
Without changing .properties file, running jmeter from Windows cmd, simply navigate to bin folder and pass the argument -j[yourLogFileName.log], if you want log entries in a different log file.
C:\apache-jmeter-2.11\bin>jmeter.bat -j myLog.log

Resources