'How to publish 2 sets of tests results on Azure Devop?

We have a git repository that contains .Net code(backend) and since recently typescript code(angular, front-end).

When we added the angular test execution, it appears that the initial .net tests are not correctly published. From my test, it seems that only the last publish is conserved.

How can we keep both of them? It's important because it's used in a PR and we don't want ton miss anything.

Here is how we publish the .Net tests:

  - task: PublishTestResults@2
    inputs:
      testResultsFormat: 'NUnit'
      testResultsFiles: '**/TEST-*.xml'
      searchFolder: '$(System.DefaultWorkingDirectory)/testResults'
      failTaskOnFailedTests: true
      testRunTitle: '.Net tests'
      buildPlatform: 'Any CPU'
      buildConfiguration: 'Debug'

and here how we publish the Angular tests:

  - task: PublishTestResults@2
    displayName: 'Publish Angular test results'
    condition: succeededOrFailed()
    inputs:
      searchFolder: $(System.DefaultWorkingDirectory)/angular-test/results
      testRunTitle: Angular
      testResultsFormat: JUnit
      testResultsFiles: '**/TESTS*.xml'

How can we ensure both tests results are considered in Azure Devop: enter image description here (here you see only the angular tests and its (few) tests. You also see there has been two tests run).

I taught about doing only once the PublishTestResults task, but since they have different format(.net is NUnit, while angular is JUnit), it will not work.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source