Automating jmx files in CircleCI

前端 未结 1 597
面向向阳花
面向向阳花 2021-01-28 05:57

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

I would like to know

  1. How Can I integrate to CircleCI?
  2. How can
1条回答
  •  攒了一身酷
    2021-01-28 06:57

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

      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.

    2. Organise your project structure as follows:

      • yourproject
        • .circleci
          • config.yml
        • src
          • test
            • jmeter
              • test.jmx
        • pom.xml
    3. Make sure that config.yml file looks as follows:

      # 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
      
    4. Make sure your pom.xml looks like:

      
      
          4.0.0
          org.jmeter
          maven
          1.0-SNAPSHOT
          
              
                  
                      com.lazerycode.jmeter
                      jmeter-maven-plugin
                      2.8.0
                      
                          
                          
                              jmeter-tests
                              
                                  jmeter
                              
                          
                          
                          
                              jmeter-check-results
                              
                                  results
                              
                              
                                  true
                              
                          
                      
                  
              
          
      
      
      1. That's it, now your build will be triggered on each commit:

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

    6. Scheduling your builds is also possible via cron-like expressions

    0 讨论(0)
提交回复
热议问题