0

I have a requirement to integrate the JMeter scripts, checked-in a Git repository, with a DevOps pipeline so that I can run the JMeter scripts using a specific VM in Azure. Basically, I should have all my jmxs and csvs in a git repository and when I run the pipeline, having a parameter of the script name, it should run the script on a specific VM (not with a static IP) and copy the jtl in some storage. What is the best way to achieve this?

2 Answers2

2

With a DevOps pipeline so that I can run the JMeter scripts using a specific VM in Azure. What is the best way to achieve this?

If the specific VM exists before the current pipeline, you can consider installing self-hosted agent there.

To do CI/CD using Azure pipelines, we need at least one agent. If we use microsoft-hosted agent, it will provide one fresh VM for us to run jobs. Since you need to run the script in your own specific VM, I suggest using self-hosted agent. You can follow the steps here to install one agent into your own VM. (The steps are quite easy and only cost several minutes)

After making your VM a self-hosted agent, the pipeline will call your VM to run the jobs. Now your original issue turns into how to run JMeter locally with command-line. See similar issues here: Five Ways To Launch a JMeter Test without Using the JMeter GUI and Run .jmx file through command line ....

1.So now we can use a command-line task in pipeline to run the JMeter related commands shared in the similar topics above. And these jobs are done in your specific VM.

2.I'm not sure which location you want to copy the jtl to, but you can use Azure File Copy task to copy files to Microsoft Azure storage blobs or virtual machines (VMs). Or a simple copy/xcopy command in your command line task to copy files to another location in same machine. (Specific VM)

Hope all above helps :)

LoLance
  • 25,666
  • 1
  • 39
  • 73
  • This was helpful. But, how do I run a jmx which is checked in somewhere in the git repository? I do not want the JMeter script files to be stored on the VM and need to make regular changes to it for which I need an SCM. – Suman Pathak Mar 19 '20 at 10:32
  • @SumanPathak Check [this document](https://learn.microsoft.com/en-us/azure/devops/pipelines/build/variables?view=azure-devops&tabs=yaml#system-variables), you can add the jmx files in source control(azure devops repos or github repos), then each time when the pipeline runs, the source files will be downloaded to path `System.DefaultWorkingDirectory`, `$(System.DefaultWorkingDirectory)` represents the local path where the source files exist. Now that you know the path to your source files(including those jmxs), you can easily run them locally. Hope it helps :) – LoLance Mar 20 '20 at 10:07
0

I have Use following Task in Azure CD pipeline. Azure Test Pipeline

"Run Taurus" Task is as following. Taurus Tasks Where "_WM WebClient TestArtifacts" is git/Azure Repo directory where .jmx file kept(in Code). Artifacts

Jatin Dave
  • 734
  • 1
  • 7
  • 14