6

I am running my automation Test in Azure pipeline and using NUnit VS Test adapter and Visual studio Test task. the .trx file is getting attached in the Test Run Summary. But in Publish test result task I could see the warning No test result files matching **/*.trx were found.

Build was successful but .trx file is not displayed in Publish test result task

Can you some help me what I am missing?

Publish Test Results task Cofiguration

Pathma10f
  • 71
  • 1
  • 1
  • 4

2 Answers2

6

Because the .trx file is not where you specified in the Publish task, the file generated in D:\a\_temp\.... while you specified to search in $(System.DefaultWorkingDirectory) that is D:\a\work\1\s.

But the truth that you don't need at all the Publish task. the Visual studio Task do it automatically.

So you can remove this task and you still will show the test results in Azure DevOps. See the docs here.

Community
  • 1
  • 1
Shayki Abramczyk
  • 36,824
  • 16
  • 89
  • 114
  • 1
    As you suggested, I changed search folder to "$(Agent.TempDirectory)" and Test result format as "NUnit". But still the .trx file is not displayed in published task. I could see 1 warning in Test run for Test plans task. I have attached the logs below – Pathma10f Jun 19 '19 at 07:01
  • 1
    `##[warning]Cleanup.Run : Cleanup failed with exception : System.IO.IOException: The process cannot access the file 'd:\a\_temp\TR_86fc254b-696c-4a9f-ba45-2fc1c792daa0' because it is being used by another process. 2019-06-19T06:57:09.3485419Z at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) 2019-06-19T06:57:09.3486552Z at System.IO.Directory.DeleteHelper(String fullPath, String userPath, Boolean recursive, Boolean throwOnTopLevelDirectoryNotFound, WIN32_FIND_DATA& data)` – Pathma10f Jun 19 '19 at 07:33
  • It's look like process cannot access the file location Agent.TempDirectory, because it is being used by another process. Do you have any idea why i am getting that warrning? – Pathma10f Jun 19 '19 at 08:02
  • No :/ if you remove the publish test task, can you see the tests summary? – Shayki Abramczyk Jun 19 '19 at 08:09
  • 1
    I have removed the publish test task and re-executed. still i am getting the below warning test run** ##[warning]Cleanup.Run : Cleanup failed with exception : System.IO.IOException: The process cannot access the file 'd:\a\_temp\TR_3e32c9b3-5e71-4e56-a13a-83cdc3e1b399' because it is being used by another process.** – Pathma10f Jun 19 '19 at 09:06
  • .trx file is attached in the test summary and i don't have any problem with that. actually i need to send the test execution report to my email id. How to achieve that? – Pathma10f Jun 19 '19 at 09:12
  • Please open a new question regarding this – Shayki Abramczyk Jun 19 '19 at 09:24
  • The VS task doesn't do it automatically for me – pabrams Oct 09 '20 at 19:48
  • @pabrams can you share your task settings? – Shayki Abramczyk Oct 10 '20 at 21:12
0

Look at your screenshot:

Test Result Format: VSTest.

You're not using VSTest, you're using NUnit.

Change the test result format to NUnit.

Daniel Mann
  • 57,011
  • 13
  • 100
  • 120