using jenkins and jmeter to build a scalable load testing solution

33
Hier soll der Titel rein Non-Functional Testing www.qs-tag.de Organizer: imbus AG www.qs-tag.de Using Jenkins and Jmeter to build a scalable Load Testing solution Ruslan Strazhnyk CipherHealth LLC

Upload: ruslan-strazhnyk

Post on 25-Jan-2017

1.047 views

Category:

Technology


1 download

TRANSCRIPT

Page 1: Using Jenkins and Jmeter to build a scalable Load Testing solution

Hier soll der Titel reinNon-Functional Testing

www.qs-tag.de

Organizer: imbus AG www.qs-tag.de

Using Jenkins and Jmeter to build a scalable Load Testing solution

Ruslan StrazhnykCipherHealth LLC

Page 2: Using Jenkins and Jmeter to build a scalable Load Testing solution

About me

• Ruslan Strazhnyk – Lviv(Lemberg), Ukraine

– Rich experience in creating and supporting Test Automation Frameworks and infrastructure – Front-end, Back-end, API, Performance Testing

– Languages: Ruby, Python, Java, JS– Experience with cloud services– Technologies: Selenium, REST, Jenkins, JMeter,

Openstack

Page 3: Using Jenkins and Jmeter to build a scalable Load Testing solution

Where I work

https://cipherhealth.com/

Page 4: Using Jenkins and Jmeter to build a scalable Load Testing solution

Agenda

• Jmeter. Test Recording and Playback.

• Composing Jmeter maven project for Jenkins. Upload to Github.

• Tuning Jenkins and executing the build.

• Results Analysis

Page 5: Using Jenkins and Jmeter to build a scalable Load Testing solution

Load Testing

Page 6: Using Jenkins and Jmeter to build a scalable Load Testing solution

Performance Testing tools

What tools have you used for Performance-Testing?

What parameters were you measuring?

What was your most complex scenario?

Page 7: Using Jenkins and Jmeter to build a scalable Load Testing solution

Performance Testing Classic Scheme

• Identify Test Environment

• Identify Performance Acceptance Criteria

• Plan and Design Tests

• Configure Test Environment

• Implement Test Design

• Execute Test

• Analyze Results

Page 8: Using Jenkins and Jmeter to build a scalable Load Testing solution
Page 9: Using Jenkins and Jmeter to build a scalable Load Testing solution

JMeter

• HTTP(S) coverage• REST coverage• Portability and 100% Java purity• Full multi-threading ability• GUI designed for Composing Test

Plans/Debug• Data visualization plug-ins• Unlimited testing capabilities using plug-ins

Page 10: Using Jenkins and Jmeter to build a scalable Load Testing solution

JMeter

JMeter Test Recording Demo

Page 11: Using Jenkins and Jmeter to build a scalable Load Testing solution

Prepare Jmeter test for non-UI mode.

• Download JMeter from official page.• Unzip it to specified folder.• Download JMeterPlugins-standard from

additional Plug-ins page. • Extract archive contents to JMeter installation

directory.• Restart Jmeter to be able to add new plug-

ins.

Page 12: Using Jenkins and Jmeter to build a scalable Load Testing solution

Prepare Jmeter test for integration.

Now add these Listeners to the test plan Right-click via Add > Listener• jp@gc – Console Status Logger• jp@gc – Active Threads Over Time• jp@gc – Response Over Time• jp@gc – Transactions per Second• View Results Tree

Page 13: Using Jenkins and Jmeter to build a scalable Load Testing solution

Prepare Jmeter test for integration.

Set these options in Thread Group, this would be used by maven later

Page 14: Using Jenkins and Jmeter to build a scalable Load Testing solution

Maven

Yiddish word meaning accumulator of knowledge

Maven’s Objectives:• Making the build process easy• Providing a uniform building system• Providing quality project information• Providing guidelines for best practices• Allowing transparent migration to new features

Maven plug-ins used:• clean – cleans after the build• compiler – compiles Java sources• install – install built artifact into local repository• more plugins - https://maven.apache.org/plugins/index.html

Page 15: Using Jenkins and Jmeter to build a scalable Load Testing solution

Preparing Maven project

JMeter tests are integrated into a maven build and automatically generate graphs from the test results using the jmeter plugin CMDRunner.

“jmeter-maven-plugin” is used to integrate jmeter in the maven build. To generate graphs from the jmeter results, the “jmeter-graph-maven-plugin” is used.

Page 16: Using Jenkins and Jmeter to build a scalable Load Testing solution

Preparing Maven projectMaven config file pom.xml is already parameterized

for Jenkins build

Jmeter tests are simply stored in the directory /src/test/jmeter

Page 17: Using Jenkins and Jmeter to build a scalable Load Testing solution

Maven

Preparing maven project Demo

Page 18: Using Jenkins and Jmeter to build a scalable Load Testing solution

Jenkins

• Pre-installed Jenkins VM (Ubuntu 14.04)• What’s in pre-configured VM:

– Installed Java-JRE for maven and Jenkins– Installed maven 3.3, github, vim– Configured Github account– Installed Intellij Idea

• Install additional JMeter-Performance plug-in and GitHub plug-in

Page 19: Using Jenkins and Jmeter to build a scalable Load Testing solution

Build Jenkins job

• Set parameterization values– THREAD COUNT– LOOP COUNT

• Set Github repository• Set build trigger (SNAPSHOT dependancy)• Set build step

– Root POM– Goals and options

• Publish Performance Test Result report

Page 20: Using Jenkins and Jmeter to build a scalable Load Testing solution

Jenkins Performance plugin• allows you to capture reports from JMeter and JUnit . • Jenkins will generate graphic charts with the trend report of

performance and robustness.• it includes the feature of setting the final build status as good,

unstable or failed, based on the reported error percentage.• https://wiki.jenkins-ci.org/display/JENKINS/Performance+Plugin

Page 21: Using Jenkins and Jmeter to build a scalable Load Testing solution

HTML Report Auto-generation

Page 22: Using Jenkins and Jmeter to build a scalable Load Testing solution

HTML Report Auto-generation

Basic graphs are already generated with html

Page 23: Using Jenkins and Jmeter to build a scalable Load Testing solution

jmeter-graph-maven-plugin

Page 24: Using Jenkins and Jmeter to build a scalable Load Testing solution

Batteries Included: Ability to Generate More Graphs

How to add new graph

Page 25: Using Jenkins and Jmeter to build a scalable Load Testing solution

Batteries Included: Ability to Generate More Graphs

With the simple manipulation, it is possible to generate up to 11 Graphical Metrics for different KPI’s

Page 26: Using Jenkins and Jmeter to build a scalable Load Testing solution

Response Times Distribution

This graph will display the response time distribution of the test. The X axis shows the response times grouped by interval, and the Y axis the number of samples which are contained in each interval.

Page 27: Using Jenkins and Jmeter to build a scalable Load Testing solution

Response Codes per second

This graph will display the response code per second returned during the test.

Page 28: Using Jenkins and Jmeter to build a scalable Load Testing solution

More beautiful graphshttp://jmeter-plugins.org/wiki/Start/

Page 29: Using Jenkins and Jmeter to build a scalable Load Testing solution

What’s next?

Generate pom.xml files for the project with Rubyhttp://www.nokogiri.org/

Ruby-jmeter – generate jmx scenario programaticallyhttps://github.com/flood-io/ruby-jmeter

Page 30: Using Jenkins and Jmeter to build a scalable Load Testing solution

Summary

• Up-sides:– Building working solution from OpenSource

components (no license payment, fees etc.)– Full customization– Integration capabilities

• Down-sides:– Experience needed to set-up and work with it– Needs dive-in to maven to be able to customize

builds

Page 31: Using Jenkins and Jmeter to build a scalable Load Testing solution

External Resources

• Jmeter http://jmeter.apache.org/• Jmeter plug-ins http://jmeter-plugins.org• Jenkins http://jenkins-ci.org• https://maven.apache.org/guides/introduction/introduction-to-t

he-pom.html

• https://lincolnloop.com/blog/load-testing-jmeter-part-1-getting-started/

• https://wiki.opendaylight.org/view/Install_On_Ubuntu_14.04• https://www.ubik-ingenierie.com/blog/automatically-

generating-nice-graphs-at-end-of-your-load-test-with-apache-jmeter-and-jmeter-plugins/

• https://github.com/smarigowda/jmeter-maven-example

Page 32: Using Jenkins and Jmeter to build a scalable Load Testing solution
Page 33: Using Jenkins and Jmeter to build a scalable Load Testing solution

Questions and Answers

My contactsSkype - ruslanstrazhnykTwitter - @strazhnykE-mail – [email protected]