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:
Publish Artifacts step definition: