Publish artifact from buildTmp?

I have a sln2008 configuration that runs tests with MSTest. The resulting .trx file is a cryptic temp file in buildTmp. How do I publish that as an artifact of the build?

Things I've tried:

1. Specifying %TEMP%/*.trx for the artifact: leads to [Publishing artifacts] Artifacts path *.trx not found

2. Setting resultsfile to 'results.trx' in the configuration, and the artifact path to 'results.trx': this causes all test run data to appear in the solution directory (the config working directory), along with the 'results.trx' file. I don't want this, because I have to cleanup the directory, but it works the first time around (I get the artifact published). Second build fails because MSTest won't rewrite the results.trx file.

3. Using a environment variable to disambiguate the filename, eg. 'results-%build.vcs.number%.trx'. Doesn't seem to substitute the property - leads to a failure to read the .trx file at the end of the tests.

Is there a way to do this without moving the whole configuration to "Command Line" and managing it myself?

Please sign in to leave a comment.