Introduction:
In this tutorial, we will walk through the process of using JMeter and SUPA for performance measurements, IPA for reporting and Jenkins for automation of the testing process and reporting. By the end of this tutorial, you will be able to set up the piper method in Jenkins that automates performance measurement, uses SUPA to take measurements, and uploads the results to IPA for reporting.
Prerequisites:
A basic understanding of JMeterAccess to a Jenkins server and a working piper pipelineAccess to IPA
Configuration
Get SUPA configurations
Download and Install SUPA following the steps mentioned here.Once installed, open SUPA Application.Click on Config Check the “Upload measurement result to IPA” checkbox and fill in your IPA username and password and click Next.
If a project already available under which the measurements are required to be uploaded then select “Unmanaged Projects” and find it using the dropdown, else create a new project by selecting the “Create new Unmanaged Project” button and giving it a name. Click Next.
Enter the Release in the textbox again “Select/Type Release” and press Enter. Similarly fill Scenario and Variant fields. Change Rule Set using drop down menu. You can explore the KPIs by clicking Show KPIs after selecting a Rule Set.(Note: These changes are temporary and can be changed later during configuring pipeline). Click Next.
Click Yes.
Click Next until you reach the components screen.
In this screen drag and drop the components you need in your testing. For example, here HANA and Generic client are used. Each component has to be configured separately.
Once configured, click Next until you reach end Screen.
Finally click on “Save and Quit” button to save the configuration as .properties file.
These steps will generate 2 files.
A .properties file which contains all the configuration made. This can be found at the path used during saving the configuration in previous step.
A keystore file which contains all the credentials used during configuration. This Keystore file is encrypted and referenced in the .properties file. This can be found in the user home folder (Windows: %USERPROFILE% , Linux: $HOME). More information can be found here.
The .properties file would look like:The cmid will be generated and will correspond to the Keystore file.Other configuration can be changed as per requirement.
Configure JMeter Test Plan
Download the JMeter test plan template which uses SUPA Proxy from here. (Note: Other test plan templates along with their usage can found here.)The Test Plan will look like this.
First comes a Once Only Controller which has an HTTP Request to reset the data providers. (here: “SUPA_resetDataProviders”). (Note: This section can also be used to set any thread level variable used by any subsequent threads like access_token from an authorisation http request.)Then comes Simple controller (here “API_TEST_CASE_1”) will contain “SUPA_start” (HTTP Request for starting SUPA measurement) followed by an HTTP Request (here “HTTP Request Test 1″) which calls the API. Finally another HTTP Request for stopping SUPA Measurement (“SUPA_stop”). This can be replicated to add more Test casesFinally an If Controller is used to check the number of iteration completed and is used to generate report and upload to IPA.The “User Defined Variables” section under the thread group is used to define the thread level variables which can also take values from the Jenkins Piper method.
Configure Jenkins Pipeline
sapSUPAExecuteTests piper method is used to run the performance test in a Jenkins pipeline.
This required 3 files to be present in the repository.The Keystore file generated earlier (by default named “supa.secstore.jceks”) to be present in the root of the repository.The .properties file generated earlier.The .jmx file corresponding to the JMeter Test Plan.The piper method can be used as below:
scriptType: here jmeter is used. More can be explored here.testRepository: link to the GitHub repositorytestRepositoryBranch: branch in the repository to reference and find the 3 files mentioned above.githubTokenCredentialsId: GitHub token stored as Secret Text in Jenkins Credentials store.supaConfig: relative path to .properties file from root of the test repository.testJMeterScript: relative path to .jmx file from root of the test repository.envVars: list of environment variables. All variables that are required to be propagated to jmeter test plan has to be prefixed with “J_”. (Example: J_IPA_RELEASE is being passed to jmeter test plan as IPA_RELEASE)
IPA Reporting
The reports will be uploaded to IPA server and can be consumed by logging on to the IPA Dashboard.
These results can also be downloaded as excel sheet or visualised as graphs in the IPA Dashboard.
Conclusion
By following this tutorial, you have learned how to set up a pipeline in Jenkins that automates performance testing using JMeter, captures measurements using SUPA, and uploads the results to IPA for reporting. This automated process can help streamline your performance testing efforts and provide valuable insights into the performance of your applications. Happy testing!
Resources
Performance tools Workzone PageJMeter templates and configurationsIPA FAQSUPA Documentation
Introduction:In this tutorial, we will walk through the process of using JMeter and SUPA for performance measurements, IPA for reporting and Jenkins for automation of the testing process and reporting. By the end of this tutorial, you will be able to set up the piper method in Jenkins that automates performance measurement, uses SUPA to take measurements, and uploads the results to IPA for reporting. Prerequisites: A basic understanding of JMeterAccess to a Jenkins server and a working piper pipelineAccess to IPAConfigurationGet SUPA configurationsDownload and Install SUPA following the steps mentioned here.Once installed, open SUPA Application.Click on Config Check the “Upload measurement result to IPA” checkbox and fill in your IPA username and password and click Next.If a project already available under which the measurements are required to be uploaded then select “Unmanaged Projects” and find it using the dropdown, else create a new project by selecting the “Create new Unmanaged Project” button and giving it a name. Click Next.Enter the Release in the textbox again “Select/Type Release” and press Enter. Similarly fill Scenario and Variant fields. Change Rule Set using drop down menu. You can explore the KPIs by clicking Show KPIs after selecting a Rule Set.(Note: These changes are temporary and can be changed later during configuring pipeline). Click Next.Click Yes.Click Next until you reach the components screen.In this screen drag and drop the components you need in your testing. For example, here HANA and Generic client are used. Each component has to be configured separately.Once configured, click Next until you reach end Screen.Finally click on “Save and Quit” button to save the configuration as .properties file.These steps will generate 2 files.A .properties file which contains all the configuration made. This can be found at the path used during saving the configuration in previous step.A keystore file which contains all the credentials used during configuration. This Keystore file is encrypted and referenced in the .properties file. This can be found in the user home folder (Windows: %USERPROFILE% , Linux: $HOME). More information can be found here.The .properties file would look like:The cmid will be generated and will correspond to the Keystore file.Other configuration can be changed as per requirement.Configure JMeter Test PlanDownload the JMeter test plan template which uses SUPA Proxy from here. (Note: Other test plan templates along with their usage can found here.)The Test Plan will look like this. First comes a Once Only Controller which has an HTTP Request to reset the data providers. (here: “SUPA_resetDataProviders”). (Note: This section can also be used to set any thread level variable used by any subsequent threads like access_token from an authorisation http request.)Then comes Simple controller (here “API_TEST_CASE_1”) will contain “SUPA_start” (HTTP Request for starting SUPA measurement) followed by an HTTP Request (here “HTTP Request Test 1”) which calls the API. Finally another HTTP Request for stopping SUPA Measurement (“SUPA_stop”). This can be replicated to add more Test casesFinally an If Controller is used to check the number of iteration completed and is used to generate report and upload to IPA.The “User Defined Variables” section under the thread group is used to define the thread level variables which can also take values from the Jenkins Piper method.Configure Jenkins PipelinesapSUPAExecuteTests piper method is used to run the performance test in a Jenkins pipeline.This required 3 files to be present in the repository.The Keystore file generated earlier (by default named “supa.secstore.jceks”) to be present in the root of the repository.The .properties file generated earlier.The .jmx file corresponding to the JMeter Test Plan.The piper method can be used as below: scriptType: here jmeter is used. More can be explored here.testRepository: link to the GitHub repositorytestRepositoryBranch: branch in the repository to reference and find the 3 files mentioned above.githubTokenCredentialsId: GitHub token stored as Secret Text in Jenkins Credentials store.supaConfig: relative path to .properties file from root of the test repository.testJMeterScript: relative path to .jmx file from root of the test repository.envVars: list of environment variables. All variables that are required to be propagated to jmeter test plan has to be prefixed with “J_”. (Example: J_IPA_RELEASE is being passed to jmeter test plan as IPA_RELEASE)IPA ReportingThe reports will be uploaded to IPA server and can be consumed by logging on to the IPA Dashboard.These results can also be downloaded as excel sheet or visualised as graphs in the IPA Dashboard. ConclusionBy following this tutorial, you have learned how to set up a pipeline in Jenkins that automates performance testing using JMeter, captures measurements using SUPA, and uploads the results to IPA for reporting. This automated process can help streamline your performance testing efforts and provide valuable insights into the performance of your applications. Happy testing!ResourcessapSUPAExecuteTestsPerformance tools Workzone PageJMeter templates and configurationsIPA FAQSUPA Documentation Read More Technology Blogs by SAP articles
#SAP
#SAPTechnologyblog