Home

Awesome

<!--- Copyright © 2017-2018 Anton Serputko. Contacts: serputko.a@gmail.com Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -->

Performance testing framework

This framework could be used both for backend load testing with Apache Jmeter and frontend load test with sitespeed.io + webpagetest private instance.

Custom Grafana dashboards features:

Dashboard demo

Tests comparison

Getting Started

Framework consists of next services:

Framework architecture:

Prerequisites

To run framework install docker: https://docs.docker.com/engine/installation/.

You should be able to run docker run hello-world with no errors.

For Windows:

Installing

  1. Clone this repository git clone https://github.com/serputko/performance-testing-framework.git
  2. open performance-testing-framework dir

For Backend testing:

  1. (optional) if you want to update existing services
docker-compose pull
docker-compose build 
docker-compose down
  1. docker-compose up -d

For Frontend + Backend testing

  1. (optional) if you want to update existing services
docker-compose -f docker-compose-with-frontend.yml pull
docker-compose -f docker-compose-with-frontend.yml build
docker-compose -f docker-compose-with-frontend.yml down
  1. docker-compose -f docker-compose-with-frontend.yml up -d

All containers should be up and running

Services endpoints

Jenkins

Login to Jenkins with admin/admin(could be changed in docker-compose file) By default jenkins consists of 2 jobs:

Running demo jmeter scenario with BackendJob

To run jmeter demo script: Open BackendJob -> Build with Parameters -> Set build parameters -> Select scenario -> Build

This job will start jmeter docker container and execute demo_scenario.jmx jmeter scenario

To open demo_scenario in local instance of Jmeter please install Plugin Manager https://jmeter-plugins.org/wiki/PluginsManager/. It will automatically install all required plugins.

Making your jmeter script compatible with framework

Create jmeter test scenario

Modify your jmeter scenario to work with framework, add:

Grafana

Start demo_scenario.jmx test with jenkins Backend job

Real time results should be available in grafana Open 'Load test monitoring' dashboard. Dashboard contains visualizations based on data from influxdb.

Available metrics

Dashboard has multiple rows with different metrics

Timerange

All values in visualizations are calculated according to selected time range. Default timerange is last 15 min with 10 sec refresh. Timerange could be set in timepicker or selected on any graph.

Templating

Graphs and series on dashboard are displayed dynamically according to variables selected

Failed requests details

If JSR223 listener was added to scenario than detailed traces for failed requests can be viewed in 'Error details' table. Example of failed request:

Number of samples in transaction : 1, number of failing samples : 1
Login; Response message: Unauthorized;
Status code: 401;
Number of failed assertions: 1

Sample Failed: Login
Started at: Mon Jul 30 11:54:59 UTC 2018
Finished at: Mon Jul 30 11:54:59 UTC 2018
Request:
{
    "code": "1234567"
}
REQUEST DATA
URL: http://demo-server.com/login
Request headers:
Content-Type: application/json

Response: 
Unauthorized
Response code:401

Response data:
{
   "Error message": "Incorrect password or confirmation code entered. Please try again."
}

Assertion results:
Number of failed assertions: 1
Response Assertion Failed; 
Failure Message: Test failed: text expected to contain /success/;

Test runs comparison

Tests comparison is done using scripted js dashboard. It could be accessed at http://127.0.0.1:8857/dashboard/script/compare_tests.js

FrontendJob

To run frontend test: Open FrontendJob -> Build with Parameters -> Set build parameters -> Build

This job will start sitespeed.io docker container and run test with parameters using WebPageTest private instance

Frontend test deliverables: