Home > Mobile >  How to run Jmeter script on Github
How to run Jmeter script on Github

Time:08-12

Could somebody help me run my Jmeter script to our Github? FYI the Jmeter I'm using different plugins. Your response is highly appreciated. Thank you so much

This is how I install my Jmeter machine on linux box/playground

sudo apt-get update
sudo apt install curl -y
sudo apt install -y default-jdk
sudo curl -O https://archive.apache.org/dist/jmeter/binaries/apache-jmeter-5.3.tgz
sudo tar -xvf apache-jmeter-5.3.tgz

cd apache-jmeter-5.3/lib
sudo curl -O https://repo1.maven.org/maven2/kg/apc/cmdrunner/2.2.1/cmdrunner-2.2.1.jar

cd ext/
sudo curl -O https://repo1.maven.org/maven2/kg/apc/jmeter-plugins-manager/1.6/jmeter-plugins-manager-1.6.jar

cd ..
sudo java  -jar cmdrunner-2.2.1.jar --tool org.jmeterplugins.repository.PluginManagerCMD install-all-except jpgc-hadoop,jpgc-oauth,ulp-jmeter-autocorrelator-plugin,ulp-jmeter-videostreaming-plugin,ulp-jmeter-gwt-plugin,tilln-iso8583

Output: Jmeter script able to run on Github.

CodePudding user response:

What do you mean by "Jmeter script able to run on Github"? Github is one (of many) implementations of a Git repository, it only stores files and their version history, you cannot "run" anything there.

If you're talking about Github Actions then just use run keyword and put your commands there.

Example workflow definition would be something like:

name: CI

on:
  push:
    branches: [ "main" ]
  pull_request:
    branches: [ "main" ]

  workflow_dispatch:

jobs:

  build:

    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v3

      - name: setup-jmeter
        run: |
          sudo apt-get update
          sudo apt install curl -y
          sudo apt install -y default-jdk
          sudo curl -O https://archive.apache.org/dist/jmeter/binaries/apache-jmeter-5.3.tgz 
          sudo tar -xvf apache-jmeter-5.3.tgz
          cd $GITHUB_WORKSPACE/apache-jmeter-5.3/lib && sudo curl -O https://repo1.maven.org/maven2/kg/apc/cmdrunner/2.2.1/cmdrunner-2.2.1.jar
          cd $GITHUB_WORKSPACE/apache-jmeter-5.3/lib/ext && sudo curl -O https://repo1.maven.org/maven2/kg/apc/jmeter-plugins-manager/1.6/jmeter-plugins-manager-1.6.jar
          cd $GITHUB_WORKSPACE/apache-jmeter-5.3/lib && sudo java -jar cmdrunner-2.2.1.jar --tool org.jmeterplugins.repository.PluginManagerCMD install-all-except jpgc-hadoop,jpgc-oauth,ulp-jmeter-autocorrelator-plugin,ulp-jmeter-videostreaming-plugin,ulp-jmeter-gwt-plugin,tilln-iso8583

      - name: run-jmeter-test
        run: |
        $GITHUB_WORKSPACE/apache-jmeter-5.3/bin/./jmeter.sh -n -t test.jmx -l result.jtl

Also be informed that according to JMeter Best Practices you should be using the latest version of JMeter so consider upgrading to JMeter 5.5 or whatever is the latest stable version which is available at JMeter Downloads page

  • Related