Git Integration with LoadRunner Cloud

by Micro Focus Employee in Application Delivery Management

Very few developers would write code without using a version control system tool to keep track of any changes that they do, so why would performance testing scripts be treated differently? Not only would it add the benefits of being able to track any changes done to the test scripts, but also making sure that the latest version of it is always used for your performance testing.

There are a number of version control systems on the market, and one of the more popular one is Git, which is free and open source, and comes with the benefit that it can easily be integrated with LoadRunner Cloud. Even though many of our customers are using Vugen as their scripting tool, using Git, as outlined in this blog, can be used for any type of script. That means that if you are using JMeter or Gatling scripts, those can also be version controlled and synched with LoadRunner Cloud.

Download and configuration of the Git Agent

Assuming that Git is already installed on the local machine, the first thing that is needed to get going, is to download the Git Agent from your LoadRunner Cloud tenant, and it is available under the Tools and Integrations icon.

Once installed, the details of the LoadRunner Cloud tenant are required. It is recommended to use an API Access Key and to make sure that the user that the access key is based upon, have access to the different projects.

The Project Id entered will decide in which project the Git Agent will initially be registered, and the project id can be seen in the URL of LoadRunner Cloud. It is also possible to share the Git Agent with multiple projects, and this is done from the LoadRunner Cloud Management area, under Assets for the project where the agent was initially registered, and the agent can there be shared to other projects.

Connect the Git Agent to a repository

As an initial example, there is a public repository on GitHub that can be used for testing, which contains multiple scripts in separate folders. This is done by entering the URL to the repository (https://github.com/weisun10/testgit.git) on the Git tab in the agent.

When connecting to the repository, the branch of the repository must also be selected, and in this example, the master branch is used.

Once the configuration has been saved and the connection to LoadRunner Cloud is successfully tested, it is time to exit the Configuration and start the Git Agent. The Git Agent output window will then show the log entries of the agent starting up and after a short time, the Git Agent be listed as Connected in LoadRunner Cloud, where it is also displayed to which repository the agent is connected to and the status of it.

… and that’s it! It is now possible to upload scripts directly from Git to LoadRunner Cloud. Simply select the dropdown on the Upload button and select “Upload from Git” and it is then possible to select any number of scripts from the repository and have them synched to LoadRunner Cloud.

Setup a repository with your own scripts

Seeing how easy it was to set this up, it is now time create your own Git repository, where the scripts that are used can be stored. This is done by using Git on the local machine, which supports both CLI and GUI, and the first thing is to select an existing local directory as the repository.

Doing so will then create a hidden folder (.git) in that directory, which contains the Git configuration for this repository. My selected directory contains three scripts in three separate folders.

It is also possible to add an additional file named “.gitignore” to the repository, which is a text file containing all the types of files that should not be part of the synched scripts, like log files and other temporary files that are not required for the running of the script. The below is just an example of a “.gitignore” file, so if you are looking at using your own, you will need to edit it according to your own needs.

Use your own repository on GitHub

While an example repository on GitHub was used previously, it is now time to use your own repository. The details of it is then used in the local Git client when going through the motions of Staging, Commit and Push the local repository onto your own repository on GitHub.

Since the LoadRunner Cloud Git Agent is still pointing at the example repository on GitHub, changing repository is done by opening the Git Agent Configuration again, then on the Git tab delete the previous repository and add the new repository located on GitHub. Once Saved and Tested, the scripts can now be synched to LoadRunner Cloud, once he Git Agent has been restarted.

Add and synch scripts to LoadRunner Cloud

When first adding your scripts to LoadRunner Cloud from Git, there is the options of manually synching the scripts or having then synched automatically. The manual option might be good if the scripts are still being developed and they are not yet finished to be used in a test, but there is still a need to test the script from LoadRunner Cloud. So even if the script in the repository is updated, it won’t be synched over until the “Synch Selected” button is clicked for the script in LoadRunner Cloud.

But by selecting to use the auto-synch option, then any time a change is made to the script in the repository, the script will then be synched over to LoadRunner Cloud within a minute or so. Once the script is ready for production use, then by using auto-synch, any further updates to the script are automatically synched over to LoadRunner Cloud, making sure that the latest version of the script is always used. 

Links and further information

Have technical questions about LoadRunner Cloud? Visit the LoadRunner Cloud Discussion Forum. 

Keep up with the latest Tips & Info about LoadRunner Cloud. 

Do you have an Idea or Product Enhancement Request about LoadRunner Cloud?  Submit it in the Idea Exchange. 

We’d love to hear your thoughts on this blog. Log in and comment below. 

Labels:

Performance Testing
Anonymous