Git integration

You can integrate Git with LoadRunner Cloud enabling you to upload scripts from your Git repository.

Install and configure a Windows Git agent

The LoadRunner Cloud Git agent connects your Git repository to your LoadRunner Cloud tenant.

Prerequisites

The following are the perquisites for installing the LoadRunner Cloud Git Agent:

  • A Windows x64 operating system

  • A valid Git installation.

Install and configure the agent

Do the following to install and configure the LoadRunner Cloud Git agent:

Action How to
Download and install the agent
  1. Download the Git agent from the LoadRunner Cloud banner > Tools and Integrations > Agents area.
  2. Extract the downloaded package and run LoadRunnerCloudGitAgentSetup.exe to install the agent.
Configure the agent
  1. The Git Agent Configuration tool is automatically started when the agent installation is completed.

    To run the configuration tool manually at any time, go to Start > LoadRunner Cloud - Git Agent > right click Configure Git agent and select Run as administrator to open the LoadRunner Cloud Git Agent Configuration tool.

  2. On the General tab specify the following:
    1. An agent name.
    2. Your LoadRunner Cloud username/password or client ID/secret key. For details, see API access keys.
    3. Your tenant id.
    4. Your project id.
    5. Whether to Share this agent with other projects. Make sure that the user entered above has access to the projects that need to use this Git configuration (available from the Git Agent installer version 2021.08 and later).

      Note: Git agent sharing can only be done when initially registering an agent. If a Git agent is shared, the repositories configured on the agent are visible to all assigned projects.

  3. On the Misc tab:

    1. To use a proxy other than the one shown, enter your proxy URL.

      If your proxy requires authentication, select the Advanced tab to enter your credentials.

    2. Enter the URL of the LoadRunner Cloud server. You can copy the URL from the address bar of the browser in which you opened LoadRunner Cloud.

      For example, if the URL in the address bar of the browser is https://loadrunner-cloud.saas.microfocus.com/home/?TENANTID=208294383&projectId=1, copy the address https://loadrunner-cloud.saas.microfocus.com.

    3. Select a log level.

  4. On the Git tab:

    The Git agent enables you to configure multiple repositories and repositories with multiple branches. For each repository or branch you want to add, click to open a dialog box where you:

    1. Enter the repository URL.

      Tip: To configure credentials for a private repository, click Advanced.

    2. Click Retrieve to retrieve all the branches.

    3. Select branches from the drop-down list.

    4. Click OK.

    Note: It is recommended to configure only a small number of repositories or branches on a single Git agent. Having many repositories or branches on a single Git agent can significantly impact performance when uploading and synchronizing. If you do need to use a large number of repositories or branches, we recommend that you use multiple Git agents to support them.

Launch the agent Go to Start > LoadRunner Cloud - Git agent > Start Git agent.

Back to top

Install and configure a Docker container for a Git agent

To install a Docker container for a Git agent, do the following:

Action How to
Pull Docker image

Pull the Git agent Docker image from Docker Hub:

docker pull performancetesting/lrc_git_agent:latest

Launch a container

Launch the container in background (detached) mode using the following command:

docker run -d \
-e "STORM_TENANT=<tenant id>" \
-e "STORM_USERNAME=<username>" \
-e "STORM_PASSWORD=<password>" \
-e "STORM_PROJECT_ID=<project id>" \
-e "STORM_AGENT_NAME=<agent name>" \
-e "STORM_AGENT_CROSS_PROJECTS=<the flag to share agent across projects>" \
-e "STORM_GIT_REPO_URL=<git repository URL>" \
-e "STORM_GIT_REPO_BRANCH=<git repository branch>" \
--net=host performancetesting/lrc_git_agent

If you need to configure multiple branches or repositories, use the following command to provide details via a mounted volume:

docker run -d \
-e "STORM_TENANT=<tenant id>" \
-e "STORM_USERNAME=<username>" \
-e "STORM_PASSWORD=<password>" \
-e "STORM_PROJECT_ID=<project id>" \
-e "STORM_AGENT_NAME=<agent name>" \
-e "STORM_AGENT_CROSS_PROJECTS=<the flag to share agent across projects>" \
-v "<git agent workspace path>:/opt/gitworkspace" \
--net=host performancetesting/lrc_git_agent

Note:

  • In the <git agent workspace path> folder, add a configuration file named as config.json (see the example below). If other Git-related files such as .gitconfig or .ssh are required, add them to this folder.

  • Read, write, and execute permissions are required on the folder.

  • The target path /opt/gitworkspace is fixed. Using another path is not supported.

Configuration file

Enter the details about your repositories and branches in file “config.json”.

For example:

[
       {
             "url": "git@github.xyz.com:user/scripts.git",
             "branches": [
                    "branch1",
                    "branch2"
             ]
       },
       {
             "url": "https://user:token@github.com/user/scripts.git",
             "branches": [
                    "main"
             ]
       }
]

Environment variables

You can also pass environment variables using the --env-file command line parameter.

  • STORM_TENANT: Your Tenant ID [required]

  • STORM_USERNAME: Your LoadRunner Cloud username [required]

  • STORM_PASSWORD: Your LoadRunner Cloud password [required]

  • STORM_PROJECT_ID: Project ID (default value 1) [optional]

  • STORM_AGENT_NAME: Agent name [required]

  • STORM_AGENT_KEY: Agent key [optional]

  • STORM_AGENT_DESCRIPTION: Agent description [optional]

  • STORM_AGENT_CROSS_PROJECTS: The flag to share agent across projects [yes|no; default: no] [optional]

  • STORM_GIT_REPO_URL: Git repository URL [optional]

  • STORM_GIT_REPO_BRANCH: Git repository branch [optional]

If the agent needs to use a proxy, pass it using the https_proxy or http_proxy environment variable.

Back to top

Manage scripts in your Git repository

To manage scripts in your Git repository, select Assets > Scripts.

Do the following to add or update scripts from your Git repository to LoadRunner Cloud:

Action How to
Access the Git repository

Click and select Upload from Git to open the Git repository dialog box.

Note: For shared Git agents, if multiple users upload or synchronize scripts using the same agent simultaneously, the uploading or synchronizing time increases.

Select an agent

From the dropdown menus, select the agent, repository, and branch that connect to the script repository you want to use.

For details on managing your Git agents, see LoadRunner Cloud agents.

If you want all the scripts that are uploaded from the repository to be configured for auto sync, select the Auto Sync check box. You can also individually configure scripts for auto sync. For details, see Sync Git scripts.

Select a script

Select one or more scripts from the Git repository. Click Add.

Sync Git scripts

You can sync Git scripts both manually and automatically.

To sync Git scripts manually:

  1. Toggle the Show Git scripts only switch.

  2. Select the scripts you want to sync.

  3. Click to sync your scripts with the Git repository.

Note: When you manually sync a Git script, runtime settings configured for the script in LoadRunner Cloud are retained.

To sync Git scripts automatically:

Toggle the Auto sync switch for the scripts you want to be synced automatically.

When a change to a script is made in the repository and the script is automatically updated in LoadRunner Cloud, a message is added in the notifications area in LoadRunner Cloud.

Note: When you automatically sync a Git script, the runtime settings configured for the script in LoadRunner Cloud are retained.

Tip: To see a list and view the status of your uploads and syncs, click the Notification button in the top banner. The Notification pane provides a time stamp and other relevant information for each event. If you have new notifications, the Notification button indicates the number of unread items . To delete an upload notification, hover over it and click x.

Back to top

Troubleshooting

To troubleshoot your Git integration, see Agent troubleshooting.

Back to top