在构建管道中的Azure DevOps上运行分布式JMeter测试

时间:2019-03-23 22:08:03

标签: azure jmeter azure-devops performance-testing jmeter-plugins

我需要使用JMeter在Azure中进行分布式负载测试。

我不知道如何进行:

  • 使用类似于one的方法
  • 使用JMeter核心分布式测试,我需要设置1个主节点和从节点,但是由于需要启动多个虚拟机,因此我看不到如何在管道中完成

2 个答案:

答案 0 :(得分:1)

在Azure管道中使用JMeter的最佳方法之一是将性能测试用例配置为maven项目。因此,您无需使用已弃用的基于云的Apache JMeter负载测试任务。

有一个现有的插件可以帮助您解决此问题:

<plugins>
                <plugin>
                    <groupId>com.lazerycode.jmeter</groupId>
                    <artifactId>jmeter-maven-plugin</artifactId>
                    <version>2.9.0</version>
                    <executions>
                        <execution>
                            <id>jmeter-tests</id>
                            <phase>verify</phase>
                            <goals>
                                <goal>jmeter</goal>
                            </goals>
                        </execution>
                    </executions>
                    <configuration>
                        <resultsFileFormat>xml</resultsFileFormat>
                        <propertiesUser>
                            <hostname>${test.hostname}</hostname>
                            <env>${test.env}</env>
                        </propertiesUser>
                    </configuration>
                </plugin>
            </plugins>

更多信息可在此处获取:

  1. https://github.com/jmeter-maven-plugin/jmeter-maven-plugin/wiki/Basic-Configuration
  2. https://github.com/jmeter-maven-plugin/jmeter-maven-plugin/wiki/Remote-Server-Configuration

我已经使用此插件一年了,它提供了惊人的支持。

我正在使用Terraform使用外壳程序脚本在管道中启动/销毁新的VM机器。

答案 1 :(得分:0)

您知道Cloud-based Apache JMeter Load Test task

# Cloud-based Apache JMeter Load Test
# Runs the Apache JMeter load test in cloud
- task: ApacheJMeterLoadTest@1
  inputs:
    #connectedServiceName: # Optional
    testDrop: 
    loadTest: 'jmeter.jmx' 
    agentCount: '2' 
    #runDuration: '60' # Options: 60, 120, 180, 240, 300
    #geoLocation: 'Default' # Optional. Options: default, australia East, australia Southeast, brazil South, central India, central US, east Asia, east US 2, east US, japan East, japan West, north Central US, north Europe, south Central US, south India, southeast Asia, west Europe, west US
    #machineType: '0' # Optional. Options: 0, 2

如果要手动完成所有操作,则可以使用Azure CLIREST API创建VM,完成后可以下载JMeter安装和configure it according to your test scenario

相关问题