How to create a Performance test
How to performance test¶
In this how to guide you will learn how to create, deploy, and run a performance test for a Platform service (Web App, User Interface etc) for your team.
Prerequisites¶
Before adding performance tests for your service, you will need to ensure that:
Overview¶
By completing this guide, you will have completed these actions:
- Learned how to add a performance test for your service.
- Learned how to run a performance test locally.
- How to customize your pipeline to run performance tests for different env.
Guide¶
Note
Every pipeline run includes steps to run varoious tests pre deployment and post deployment. These tests may include unit, integration, acceptance, performance, accessibilty etc as long as they are defined for the service.
The pipeline will check for the existence of the file test\performance\docker-compose.jmeter.yaml
to determine if performance tests have been defined.
How to add a performance test for your service?¶
The Performance Test scripts should be added to the test\performance
folder in the GitHub repository of the service. Refer to the ffc-demo-web example. This folder should contain a docker-compose.jmeter.yaml
file is used to build up the docker containers required to execute the tests. As a minimum, this will create a JMeter container and optionally create Selenium Grid containers. Using BrowserStack is preferred to running the tests using Selenium Grid hosted in Docker containers because you get better performance and scalability as the test load increases.
Requirments for local development¶
- Docker Desktop 2.2.0.3 (42716) or higher
- JMeter v5.5 or above
How to run a performance test locally?¶
Executre the above commands in bash or PowerShell
How to parameterising your Tests¶
You can modify the number of virtual users, loop count and ramp-up duration by changing the settings in the file perf-test.properties.
You can then reference these variables in your JMeter Script.
How to customize your pipeline to run performance tests?¶
You can customize the environments where you would like to run specific features or scenarios of performance test
if not defined, the pipeline will run with following default settings
Please refer ffc-demo-web pipeline:How to disable test?¶
if you want to disable the test for any reason please refer Disable Test