Clarify XML docs for TestContext result/deployment directories - #9180
Conversation
Clarify the relationship between TestRunDirectory, DeploymentDirectory, ResultsDirectory, TestRunResultsDirectory and TestResultsDirectory, with a concrete directory-layout example. Notably document that, despite the name, TestRunResultsDirectory (In\<MachineName>) is a child of TestResultsDirectory (In), addressing the confusion in #7698. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR updates the XML documentation on TestContext’s deployment/results directory properties in MSTest (TestFramework.Extensions) to clarify the on-disk layout and resolve confusion reported in #7698 (notably the TestResultsDirectory vs TestRunResultsDirectory relationship).
Changes:
- Expanded
TestRunDirectorydocs with a concrete directory-layout example. - Clarified the intended meanings/relationships of
DeploymentDirectory,ResultsDirectory,TestRunResultsDirectory, andTestResultsDirectory(including worked examples and remarks).
Show a summary per file
| File | Description |
|---|---|
| src/TestFramework/TestFramework.Extensions/TestContext.cs | Reworks XML docs and adds remarks/examples for TestContext directory properties to reduce ambiguity. |
Copilot's findings
- Files reviewed: 1/1 changed files
- Comments generated: 4
Amaury Levé (Evangelink)
left a comment
There was a problem hiding this comment.
Note
🤖 Automated review by GitHub Copilot. Posted via a maintainer's GitHub token, so it appears under their account — the account owner did not write or approve this content personally. Generated by the Expert Code Review workflow. To request a follow-up action, reply by tagging @copilot directly.
✅ 22/22 dimensions clean — no findings.
Scope: Single .cs file, XML doc comments only. No logic, API, or behavioral changes.
Accuracy verified against the implementation:
TestRunDirectories.cs constructs the values exactly as the new docs describe:
RootDeploymentDirectory→TestRunDirectoryInDirectory = Path.Combine(root, "In")→ResultsDirectoryandTestResultsDirectory(same value — confirmed byTestDeployment.cswhich assignsInDirectoryto both labels)InMachineNameDirectory = Path.Combine(InDirectory, Environment.MachineName)→TestRunResultsDirectoryOutDirectory = Path.Combine(root, "Out")→DeploymentDirectory
The key clarification — that TestRunResultsDirectory is a child of TestResultsDirectory, despite the longer name — is factually correct and directly addresses #7698. The <code> example in the TestRunResultsDirectory remarks is an effective way to make this non-obvious relationship immediately obvious.
The choice to reference ResultsDirectory in the <summary> of TestRunResultsDirectory (the direct parent) while referencing TestResultsDirectory in the <remarks> (the confusing sibling) is intentional and correct — the remarks exist precisely to defuse the naming confusion between TestResultsDirectory and TestRunResultsDirectory.
🤖 Automated content by GitHub Copilot. Posted via a maintainer's GitHub token, so it appears under their account — the account owner did not write or approve this content personally. Generated by the Expert Code Review (on PR ready) workflow. · 396.7 AIC · ⌖ 12.3 AIC · ◷
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Clarifies the XML documentation for the
TestContexttest-run deployment directory properties, addressing the confusion reported in #7698.Problem
The docs for
TestRunResultsDirectoryandTestResultsDirectorywere ambiguous and counter-intuitive. As reported in #7698, on a real run the values are:TestResultsDirectory:<TestRunDirectory>\InTestRunResultsDirectory:<TestRunDirectory>\In\<MachineName>i.e.
TestRunResultsDirectoryis actually a child ofTestResultsDirectory, despite the name suggesting the opposite.Changes
Reworked the
<summary>text (and added<remarks>/<code>examples) for the five related properties inTestContext:TestRunDirectory— documents the full layout with a concrete example.DeploymentDirectory— clarified it is theOutsubdirectory.ResultsDirectory— clarified it is theInsubdirectory; noted it currently equalsTestResultsDirectory.TestRunResultsDirectory— explicitly documents it is a child ofTestResultsDirectory(In\<MachineName>) with a worked example.TestResultsDirectory— clarified it is theIndirectory, equal toResultsDirectoryand the parent ofTestRunResultsDirectory.These triple-slash comments are the source for the learn.microsoft.com API reference pages, so the published docs get the clarification automatically.
Doc-only change; behavior is unchanged and identical under VSTest and MTP (the mapping lives in the shared
MSTestAdapter.PlatformServiceslayer).Fixes #7698