Atlassian Bamboo - Display JMeter test results using JMeter Aggregator plugin - bash

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).

Related

Unable to access jar file for jmeter

When I run a watch file of JMeter then in CMD error shows me that error level 1. I tried many ways but unable to access it. Please show me best way so I can run Jmeter very easily.
Thank You in Advance.
The main reason for getting this error is downloading Source distribution instead of Binary, you need to re-download the "Binary" one:
Also make sure you properly installed JDK or JRE and java executable is in your operating system PATH (so when you execute java -version you see your Java installation details)
More information: How to Get Started With JMeter: Installation & Test Plans

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.

Where does Jenkins store the project source

I have a Jenkins job that uses a script to build my project. On the following line, the script fails mvn -e -X -Dgit='$git' release:prepare.
Because I want to search for the cause of this, I want to go to the Jenkins server and run mvn -e -X -Dgit='$git' release:prepare from the command line, to see if it works.
Does Jenkins store the projects' source code somewhere, such that I can go to that folder and call Maven?
If yes, then where?
Yes, It Stores the project files for the job by default at
/var/lib/jenkins/workspace/{your-job-name}
This is where jenkins suppose the project files to be present or it pulls it from a source before start working/building from it.
Quote from Andrew M.:
"Hudson/Jenkins doesn't quite work that way. It stores configurations and job information in /var/lib/jenkins by default (if you're using the .deb package). If you want to setup persistence for a specific application, that's something you'll want to handle yourself - Hudson is a continuous integration server, not a test framework.
Check out the Wiki article on Continuous Integration for an overview of what to expect."
From this Question on serverfault.
This worked for me:
/var/jenkins/workspace/JobNameExample
but, if your build machine (node) is a different than the one where Jenkins is running (manager), You need specify it:
/var/jenkins/workspace/JobNameExample/label/NodeName
Where you can define label too:
jenkins stores its workspace files currently in /var/jenkins_home/workspace/project_name
I am running from docker though!

Bamboo Script Task using inline bat commands failing

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

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