Passing Thread Properties in Taurus YAML JMeter - jenkins

I am trying to build a Taurus yaml file for the below Jmeter scenarios, I have 2 threads where I am passing the Number Of Threads and Duration. Now with the regular command line, I use the below command to start the script, I use this same command from Jenkins too. This works fine and generate reports but not blazemeter one, so i am trying Taurus integration...
nohup /ssd/jmeter/apache-jmeter-5.3/bin/jmeter3g -Jquoteoff.threads=20 -Jquote.threads=20 -n -t /ssd/jmeter/scripts/PerformanceTesting/src/PS/OFFLINE_ONLINE.jmx
My below YML give me error, i am not sure if i am missing anything.
execution:
- scenario:
properties:
quote.threads: 20
quoteoff.threads: 20
onduration: 3600
script: /ssd/jmeter/scripts/PerformanceTesting/src/PS/OFFLINE_ONLINE.jmx
Also is there any direct command like shell we can use to invoke this script? I have seen a few places directly calling JMX script in Jenkins but not sure how to pass parameters in that scenarios.

I have no clue what's wrong here but below line is what causing the failure when i am trying to run bzt script.jmx
log.debug( vars.get("QUOTE_ID"));
To fix it when I changed log.debug to log.info it fixed the below problem I was facing. This is the partial answer as i am not sure about the reason for failure, but this should solve an issue where the script runs fine in Jmeter but bzt gives an error for XML parsing.

Wouldn't that be easier to add BlazeMeter Uploader plugin to your JMeter test plan, the plugin can be installed using JMeter Plugins Manager
It's possible to run existing .jmx script without creating any YAML
bzt /path/to/your/test.jmx
The correct syntax to define properties is:
execution:
- scenario: simple
scenarios:
simple:
script: tests/jmx/dummy.jmx
properties:
quote.threads: 20
#etc
Parameters can be passed via -o command-line argumententer link description here

Related

Selenium with Cucumber - Jenkins | How to configure specific feature to run using TAGS in jenkins

My runner file in my local system
My Jenkins configuration
Feature structure
As per my requirement, I have created separate features
{IndiaTransaction,CreateTransaction,BrazilTransaction,Mexico Transaction.features}
The above syntax will run all the features But I want to run specific features in my Jenkins, So how to configure it? I have tried below 2 methods it is not working, please help me to resolve
You can add a build step with Execute shell in Jenkins for the project and use the command below:
mvn test -Dcucumber.options="--tags #CreateTransaction,#BrazilTransaction"
And you can remove the tags option in cucumber runner class because the same thing you can do with -Dcucumber.options="--tags #tagName" in the command line
Please make sure you are using same tags in the feature files as well as in the command line.

Jtl file is empty when running Jmeter using ant

I am trying to run Jmeter with ant, (since I want to display the results of test, with all the steps).
The issue is that after I managed to run the command the Jtl file is empty, I am trying to run the basic test.jmx default test.
I run the command ant -Detest=Test run
the build is successful but the jtl results are empty. moreover it is finished after one second, while if I run via UI mode it should take more time.
Can someone please advise how to use ant with Jmeter, or how to get fully reports like in csv in html out put?
[][build results]
[][build.xml from ant\bin location]
[][location of test.jtl results file]
[][results are empty]
Most probably something is wrong with your JMeter test itself, i.e.
JMeter failed to start (installation or configuration issues)
it has 0 threads in Thread Group
there is an If Controller condition which prevent test execution
the test relies on a JMeter Plugin which is not installed
etc.
So I would recommend amending your build.xml file and enable writing JMeter log file by adding the next line to <jmeter> section: jmeterlogfile="${testpath}/jmeter-ant.log >
So it would look like
<jmeter
jmeterhome="${jmeter.home}"
testplan ="${testpath}/${test}.jmx"
resultlog="${testpath}/${test}.jtl"
jmeterlogfile="${testpath}/jmeter-ant.log>
When you run your test one more time you should see jmeter-ant.log file in the folder where your .jmx file lives.
More information: JMeter Ant Task

Jmeter+Jenkins Parameters

I am trying to run jmeter(.jmx) file using Jenkins by passing Number of Threads as a Parameter. Build getting success but .jmx file is not running. And also not showing any error in console.Following are my setup
In Jmeter Thread properties --Number of thread (Users)- ${__P(USERS,1)
In Jenkins job Created build string parameter -- USER_COUNT
Build using Execute shell and following is my command
cd /apache-jmeter-2.13/bin
./jmeter.sh -n -t /jmxFiles/Jbpm6Rest3Jenkins1.jmx -l /jmxFiles/SIP.jtl -JUSERS=%USER_COUNT%
While starting build passing USER_COUNT value from Jenkins
Following is the Jenkins console output
Jenkins Console Output
Not sure where i am doing wrong.
Note: Not using Ant/Maven to run jmx file.
As the other answer mentioned, change the %_USER_COUNT% to ${USER_COUNT}.
But is there any specific reason you are not using Ant/Maven?
Eventhough you should be able to run your jmeter test using a simple shell script, using Ant/Maven might make your life easier while generating report, charts etc.
I would advise you check the below links.
http://www.testautomationguru.com/jmeter-continuous-performance-testing-part1/
http://www.testautomationguru.com/jmeter-continuous-performance-testing-part2/
From the output, seems you are running a shell build step ($ /bin/sh -xe ....), which means your Jenkins runs on Linux (?). Also the paths use forward slash (/)....
You should put the string ${USER_COUNT} as part of your command (%USER_COUNT% is windows style).
I hope this helps.

How to setup Bamboo to work with codeception?

I have been trying to get Bamboo working with codeception tests. I am using codeception to test my code in a symfony project.
After some research I found an article on how to setup Jenkins with codeception.
Once read I figured out that I should use Ant to run the codeception commands that run the tests.
The problem is I don't really know where to put everything. This article explains all the fields for a new Ant task but nothing seem to work.
Can someone please help me?
In case anyone else comes across this, this is how I have gotten codeception working in bamboo.
In Admin > Server Capabilities. Add a new executable for Codeception with the path /usr/local/bin/codecept.
In your job, create a new task of type Command. Set the executable as Codeception. The arguments should be run --xml (and any others you need).
Next, create another task with the type of JUnit Parser. Set the custom results directory to tests/_log/*.xml.
This works perfectly for me.
Additional: If you do not have admin rights to the server, set the command executable as PHP and add ./vendor/bin/codecept run --xml as the arguments.

execute shell step skipped completely in jenkins

I can't seem to run a build execute shell step in Jenkins. I've worked with Hudson in the past on windows and I was able to create shell/batch steps without a problem but I seem to be be missing something here.
It's a fresh jenkins install and I go to "add build step", "execute shell" and enter "echo hi" in the command. I run the build and when I look in the console output, nothing happens.
I've also tried executing a test.sh file which also just echoes hi. I've tested this in both a linux install and an os X installed Jenkins server.
What am I missing in the configuration to run a shell script?
The console output shows that the shell script steps were skipped completely
Started by user admin
Finished: SUCCESS
It looks like Jenkins is not being able to redirect the output from the system. What version of Java are you using? If you're using OpenJDK, could you try with Sun Java/Sun JDK?
First test to try to check if anything is executing at all: add the following to your "Execute Shell"
#!/bin/bash
echo "HELLO WORLD" > /tmp/testfile
Run this and check if there is a /tmp/testfile in on your Linux system, and if it contains the HELLO WORLD text, it means your script is in fact executing.
Which version of Jenkins do you have?
The last good version that I can attest to (last one I know works well at least for us) is 1.447. If you're not using that one, would you be able to try with it?
Also, could you add #!/bin/sh or #!/bin/bash before echo hi on your "Execute Shell" for the Linux system and see if that works.
Also, try running a script using source /path/to/script and see if that works. The script should contain #!/bin/sh or #!/bin/bash as the first line, just to see if that makes a difference.
Note: none of this should be required, but is helpful just to get more information on what's going on. Couldn't fit all this into a comment. I'll update my answer based on your answers to the above, or delete if I can't get anything..
Putting this here for posterity.
I had a Jenkins project configured with Maven running clean test and a execute shell in the pre steps. The logs from Maven where not coming through and the script was not executing. Once I unchecked Build modules in parallel under the Maven build options my logs and scripts started working.
Make sure its in a location where Jenkins can see it, check permissions.

Resources