azure pipelines.yml

trigger:
  - main

pool:
  vmImage: windows-latest

variables:
  LEAPWORK_PERFORMANCE_BASE_URL: 'https://your-environment.example.com'
  LEAPWORK_PERFORMANCE_TIMELINE_ID: ''
  LEAPWORK_PERFORMANCE_TIMELINE_NAME: 'Smoke baseline'
  LEAPWORK_PERFORMANCE_PROJECT_ID: ''
  LEAPWORK_PERFORMANCE_DATA_ITEM_ASSET_ID: ''
  LEAPWORK_PERFORMANCE_DATA_ITEM_NAME: 'Checkout workload'
  LEAPWORK_PERFORMANCE_ROLE: 'loadUser'
  LEAPWORK_PERFORMANCE_USER_COUNT: '50'

steps:
  - checkout: self

- powershell: |
      ./azure-devops/run-integration.ps1 \
      -BaseUrl "$(LEAPWORK_PERFORMANCE_BASE_URL)" \
      -ApiKey "$(LEAPWORK_PERFORMANCE_API_KEY)" \
      -TimelineId "$(LEAPWORK_PERFORMANCE_TIMELINE_ID)" \
      -TimelineName "$(LEAPWORK_PERFORMANCE_TIMELINE_NAME)" \
      -ProjectId "$(LEAPWORK_PERFORMANCE_PROJECT_ID)" \
      -DataItemAssetId "$(LEAPWORK_PERFORMANCE_DATA_ITEM_ASSET_ID)" \
      -DataItemName "$(LEAPWORK_PERFORMANCE_DATA_ITEM_NAME)" \
      -Role "$(LEAPWORK_PERFORMANCE_ROLE)" \
      -UserCount "$(LEAPWORK_PERFORMANCE_USER_COUNT)"
    displayName: Start Leapwork Performance run

- powershell: |
      ./azure-devops/poll-integration-status.ps1 \
      -BaseUrl "$(LEAPWORK_PERFORMANCE_BASE_URL)" \
      -ApiKey "$(LEAPWORK_PERFORMANCE_API_KEY)" \
      -RunId "$(RunId)" \
      -TrackItemIds "$(TrackItemIds)" \
      -TrackItemNames "$(TrackItemNames)" \
      -PollResultUrl "$(PollResultUrl)" \
      -ExpectedRunTime "$(ExpectedRunTime)"
    displayName: Wait for Leapwork Performance result

- task: PublishBuildArtifacts@1
    displayName: Publish Leapwork Performance reports
    condition: always()
    inputs:
      PathtoPublish: reports
      ArtifactName: leapwork-performance-reports