How to set path to the file location in the "CSV Data Set Config" if csv.file is located in bitbucket - jmeter

I want to run Jmeter project in Jenkins. I commited project.jmx and related csv files in bitbucket. How can I set the path to the csv file located in bitbucket

CSV Data Set config will accept
Absolute path (the complete path like c:\path\to\csv\file.csv)
Relative path from the test (csvfolder\csvfile.csv)
csvfolder
csvfile.csv
.jmx
Assuming the 'csvfolder' folder is present where you have .jmx
If your folder structure is as given below,
csvfolder
csvfile
jmxfolder
jmx
then your CSV file path should be ../csvfolder/csvfile

Not sure about you specific combination, but usually if your files are in the same location you can refer to them by name only.
Let's say
%JMETER_HOME%\jmeter -n -t %LOAD_TESTS_RUNNER_%/_warmup.jmx
-Jusers=1 -Jrampup=5 -Jloop=2 -JpathToToken=Token.txt
Token.txt is just located in the same directory as *.jmx file.
Optionally, you could use system variables to contain your paths.

Depending on your Bitbucket underlying repository type you can configure Jenkins job to be triggered by commit using
Jenkins Git Plugin
Jenkins Mercurial Plugin
So you will be able to refer paths to JMeter .jmx and .csv files just using their names. Or if you prefer full paths - you can use WORKSPACE Jenkins variable like:
%WORKSPACE% - for MS Windows Family
$WORKSPACE - for Linux/Unix/MacOSX
See Continuous Integration 101: How to Run JMeter With Jenkins article for more information on running JMeter tests from Jenkins

How to read data from CSV File and run jmx for linux
If my jmx file is login.jmx
my input file is users.csv
what should be the syntax or command in linux

Related

How to parse a csv and use the content in the maven build in Jenkins

I'm new to Jenkins jobs. What I wanted to achieve is to parse the contents of a dynamically created CSV file for the list of names of test cases I want to execute in my maven build statement. The CSV file is available in my workspace under the /src/test/result directory and here is the build configuration:
Maven version: Maven-3.3.3
Root POM: pom.xml
Goals and options: clean install -Dinclude.tag=test1
I tried File Parameter and specified my csv's location but I don't know how to get the contents of the file so I can replace test1 in the Goals and option section by the list of names of my test cases to execute. I'm using the Execute windows batch command in my pre build steps. Any help is highly appreciated.

SonarQube Local Analysis - specify properties file

I'm trying to run the analysis locally using Sonar-Scanner 2.6 pointing to SonarQube 5.4. The local solution folder contains the sonar-project.properties file used in the cloud analysis.
I am trying to create the properties file to be used locally, that is separate from the global sonar-project.properties file. This is the command that I ran:
sonar-scanner -D project.settings=sonar-project-local.properties
Expected behavior: Of the two files (sonar-project.properties and sonar-project-local.properties), sonar-scanner would choose the local one.
Observed behavior: If the file sonar-project.properties exists, sonar-scanner uses the global one and ignores the local one.
If I remove (rename) the global file from the directory, then the local file is recognized, and behavior is as expected.
Is this a bug? What is the way to solve this issue without messing with the global properties file?
Generally the answer would be the space in your command. So, not
-D project.settings=...
but
-Dproject.settings=...
But that property was dropped. You'll just need to shuffle the properties files in/out of the "correct" name.

java.io.FileNotFoundException With jmeter testplan while running it from Jenkins-Maven build

I am using File Upload (Post) Rest API in jmeter. file Path in the file upload section I have given as "File name" directly as its in the same folder where jmx file is.
Its working fine in jmeter ui but when running it through Jenkins I am getting file not found Exception.
how ever I am not sure whether I need to update anything in POM file or my jmx file it self to make jenkins find file path.
Current Scenario Jmeter:
jmx file location: xyz/test.jmx
Fie upload location: xyz/abc.file
file path in Jmeter UI(HTTP POST request): abc.file
Result: Working Fine
Current Scenario Jenkins:
jmx file location: xyz/src/test/jmeter/test.jmx
Fie upload location: xyz/src/test/jmeter/abc.file
file path in Jmeter UI(HTTP POST request): abc.file
Result: getting file not found exception
please suggest me solution if any I have already checked many blogs/answers. but none of them result my situation.
Thanks,
Divyang Raval
I believe when JMeter is being run from Maven it tries to look for files under the following folder:
target\jmeter\bin
So the options are in:
use full path instead of relative
copy the file from its original location to target\jmeter\bin folder using i.e. OS Process Sampler from setUp Thread Group
given you don't execute mvn clean copy the file to target\jmeter\bin folder once
The best solution would be using Jenkins Parameterisation, i.e. pass WORKSPACE Jenkins Variable property value to Maven build and access it in JMeter via __P() function

Deploy a Copy of the nupkg to a file share

Is it possible to output/deploy a .nupkg file that is downloaded from a teamcity server. Currently it extracts the .nupkg that is downloaded from the teamcity server. The file that is extracted into the Applications folder is stored in the Octopus\Applications.Tentacle\Packages folder but it has an internal name which is not very user friendly.
My only option at this point is to run a custom powershell script that copies the file and renames it, but this seems like a rather crude hack.
Use the system variables to access the internal values set within Octopus to find what the name and path of the nuget package you want. This list of system variables on the Octopus Deploy site is where'd I'd start to look first. I don't know how complete the list is but there are a consider number of variables you have access to in Octopus Deploy.

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