DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

The software you build is only as secure as the code that powers it. Learn how malicious code creeps into your software supply chain.

Apache Cassandra combines the benefits of major NoSQL databases to support data management needs not covered by traditional RDBMS vendors.

Generative AI has transformed nearly every industry. How can you leverage GenAI to improve your productivity and efficiency?

Modernize your data layer. Learn how to design cloud-native database architectures to meet the evolving demands of AI and GenAI workloads.

Related

  • Optimizing GitHub Access Management for Enterprises: Enhancing Security, Scalability, and Continuity with Jenkins GitHub App Authentication and Load Balancing
  • CI/CD: 5 Simple Steps To Deploy a Mule 4 Application in CloudHub Using Jenkins and GitHub
  • Travis CI vs Jenkins: Which CI/CD Tool Is Right For You?
  • Code Reviews: Building an AI-Powered GitHub Integration

Trending

  • How To Introduce a New API Quickly Using Quarkus and ChatGPT
  • Docker Base Images Demystified: A Practical Guide
  • Why Database Migrations Take Months and How to Speed Them Up
  • Immutable Secrets Management: A Zero-Trust Approach to Sensitive Data in Containers
  1. DZone
  2. Testing, Deployment, and Maintenance
  3. Deployment
  4. How to Keep BlazeMeter Test Data Updated With GitHub and Jenkins

How to Keep BlazeMeter Test Data Updated With GitHub and Jenkins

Learn how the BlazeMeter Jenkins plugin lets you connect to GitHub to automatically keep your test data up to date in this tutorial.

By 
Artem Fedorov user avatar
Artem Fedorov
·
Jul. 31, 18 · Tutorial
Likes (1)
Comment
Save
Tweet
Share
5.3K Views

Join the DZone community and get the full member experience.

Join For Free

In this blog post, I'll explain how you can use GitHub and Jenkins so your BlazeMeter performance test automatically runs the most updated test data. This is an easy way to ensure your tests are always accurate and complete.

This new feature in the BlazeMeter Jenkins plugin lets you update many types of test data. Test data can be executable script files from any tool BlazeMeter supports: jmx, yml, Scala, etc. Or, configuration or data storage files for the main scripts, like CSVs and properties files.

To do this, we will set up Jenkins CI to run an automated test in BlazeMeter. We will use GitHub for storing the test configuration and data for this test (e.g. csv file). When Jenkins starts a job, it will go to our GitHub repository and update the test files in BlazeMeter. As a result, our tests will always have the newest test data. I will show you how to run a Taurus performance test, but you can use any of the testing tools BlazeMeter supports: Apache JMeter™, Gatling, Taurus, etc.

Let's get started.

As a first step, let's create a test scenario in Taurus. I chose Taurus because it has a simple YAML config file that is very easy for test scenario configuration. But, you can also use tools like JMeter.

Let's take the simplest scenario from the Taurus website:


execution:
- concurrency: 30
  ramp-up: 1m
  hold-for: 5m
  scenario: quick-test

scenarios:
  quick-test:
    requests:
    - http://blazedemo.com

This scenario will open the http://blazedemo.com page while gradually increasing the number of concurrent virtual users from 0 to 30 within a minute. Then, the scenario with 30 users will run for 5 minutes.

This is the main page, which has a simple form. Let's add a POST request to our test plan.

execution:
- concurrency: 30
  ramp-up: 1m
  hold-for: 5m
  scenario: quick-test

scenarios:
  quick-test:
    requests:
    - http://blazedemo.com
    - url: http://blazedemo.com/reserve.php
      method: POST
      headers:
        Content-Type: application/x-www-form-urlencoded
      body:
        fromPort: Paris
        toPort: Rome

The values "Paris" and "Rome" are constants, which will be changed in the future. So, let's turn them into variables, and store all possible values in a CSV file (data.csv), from which we will want to update data:

execution:
- concurrency: 30
  ramp-up: 1m
  hold-for: 5m
  scenario: quick-test

scenarios:
  quick-test:
    requests:
    - http://blazedemo.com
    - url: http://blazedemo.com/reserve.php
      method: POST
      headers:
        Content-Type: application/x-www-form-urlencoded
      body:
        fromPort: ${from}
        toPort: ${to}

    data-sources:
    - data.csv

Data from data.csv file:

from,to
Paris,Buenos Aires
Philadelphia,Rome
Boston,London
Portland,Berlin
San Diego,New York
Mexico City,Dublin
São Paolo,Cairo

The next step is to create the Taurus test in a.blazemeter.com.

1. Click on the button "Create Test."

2. Select the "Taurus Test" type.

3. Upload your *.yml and *.csv files to the test.

Now your test is ready for execution in BlazeMeter.

1. Create a repository.

2. Add the *.yml and *.csv files to your repository.

In my case, I have a test.yml file in the yml folder and a data.csv file in the csv folder.

This is the last step. Create and set up a Jenkins job that will get these files from GitHub and update them in BlazeMeter before running the test.

1. Open Jenkins and create a FreeStyleProject.

2. In "Source Code Management," select "Git" and paste your repository URL.

In "Build," add a BlazeMeter build step. Select the test that you already created and write the paths to the files. The path should be relative to "JOB_WORKSPACE/BUILD_NUMBER/."

I know, that "Source Code Management" will clone my repository to JOB_WORKSPACE/ so I start my path from '..', which means the parent directory.

Save your job and run. Every time your Jenkins job is run, Jenkins will close the Git repository to the Jenkins workspace, the BlazeMeter Jenkins plugin will upload the files the user selected in the job configuration, and the BlazeMeter Jenkins plugin will run the BlazeMeter test.

The updated BlazeMeter test:

That's it! Your BlazeMeter test will now always contain the most updated data. You can get a free BlazeMeter demo from one of our performance engineers.

Test data Jenkins (software) GitHub

Published at DZone with permission of Artem Fedorov, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • Optimizing GitHub Access Management for Enterprises: Enhancing Security, Scalability, and Continuity with Jenkins GitHub App Authentication and Load Balancing
  • CI/CD: 5 Simple Steps To Deploy a Mule 4 Application in CloudHub Using Jenkins and GitHub
  • Travis CI vs Jenkins: Which CI/CD Tool Is Right For You?
  • Code Reviews: Building an AI-Powered GitHub Integration

Partner Resources

×

Comments

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends: