Creating DevOps JMeter CI/CD pipeline Using Taurus

Creating DevOps JMeter CI/CD pipeline Using Taurus

About JMeter

Apache JMeter is a highly versatile open-source integration testing tool. It is often used as a load testing tool for web applications, but can also be used for functional testing and for testing other types of services, such as databases.

About Taurus

Taurus is an open-source automation test framework, that can be used in particular to automate JMeter executions. Taurus can take an existing JMeter plan and define load profile and assertions through simple configuration. Taurus can export a test report in JUnit format, that can be published to an Azure DevOps pipeline.

About the JMeter extension

This extension provides the following components:

  • A JMeterInstaller task that installs JMeter along with a flexible collection of plugins
  • A TaurusInstaller task that installs Taurus on a Python 3.6+ environment
  • A TaurusRunner task that can run JMeter or other test plans using Taurus and produces test results and reports

The JMeter tool installer task acquires a specified version of JMeter from the Internet or the tools cache and prepends it to the PATH of the Azure Pipelines Agent (hosted or private). This task can be used to change the version of JMeter used in subsequent tasks. Adding this task before the TaurusRunner in a build definition ensures you are using that task with the right JMeter version.

This extension is intended to run on WindowsLinux and MacOS agents.

Pre-requiste

1.     You should have DevOps account free/paid

2.     A jmx file with some apis

3.     And repo of that jmx file in DevOps

JMeter tool installer task

  • Search for JMeter tool installer and click on Add

No alt text provided for this image

  • In the Version input, select the exact version of JMeter you want to install on the build agent. e.g. if you want to install version 5.1, enter 5.1
  • In the Plugins input, optionally enter a comma-separated list of JMeter plugins to install

Install python task

Ensure you have Python 3.6, 3.7 or 3.8 installed. Search for Use Python version and click on Add. Under Version spec, enter 3.8. Python 3.9 is reported not to work.

No alt text provided for this image

Pre-requisite to Install Taurus task

  • Ensure you run following commands by adding a cmd task, search for cmd and add that task and run these commands as these dependencies are required to be installed on machine to run Taurus otherwise error message will be displayed

pip install --upgrade wheel setuptools Cython

pip install bzt

pip install --upgrade bzt

No alt text provided for this image

Taurus tool installer task

  • Search for Taurus tool installer and click on Add

No alt text provided for this image

Taurus tool runner task

  • Search for Taurus tool runner and click on Add

No alt text provided for this image

In the Taurus Arguments enter a space-separated list of files or websites to test. The following arguments can be passed:

  • Taurus YAML definition file (recommended), which can reference a JMeter JMX file. Example:

execution:

- scenario:

   script: website-test.jmx

reporting:

- module: junit-xml

 filename: TEST-Taurus.xml

No alt text provided for this image

Yaml file link

  • And the complete yml file for this pipline is as follows

https://github.com/haideralii/Jmeter_DevOps_Pipeline_Using_Taurus/blob/main/Sample.yml

Reference link

 

 

I'm seeing the jmeter test results in a build artifact, but they don't show up in azure devops. How do you enable that feature? - task: TaurusRunner@0   inputs:     taurusConfig: |       execution:       - scenario:           script: Jmeter/FunctionalTest.jmx         concurrency: 5         iterations: 10         ramp-up: 2s              reporting:       - module: junit-xml         filename: TEST-Taurus.xml     jmeterHome: '$(JMeterInstaller.JMeterHome)'     jmeterPath: '$(JMeterInstaller.JMeterPath)'     jmeterVersion: '$(JMeterInstaller.JMeterVersion)'     outputDir: 'taurus-output'

Like
Reply

Such an amazing article :-)

Like
Reply

This will be helpful to many, Good on you!

To view or add a comment, sign in

More articles by Haider Ali

Others also viewed

Explore content categories