Azure Release Pipeline - How do you archive your test reports?

Experiences, small talk, and other automation gossip.
Posts: 2
Joined: Tue Jul 19, 2022 2:41 pm

Azure Release Pipeline - How do you archive your test reports?

Post by uha » Tue Jul 19, 2022 3:59 pm

Dear all,
hope this is the correct area to start this thread!

I am looking for a best practice or ideas to archive test reports when using Azure release pipelines!

Some background information:
  • I have created a build pipeline which builds the Ranorex solution and creates the artifact.
  • This artifact is used in different release pipelines to run the UI tests, because I want to run different test configurations on different systems.
Some thoughts:
  • I could store the reports on a network drive or in Azure Storage - but do you have better ideas?
  • The Azure Pipeline Integration documentation ( ... -pipeline/) uses a build pipeline and stores the reports as an artifact. I like that the reports (artifact) are directly linked with the build, because everything is traceable in the future. But I want to have build and release Pipelines sperated.

:?: How do you manage/archive your test results?
:idea: Any idea, thought, etc. ... will be apreciated!

Thanks in advance!

User avatar
Ranorex Guru
Ranorex Guru
Posts: 7469
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Azure Release Pipeline - How do you archive your test reports?

Post by odklizec » Mon Aug 08, 2022 11:14 am


Here is the piece of code I'm using to publish test results and attaching report files in test summary...

Code: Select all

  - task: [email protected]
    displayName: Publish test results 
    continueOnError: true
      testResultsFormat: 'JUnit'
      testResultsFiles: '**/unpacked/RXReport_*_build-*_*.rxlog.junit.xml'
      searchFolder: '$(System.DefaultWorkingDirectory)/Reports'
      mergeTestResults: true
      testRunTitle: 'QA UI (Ranorex) Test Results'
  - task: [email protected]
    displayName: Attach Ranorex report to test summary
    continueOnError: true
      SYSTEM_ACCESSTOKEN: $(System.AccessToken)
      targetType: 'inline'
      script: |
        $AzureDevOpsAuthenicationHeader = @{Authorization = "Bearer $env:SYSTEM_ACCESSTOKEN"}
        # Build Id
        Write-Host "buildID: $(Build.BuildId)"
        $url = '$(Build.BuildId)'
        $response = Invoke-RestMethod -Uri $url -Headers $AzureDevOpsAuthenicationHeader -Method Get
        Write-Host "response = $($response)"
        # get test run Id
        $testRunId = $($response.resultsForGroup.results[0]
        Write-host "test run number = $($testRunId)"
        $rxzlogFileNames = Get-ChildItem -Path $(System.DefaultWorkingDirectory)\Reports -Recurse -Filter "RXReport_*_build-$(Build.BuildNumber)_Failed.rxzlog"
        foreach($logfilename in $rxzlogFileNames)
          # convert file to base64 string
          $base64string = [System.Convert]::ToBase64String([IO.File]::ReadAllBytes($logfilename.fullname))
          Write-host "Converted string = $($base64string)"
          # create request body
          $BuildReqBody= @{stream=$base64string;fileName="$($";comment="Ranorex report";attachmentType="GeneralAttachment"}
          $BuildReqBodyJson = $BuildReqBody | ConvertTo-Json -Compress
          # attach report to test run
          $htmlReportFile = Invoke-RestMethod -Uri "$testRunId/attachments?api-version=6.0-preview.1" -Method Post -ContentType 'application/json' -Body $BuildReqBodyJson -Headers $AzureDevOpsAuthenicationHeader
You do not have the required permissions to view the files attached to this post.
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration