Azure-pipelines-tasks: [TFS 2017][MAVEN task]No test result files matching pattern were found

Created on 18 Jan 2017  路  6Comments  路  Source: microsoft/azure-pipelines-tasks

When I run maven task on TFS 2017 with option publish test result to TFS services, I receive warning "No test result files matching D:\agentTest_work\5\TEST_REPORTS*\TEST-.xml were found, so publishing JUnit test results is being skipped."

I am customize Test Result Files to pattern "$(Agent.BuildDirectory)/TEST_REPORTS/*/TEST-.xml"

This issue doesn't happen on TFS 2015

I show log I see it is changed from "agent.buildDirectory" to "System.DefaultWorkingDirectory" when upgrade from TFS 2015 to TFS 2017

CrossPlatform Documentation Test

Most helpful comment

Can someone please share the documentation on that?

All 6 comments

Yes, in TFS 2017, we look for the file in system.DefaultWorkingDirectory and that is why the task is not able to find the xml file in agent.buildDirectory.
I would suggest that you use the PublishTestResults task to publish the test results to TFS. You can add the task after maven task and specify the format of test result file and test result file location. Alternatively, you can also give full name of test result file in maven task instead of using search patterns like "*", "?", for it to look in the right directory.

Thanks for your answer!

I can use the PublishTestResults task to publish the test results to TFS 2017.

But I suggest we should edit help to user can understand.

Yes, we will look towards documenting it.

@tanvi-soni It's one thing to default to that, but why always assume it'll be in System.DefaultWorkingDirectory? How hard is it to allow the path to be overridden? Pretty much every build task with a path input allows it.

@Evit15 and @tanvi-soni, thank you for your ideas. I agree that the Test results files field should allow specifying a directory and not always assume results are under System.DefaultWorkingDirectory. I've added this issue to our internal backlog and we hope to address it soon.

Can someone please share the documentation on that?

Was this page helpful?
0 / 5 - 0 ratings