1
votes

I have an Azure DevOps build set up to copy artifacts and publish artifacts as the last two steps like below. The Test Runs folder contents are always generated, so there should always be files available. But the files are being found only when at least one test in VSTest task fails. If the build succeeds, the Copy Files task finds 0 files, hence the Publish Artifact step has nothing to publish.

Copy Files step definition:

enter image description here

Publish Artifacts step definition:

enter image description here

1
Can you share the test step log when all success?Shayki Abramczyk
Since the files could be found when at least one test in VSTest task fails, so the configure of copy task is correct. You should double check if the Test Runs folder contents are always generated when the build succeeds. Or you can share how do you generate the contents in the Runs folder.Leo Liu-MSFT
I was monitoring the folders while VSTest was running and what happens is the Test Results folder, that has all the tets run information is being cleared out when the .trx file is being generated. I moved the desired output up one folder, so it doesn't get deleted.Razkar
@Razkar, Great!, Glad to know you have resolved this issue by yourself. I have convert the comment to the answer, so it could help other community members who get the same issues and we could archive this thread. If it helps you, you can accept it as answer, or you can share your solution with more info, thanks.Leo Liu-MSFT

1 Answers

0
votes

Azure DevOps. Copy Files. Publish Artifacts. Found 0 files when build succeeds

Since the copy files can be found when at the one test in VSTest task fails, so we could to know the configure of copy task and Publish Artifacts task are correct.

So, this issue should more related to the files in the Test Runs folder. We need to double check if the Test Runs folder contents are always generated when the build succeeds, Or we need to monitor what happened to this folder when we execute the VSTest task.

Solution by Razkar:

After monitoring the folders while VSTest was running and what happens is the Test Results folder, that has all the tets run information is being cleared out when the .trx file is being generated. I moved the desired output up one folder, so it doesn't get deleted.