Azure Acceptance Tests in DevOps Pipeline
  • 30 Nov 2022
  • 1 Minute to read
  • Contributors
  • Comment
  • Dark
    Light
  • PDF

Azure Acceptance Tests in DevOps Pipeline

  • Comment
  • Dark
    Light
  • PDF

Article Summary

In the below video we will take a look at how to run the aceptance tests which would test the workflows when they are deployed to azure. These will be ran as part of the devops pipeline.

The pipeline is at the below location:
https://github.com/michaelstephensonuk/IntegrationPlaybook-LogicApp-Standard-Testing-Example/blob/main/.pipelines/build_and_deploy_dev.yml

The snippets from the pipeline to run the tests are below. Note I chose to run the tests with the dotnet test command myself so I could control the logger a bit more than the out of the box task because I felt I could get more useful output in the devops console window.

    - powershell: |
        dotnet test --logger:"trx;LogFileName=$(System.DefaultWorkingDirectory)/$(RepoFolder)/logicapp.testing.acceptancetests\TestResults.xml" --logger:"console;verbosity=normal"
      workingDirectory: '$(System.DefaultWorkingDirectory)/$(RepoFolder)/logicapp.testing.acceptancetests'
      displayName: 'Execute Unit Tests'
      enabled: true
      continueOnError: true

To publish the test results to devops we use

    - task: PublishTestResults@2
      displayName: 'Publish Test Results TestResults.xml'
      enabled: true
      continueOnError: true
      inputs:
        testResultsFormat: VSTest
        testResultsFiles: TestResults.xml
        searchFolder: '$(System.DefaultWorkingDirectory)/$(RepoFolder)/logicapp.testing.acceptancetests'
        failTaskOnFailedTests: true
        testRunTitle: '$(BUILD.DEFINITIONNAME) Acceptance Tests'

Was this article helpful?