Testing via Azure DevOps Pipeline

BlazeMeter tests can now be executed via Azure DevOps Pipelines by using our BlazeMeter Azure DevOps Extension.

How do I install BlazeMeter Extension in Azure DevOps?

  1. Log in to Azure DevOps.
  2. Select your project.
  3. Navigate to Pipelines -> Releases.

    azure pipeline releases

  4. Click on +New. Select New Release Pipeline.

    azure new release pipeline

  5. On the Select a template screen, start with an Empty Job.

    select template empty job

  6. Click on the text 1 job, 0 task to add a new task to the stage.

    add new task

  7. Click on + to Add a task to Agent Job.

    add task agent job

  8. When you add a task to the agent job, the Add tasks screen appears on your right. Search for BlazeMeter to see the BlazeMeter Integration extension in the marketplace.
  9. Click the Get it free button.

    bzm integration free button

  10. You will now be redirected to the Azure Marketplace in a new tab.
    1. Click Get it free.
    2. Click Install to install and add the extension to your Organization.

      install bzm integration

  11. Once added, switch to your other browser tab and click the Refresh link on the Add tasks screen. You will notice that the extension is now installed and ready to be added to a task.

    bzm integration installed

How do I configure the BlazeMeter Extension to start a BlazeMeter Test?

This procedure requires that you have installed the BlazeMeter Azure DevOps Extension. Now that you have the extension installed, you can add it to a task to kick-off BlazeMeter tests.

On the Add tasks screen, search for BlazeMeter and click the Add button on the BlazeMeter Integration.

bzm integration add button

Select Tasks

You have the following options under Select Tasks:

  • Run Existing Performance Test

  • Create Performance Test

  • Create Multitest

Run Existing Performance Test

By default, Run Existing Performance Test is selected.

To run an existing test:

  1. Enter your Test URL.
    1. To find your Test URL, log in to your BlazeMeter account.
    2. Click on Tests.
    3. Select the test you wish to use.

      Test details appear.

    4. Copy the URL of that page and paste it into the Test URL text box.

      paste-test-url.png

  2. For the API Key and API Secret text box, default values will appear.
    Note: Azure DevOps supports the use of variables.
    • If you wish to create your own variables and store the API Key and API Secret values within those variables, you may leave the defaults. Refer to the next section on how to create variables in Azure DevOps.
    • Alternatively, you can clear the default values and configure the actual API Key and API Secret on the screen. For more information about key creation, see BlazeMeter API Keys to learn more about how to generate API Key and API Secret within BlazeMeter.
  3. (Optional) Define a Report Name.

  4. (Optional) For Do you want to update the test files before the test execution?, choose one of the following options:

    • No. This is the default.

    • Yes, I want to update main test files and its dependencies.

    • Yes, I want to update several test files using JSON.

  5. (Optional) Enable Show Log if you want to see a running log of the test in the console.

  6. (Optional) Enable Ignore SLA if you want the build to succeed regardless of the SLA.

  7. Click Save.

  8. Click Create Release.

  9. Your release is ready.

  10. Start your BlazeMeter test from the pipeline by clicking the Deploy button.

    bzm test deploy

 

If you want to update main test files and dependencies to Run Existing Performance Test, you choose between "Yes, I want to update main test files and its dependencies" or "Yes, I want to update several test files using JSON".

If you select Yes, I want to update main test files and its dependencies:

  1. Update the main test files by checking Update Main Test File. Then under Upload Test Script, upload the main test file.

  2. If you want to upload dependencies as well, you have to check Upload Dependencies. Then under Upload Dependent Scripts you have to upload the dependencies.

Or, if you select Yes, I want to update several test files using JSON:

Upload the JSON file with content in the following format:

{
"mainTestFile": "", // provide the main test file path
"dependency" : "" // provide the dependency file path
}

If you want to upload only the main test file, use the following syntax:

{
"mainTestFile": "${maintest file path}",
"dependency" : ""
}

If you want to upload or update the dependency file, use the following syntax:

{
"mainTestFile": "${maintest file path}",
"dependency" : "${dependency File Path}"
}

Create Performance Test

If you want to create a performance test, select Create Performance Test.

  1. For the API Key and API Secret text box, default values will appear.
    Azure DevOps supports the use of variables.
    • If you wish to create your own variables and store the API Key and API Secret values within those variables, you may leave the defaults. Refer to the next section on how to create variables in Azure DevOps.
    • Alternatively, you can clear the default values and configure the actual API Key and API Secret on the screen. For more information about how to generate API Key and API Secret within BlazeMeter, see BlazeMeterAPI keys.
  2. (Optional) Define a Report Name.
  3. For Select uploaded file type, you can choose one of the following:
    • Upload main test files and its dependencies
    • Upload several test files using JSON
    • By default, Upload main test files and its dependencies is selected.

  4. You can update main test files by checking Update Main Test File. Then, under Upload Test Script, upload the main test file.

  5. If you want to upload dependencies as well, you have to check Upload Dependencies. Then under Upload Dependent Scripts you have to upload the dependencies.

  6. Or, if you select Upload several test files using JSON:

    Upload a JSON file under Upload JSON File For Update Main Test File Or Upload Dependencies. Use the following format:
    {
    "mainTestFile": "", // provide the main test file path
    "dependency" : "" // provide the dependency file path
    }

    Or if you want to upload only main test file, use the following syntax:

    {
    "mainTestFile": "${maintest file path}",
    "dependency" : ""
    }

    If you want to upload or update dependency file, use the following syntax:

    {
    "mainTestFile": "${maintest file path}",
    "dependency" : "${dependency File Path}"
    }
  7. Specify a Test Name.
  8. Specify a Project Id.

Create Multitest

If you want to create a multi performance test, select Create Multitest.

  1. In the Test Name Input field, specify a Test Name.
  2. In the Project Id field, you have to specify a Project Id.
  3. In the Multitest File field, upload a multitest JSON file in the following format:
    {
    "multitest" : [
    {
    "url" : "", //Provide the Test Url
    "mainTestFile": "", //Provide the main test file path
    "dependency" : "", //Provide the dependency file path
    "testName": "", //Provide the performance test name
    "totalUsers" : "", //Provide the total users
    "durationMin" : "", //Provide the duration in minutes
    "rampUpTime" : "" //Provide the ramp-up time
    }
    ]
    }

Examples:

  • If you want to create new Taurus Performance test, use the following format:
    {
    "multitest" : [{
    "url" : "",
    "mainTestFile": "${mainTestFilePath}",
    "dependency" : "",
    "testName": "${testName}",
    "totalUsers" : "",
    "durationMin" : "",
    "rampUpTime" : ""
    }]
    }
  • If you want to create a new performance JMX test:

    {
    "multitest" : [{
    "url" : "",
    "mainTestFile": "${mainTestFilePath}",
    "dependency" : "",
    "testName": "${testName}",
    "totalUsers" : "${totalUser}",
    "durationMin" : "${durationMin}",
    "rampUpTime" : "${rempUpTime}"
    }]
    }
  • If you want to add an existing test:


    {
    "multitest" : [{
    "url" : "https://a.blazemeter.com/app/#/accounts/${accountID}/workspaces/${workspaceID}/projects/${projectID}/tests/${testsID}/edit",
    "mainTestFile": "",
    "dependency" : "",
    "testName": "",
    "totalUsers" : "",
    "durationMin" : "",
    "rampUpTime" : ""
    }]
    }
  • If you want to add an existing test as well as upload or update the main test file:


    {
    "multitest" : [{
    "url" : "https://a.blazemeter.com/app/#/accounts/${accountID}/workspaces/${workspaceID}/projects/${projectID}/tests/${testsID}/edit",
    "mainTestFile": "${maintest file path}",
    "dependency" : "",
    "testName": "",
    "totalUsers" : "",
    "durationMin" : "",
    "rampUpTime" : ""
    }]
    }
  • If you want to add an existing test as well as upload or update the dependency file, use the following format:
    {
    "multitest" : [{
    "url" : "https://a.blazemeter.com/app/#/accounts/${accountID}/workspaces/${workspaceID}/projects/${projectID}/tests/${testsID}/edit",
    "mainTestFile": "",
    "dependency" : "${dependency File Path}",
    "testName": "",
    "totalUsers" : "",
    "durationMin" : "",
    "rampUpTime" : ""
    }]
    }

How to get Azure File Path using PowerShell

  1. Under Add Task, search Powershell.

    powershell01.png

  2. Click Add to add Powershell in your task.
    Options appear on the right side.

    powershell02.png

  3. Under Type, select Inline.
  4. Enter your script:
    Write-Host "Working Directory Path==>"$(System.DefaultWorkingDirectory)

    powershell03.png

  5. Save the task.
  6. Create a release.

    powershell04.png

    powershell05.png

  7. Copy the path.
  8. Create the main test file path or dependency file path in the following format:
    ${workingDirectoryPath}_${gitUserName}_${repositoryName}\\${MainTestFileName}

    For example:

    {azureDirectoryPath}_{userName}_{repoName}\\{fileName or folderName}
    azureDirectoryPath = D:\\a\\r1\\a\\

Using Azure DevOps Variable groups

  1. Log in to Azure DevOps.
  2. Select your project.
  3. Navigate to Pipelines -> Library.

    pipelines library

  4. On the Variable Groups screen, select + Variable group.

    library variable groups

  5. Enter your Variable group name. For example: BlazeMeter Keys. The Description is optional.
  6. Click + Add under Variables.

    library add variables

  7. Add the two variables APIKEY and APISECRET. For more information about key creation, see BlazeMeter API Keys.
  8. Click Save.

    variables save

  9. Return to your Release pipeline by navigating to Pipelines -> Releases.
  10. Select the Pipeline you created. Click Edit.

    new release pipeline

  11. Once in edit mode, click the Variables tab and select Variable groups.

    variable groups

  12. Click Link variable group. Select the name of your variable group and click Link. Your variable group is now linked with the release pipeline. This allows you to use this variable group inside multiple releases and tasks within the pipeline.

    link variable group

Once you have set your APIKEY and APISECRET as variables, reference them within your tasks as $(APIKEY) and $(APISECRET) respectively.

Where can I view the BlazeMeter test reports?

  1. Once a release is successfully deployed, you will see a screen like below. If any failure criteria have been triggered, the task would show up as Failed.

    agent job

  2. Click on BlazeMeter Integration to view the log.

    bzm integration log

    The log displays the test Report URL at the beginning of the test execution.

  3. Navigate to that URL to view the detailed report on BlazeMeter.

    log detailed report

  4. If you enabled the Show Log checkbox in your task configuration, you see a detailed log as shown in the following sample screenshot.

    show log checkbox enabled