'How to run Jmeter Script in bitbucket Pipeline

Im quite new to bitbucket pipeline and i was looking into how to run my jmeter script in the pipeline without using Jenkins or bamboo. I have created a bitbucket-pipelines.yml file and got an issue "jmeter: command not found" here is the script that i created.

pipelines:
  branches:
    master:
      - step:
          name: Jmeter
          script:
           - jmeter run Observability_Test.jmx


Solution 1:[1]

If jmeter command is not found you need to install JMeter prior to trying to launch the test.

Example configuration:

   pipelines:
      default:
       - step:
          script: 
           - apt-get update && apt-get install --no-install-recommends -y openjdk-11-jre wget
           - cd /opt && wget https://archive.apache.org/dist/jmeter/binaries/apache-jmeter-5.4.3.tgz && tar xf apache-jmeter-5.4.3.tgz
           - cd apache-jmeter-5.4.3/bin && ./jmeter -n -t /path/to/Observability_Test.jmx
           - cd apache-jmeter-5.4.3/bin && ./jmeter -n -t /path/to/Observability_Test.jmx

More information: Tips for scripting tasks with Bitbucket Pipelines

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Dmitri T