在CircleCI中自动执行jmx文件 [英] Automating jmx files in CircleCI

查看:146
本文介绍了在CircleCI中自动执行jmx文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有几个使用blazemeter插件记录和下载的jmx文件.

I have couple of jmx files which I recorded and downloaded using blazemeter plugin.

我想知道

  1. 如何集成到CircleCI?
  2. 如何将其设置为每天运行?

任何帮助将不胜感激.

推荐答案

  1. 添加CircleCI项目时,您可以选择多种语言:

  1. When you add a CircleCI project you have a variety of languages to choose from:

我建议将Maven(Java)用作 JMeter Maven插件是设置和使用其他 JMeter非GUI执行选项.

I would recommend going for Maven(Java) as JMeter Maven Plugin is the easiest option for setting up and using out of other JMeter non-GUI execution options.

组织您的项目结构,如下所示:

Organise your project structure as follows:

  • 您的项目
    • .circleci
      • yourproject
        • .circleci
          • config.yml
          • 测试
            • jmeter
              • test.jmx
              • test
                • jmeter
                  • test.jmx

                  确保config.yml文件的外观如下:

                  # Java Maven CircleCI 2.0 configuration file
                  #
                  # Check https://circleci.com/docs/2.0/language-java/ for more details
                  #
                  version: 2
                  jobs:
                    build:
                      docker:
                        # specify the version you desire here
                        - image: circleci/openjdk:8-jdk
                  
                        # Specify service dependencies here if necessary
                        # CircleCI maintains a library of pre-built images
                        # documented at https://circleci.com/docs/2.0/circleci-images/
                        # - image: circleci/postgres:9.4
                  
                      working_directory: ~/repo
                  
                      environment:
                        # Customize the JVM maximum heap limit
                        MAVEN_OPTS: -Xmx3200m
                  
                      steps:
                        - checkout
                  
                        # Download and cache dependencies
                        - restore_cache:
                            keys:
                            - v1-dependencies-{{ checksum "pom.xml" }}
                            # fallback to using the latest cache if no exact match is found
                            - v1-dependencies-
                  
                        - run: mvn dependency:go-offline
                  
                        - save_cache:
                            paths:
                              - ~/.m2
                            key: v1-dependencies-{{ checksum "pom.xml" }}
                  
                        # run tests!
                        - run: mvn verify
                  
                        - store_artifacts:
                            path: target/jmeter/reports
                  

                • 确保您的pom.xml外观如下:

                • Make sure your pom.xml looks like:

                  <?xml version="1.0" encoding="UTF-8"?>
                  <project xmlns="http://maven.apache.org/POM/4.0.0"
                           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                           xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
                      <modelVersion>4.0.0</modelVersion>
                      <groupId>org.jmeter</groupId>
                      <artifactId>maven</artifactId>
                      <version>1.0-SNAPSHOT</version>
                      <build>
                          <plugins>
                              <plugin>
                                  <groupId>com.lazerycode.jmeter</groupId>
                                  <artifactId>jmeter-maven-plugin</artifactId>
                                  <version>2.8.0</version>
                                  <executions>
                                      <!-- Run JMeter tests -->
                                      <execution>
                                          <id>jmeter-tests</id>
                                          <goals>
                                              <goal>jmeter</goal>
                                          </goals>
                                      </execution>
                                      <!-- Fail build on errors in test -->
                                      <execution>
                                          <id>jmeter-check-results</id>
                                          <goals>
                                              <goal>results</goal>
                                          </goals>
                                          <configuration>
                                              <generateReports>true</generateReports>
                                          </configuration>
                                      </execution>
                                  </executions>
                              </plugin>
                          </plugins>
                      </build>
                  </project>
                  

                  1. 就是这样,现在您的构建将在每次提交时触发:

                  您将可以在其中看到 HTML报告仪表板建立工件

                  You will be able to see HTML Reporting Dashboard in build artifacts

                  通过计划构建 href ="http://www.cronmaker.com/" rel ="nofollow noreferrer"> cron 之类的表达式

                  Scheduling your builds is also possible via cron-like expressions

                  这篇关于在CircleCI中自动执行jmx文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆