Copy acceptance test diagnostic logs into the test results directory
The cleanup already keeps the temp directory when an acceptance test fails, and the pipeline already publishes artifacts/TestResults/<config> when the job fails. Nothing connects the two. TestContext.AddResultFile only records the path it is given, and the diagnostic logs are written under $(Agent.TempDirectory), which is not published and is deleted when the agent is recycled. So the published trx ends up with <ResultFile> entries like D:\a\_work\_temp\vstest\IVpTd\logs\log.datacollector.26-08-24_13-50-25_67394_5.txt that point at nothing.
That is why the CrashDumpOnStackOverflow failure in build 20260824.3 could not be diagnosed. The blame data collector log would have explained it, and it is not in any artifact.
Now the attached files are copied into a per-test directory under the test results directory, and the copies are attached instead. Each test needs a directory of its own because acceptance tests run in parallel and they all write a file called log.txt. Only the log directories that are in _attachments are copied, so crash dumps and extracted packages stay in the temp directory. A file that cannot be copied is logged and skipped, so cleanup never replaces the failure the test reported.
No pipeline change is needed, the existing Publish Test Results folders step picks the files up.
Verified: failed an acceptance test on purpose, the logs landed in artifacts/TestResults/Release/.../attachments/<test name>_<id>/ and the trx <ResultFile> entries pointed at the copies. Unit tests and build.cmd -c Release -pack are green.
š¤