pathForResultsFile creates unpredictable subfolder to store results file.
See original GitHub issueWhen dotnet-test-explorer.pathForResultsFile is set, the extension does not store the results file within that directory; it creates a randomly-named subdirectory and stores the results file in that. This means that it’s not practical to update the results file outside of the extension.
I’d like to use dotnet watch to automatically run tests whenever the source is modified, but that doesn’t update the codelens or the results in the test view panel. If the results file was placed directly in the specified directory, then it’d be an easy matter to tell dotnet watch to update the same Results.trx file as the extension.
Current Behaviour
The extension creates a subdirectory such as test-explorer-jNsG5F (last six characters are randomly generated by Node.js’s fs.mkdtempSync function). The test results file is stored within this test-explorer subdirectory.
Expected Behaviour
When the user specifies a directory within which to store the results file, the extension should store the Results.trx file directly within that directory, so long as the directory exists.
I’ve got this change made at colinthompson/vscode-dotnet-test-explorer@8be5d24; if you agree with my idea, I’m happy to submit a pull request.
Issue Analytics
- State:
- Created 5 years ago
- Comments:6

Top Related StackOverflow Question
Thanks, that’s probably what I’ll end up doing.
Looks pretty good overall, thanks for pushing this out.