如何在Github上运行Jmeter脚本

xwbd5t1u  于 2022-11-09  发布在  Git
关注(0)|答案(1)|浏览(241)

有人能帮我运行我的Jmeter脚本到我们的Github吗?Jmeter的FYI我正在使用不同的插件。您的回应是非常感谢。非常感谢
这是我如何在linux box/playground上安装我的Jmeter机器

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

输出:Jmeter脚本可以在Github上运行。

cbeh67ev

cbeh67ev1#

你所说的“Jmeter脚本能够在Github上运行”是什么意思?Github是Git repository的一个(很多)实现,它只存储文件和它们的版本历史,你不能在那里“运行”任何东西。
如果你说的是Github Actions,那么就使用run关键字,把你的命令放在那里。
工作流定义示例如下:

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

另请注意,根据JMeter最佳实践,您应使用最新版本的JMeter,因此请考虑升级到JMeter 5.5JMeter Downloads页面上提供的任何最新稳定版本

相关问题