I just setup a new project (.net core: netcoreapp2.1) using xUnit Tests for UI test automation using selenium. I can run the tests via build and release pipelines on devops, but I cannot get the test results on the tests tab.
Now I'm wondering: how do I get XML-Reports of my testruns. On the release pipeline, I have a Publish Test Result task, but results are not getting published with the error below.
No Result Found to Publish 'D:\a\r1\a\Global Platform-QA\drop\TestResults\TEST.XML'. 2019-06-27T02:48:16.2148676Z No build level attachments to publish.
I have tried changing the test result format to junit but I am still missing something. I have added an empty TEST.XML to the testresults folder as well, but still haven't been able to figure out the missing link.
Below is the yaml for the build and release pipelines on devops. pool:steps: steps: - task: DotNetCoreCLI@2 displayName: Restore inputs: command: restore projects: '**/*.csproj'
- task: DotNetCoreCLI@2
displayName: Build
inputs:
projects: '**/*.csproj'
arguments: '--configuration $(BuildConfiguration)'
- task: DotNetCoreCLI@2
displayName: Publish
inputs:
command: publish
publishWebProjects: false
projects: '$(Parameters.RestoreBuildProjects)'
arguments: '--configuration $(BuildConfiguration) --output
$(build.artifactstagingdirectory)'
zipAfterPublish: false
modifyOutputPath: false
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact'
inputs:
PathtoPublish: '$(build.artifactstagingdirectory)'
condition: succeededOrFailed()
Release pipeline:
steps:
- task: DotNetCoreCLI@2
displayName: CVProSmokeTest
inputs:
command: custom
projects: '**/CVProSmokeTest.dll'
custom: vstest
arguments: '--logger:trx;logfilename=TEST.xml'
workingDirectory: '$(System.DefaultWorkingDirectory)'
continueOnError: true
condition: succeededOrFailed()
timeoutInMinutes: 20
steps:
- task: PublishTestResults@2
displayName: 'Publish Test Results'
inputs:
testResultsFormat: XUnit
testResultsFiles: '**/TEST.xml'
mergeTestResults: true
testRunTitle: Selenium
condition: succeededOrFailed()
timeoutInMinutes: 20