Entering this information will route you directly to the right team and expedite traction.
Question, Bug, or Feature?
Type: Bug
Enter Task Name: PublishTestResults
Server - Azure Pipelines
Not available
Agent - Private:
Current agent version: '2.165.2'
Agent running as: 'vstslinux'
Results are not being published from found XUNIT results files
No Result Found to Publish
Starting: Publish Test Results
Task : Publish Test Results
Description : Publish test results to Azure Pipelines
Version : 2.166.0
Author : Microsoft Corporation
Help : https://docs.microsoft.com/azure/devops/pipelines/tasks/test/publish-test-results
/opt/dotnet/dotnet --version
2.2.300
[warning]Atleast for one assembly start time was not obtained due to tag not present or parsing issue, total run duration will now be summation of time taken by each assembly
Obtained XUnit Test Run Start Date: 2020-04-27T09:14:02.1505099Z and Completed Date: 2020-04-27T09:14:02.1505099Z
No Result Found to Publish '/adopipelines/bp-vsts/BP-Linux-AgentOS/GPA2/_work/275/s/e2e-tests/tests/results.xml'.
Async Command Start: Publish test results
Async Command End: Publish test results
Finishing: Publish Test Results
Checkout how to troubleshoot failures and collect debug logs: https://docs.microsoft.com/en-us/vsts/build-release/actions/troubleshooting
[Insert error from the logs here for a quick overview]
@L0wry Is it possible to share the repro results.xml?
@navin22 I think I might have the same issue. I have the tests running and generating their output via a cake build script. The script runs fine locally and generates file in the right place but when it runs as part a pipeline it doesn't pick up on the file. the repo is here https://github.com/Project-Initium/initium-portal if it helps
@roly445 If possible can you please send the debug logs of your pipeline execution. There can be two issues here either the task is not able to find the .xml file at all or the .xml file is in different format that's not interrupted by the task.
@navin22 sure. The pipeline is public so you can see it here https://dev.azure.com/project-initium/Initium/_build?definitionId=2&_a=summary and this was the last build on the develop branch https://dev.azure.com/project-initium/Initium/_build/results?buildId=36&view=results
@roly445 Is it possible to see this XML xunit-report.xml?
Not from the ci, but i have uploaded a version that gets generated when i run the cake script locally. https://gist.github.com/roly445/6369279051615a3272264bdeb49aa1a7
@roly445 the one you pointed out is not xunit test runner report. They are actually xunit test run by vstest or visual studio with xunit adapter hence the test report format is trx.
I don't know how it's getting stored as .xml though.
I quickly tried renaming it as .trx in my local.
steps:
- task: PublishTestResults@2
displayName: 'Publish Test Results C:\Users\navb\Downloads\testresult\6369279051615a3272264bdeb49aa1a7-b84889adcbf9356ac4d86cd2cb2b3dab66a71a75\xunit-report.trx'
inputs:
testResultsFormat: VSTest
testResultsFiles: 'C:\Users\navb\Downloads\testresult\6369279051615a3272264bdeb49aa1a7-b84889adcbf9356ac4d86cd2cb2b3dab66a71a75\xunit-report.trx'
And I see 812 tests.

I give it the extension of xml when it generates the report/ the is the command that cake generates "C:/Program Files/dotnet/dotnet.exe" test "../Initium.Portal.sln" --logger "trx;LogFileName=C:/Users/andre/Documents/Github/stance/Build/build-artifacts/cover/server/xunit-report.xml;verbosity=normal" --configuration Release --no-build /property:CollectCoverage=True /property:CoverletOutputFormat=\"lcov,opencover,cobertura\" /property:CoverletOutput="C:/Users/andre/Documents/Github/stance/Build/build-artifacts/cover/server/coverage".
So what you are saying that even if the file content is fine, if the file doesn't have a trx extension it will not work?
My bad, I tried with .xml as well. It works. you need to change the yml with input as testResultsFormat: VSTest instead of testResultsFormat: xunit
Please try and let me know.
@roly445 did it work ?
@roly445 or @L0wry I will close this issue. Please reopen if you still need help.
@navin22 Sorry I was only just about to get around to testing it. I can conform that my issues are resolved