Repository navigation
Add argument-only display names for data rows - #11775
Conversation
Preserve method names with opt-in ArgumentsDisplayName metadata and add MSTEST0089 for conflicting full and argument names. Cover naming precedence, localization, compiler diagnostics, and packed MTP/VSTest consumers. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Retain both the row-label helper signature and current xxHash buffer APIs. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The implementation is consistent across framework, adapter, analyzer, API tracking, documentation, localization, and regression coverage.
Review effort: Balanced
Findings: None
What changed in this PR
Adds argument-only display names for data rows while preserving method names, existing naming precedence, and compatibility behavior.
Changes:
- Adds
ArgumentsDisplayNametoDataRowAttributeandTestDataRow<T>. - Propagates row labels through adapter discovery and execution.
- Adds MSTEST0089, localization, documentation, API baselines, and comprehensive tests.
Confidence at a glance
🟢 Framework, adapter, analyzer, and tests
Public APIs are tracked and documented; discovery/execution paths, precedence rules, localization, analyzer behavior, and packed consumers are covered.| File | Description |
|---|---|
test/UnitTests/TestFramework.UnitTests/TestDataRowTests.cs |
Tests row-label metadata exposure. |
test/UnitTests/TestFramework.UnitTests/Attributes/DataRowAttributeTests.cs |
Tests naming precedence and formatting. |
test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Helpers/TestDataSourceHelpersTests.cs |
Tests metadata extraction. |
test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Execution/TestMethodRunnerTests.cs |
Tests folded execution naming. |
test/UnitTests/MSTest.Analyzers.UnitTests/ConflictingDataRowDisplayNamesAnalyzerTests.cs |
Covers MSTEST0089 scenarios. |
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/ArgumentsDisplayNameTests.cs |
Validates packed MTP/VSTest behavior. |
src/TestFramework/TestFramework/TestDataRow.cs |
Adds dynamic-row argument labels. |
src/TestFramework/TestFramework/PublicAPI/PublicAPI.Unshipped.txt |
Tracks new public properties. |
src/TestFramework/TestFramework/ITestDataRow.cs |
Extends internal row metadata. |
src/TestFramework/TestFramework/InternalAPI/InternalAPI.Unshipped.txt |
Tracks internal API additions. |
src/TestFramework/TestFramework/Internal/TestDataSourceUtilities.cs |
Centralizes localized name formatting. |
src/TestFramework/TestFramework/Interfaces/ITestDataSource.cs |
Documents new row metadata. |
src/TestFramework/TestFramework/Attributes/DataSource/DataRowAttribute.cs |
Adds inline-row argument labels. |
src/TestFramework/TestFramework.Extensions/PACKAGE.md |
Documents package usage. |
src/Analyzers/MSTest.Analyzers/xlf/Resources.zh-Hant.xlf |
Adds generated localization entries. |
src/Analyzers/MSTest.Analyzers/xlf/Resources.zh-Hans.xlf |
Adds generated localization entries. |
src/Analyzers/MSTest.Analyzers/xlf/Resources.tr.xlf |
Adds generated localization entries. |
src/Analyzers/MSTest.Analyzers/xlf/Resources.ru.xlf |
Adds generated localization entries. |
src/Analyzers/MSTest.Analyzers/xlf/Resources.pt-BR.xlf |
Adds generated localization entries. |
src/Analyzers/MSTest.Analyzers/xlf/Resources.pl.xlf |
Adds generated localization entries. |
src/Analyzers/MSTest.Analyzers/xlf/Resources.ko.xlf |
Adds generated localization entries. |
src/Analyzers/MSTest.Analyzers/xlf/Resources.ja.xlf |
Adds generated localization entries. |
src/Analyzers/MSTest.Analyzers/xlf/Resources.it.xlf |
Adds generated localization entries. |
src/Analyzers/MSTest.Analyzers/xlf/Resources.fr.xlf |
Adds generated localization entries. |
src/Analyzers/MSTest.Analyzers/xlf/Resources.es.xlf |
Adds generated localization entries. |
src/Analyzers/MSTest.Analyzers/xlf/Resources.de.xlf |
Adds generated localization entries. |
src/Analyzers/MSTest.Analyzers/xlf/Resources.cs.xlf |
Adds generated localization entries. |
src/Analyzers/MSTest.Analyzers/Resources.resx |
Defines MSTEST0089 messages. |
src/Analyzers/MSTest.Analyzers/Helpers/WellKnownTypeNames.cs |
Registers TestDataRow<T>. |
src/Analyzers/MSTest.Analyzers/Helpers/DiagnosticIds.cs |
Allocates MSTEST0089. |
src/Analyzers/MSTest.Analyzers/ConflictingDataRowDisplayNamesAnalyzer.cs |
Detects conflicting naming properties. |
src/Analyzers/MSTest.Analyzers/AnalyzerReleases.Unshipped.md |
Records the new diagnostic. |
src/Adapter/MSTestAdapter.PlatformServices/InternalAPI/InternalAPI.Unshipped.txt |
Tracks the adapter overload. |
src/Adapter/MSTestAdapter.PlatformServices/Helpers/TestDataSourceHelpers.cs |
Extracts argument-label metadata. |
src/Adapter/MSTestAdapter.PlatformServices/Execution/TestMethodRunner.DataSource.cs |
Applies labels during execution. |
src/Adapter/MSTestAdapter.PlatformServices/Discovery/AssemblyEnumerator.cs |
Applies labels during discovery. |
docs/RFCs/005-Framework-Extensibility-Custom-DataSource.md |
Documents custom-source support. |
docs/glossary.md |
Documents MSTEST0089. |
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
Final test-triage resolution — Azure Pipelines build 1624906 Final analysis (completed build,
Conclusion: No action needed. This supersedes the earlier preliminary comment for this check, if any. No issue is being created since the evidence shows expected retry-contract behavior consistently reproduced across history, not a defect.
|
Custom data-row
DisplayNamevalues currently replace the entire test name, making rows with the same label on different methods indistinguishable. Add an explicit opt-inArgumentsDisplayNameproperty so a row can render asParse_ReturnsNull (empty input)without repeating the method name or changing existing full-name overrides.Fixes #11770
Approach
DataRowAttributeandTestDataRow<T>, reuse the localized default name format, and honorTestMethod.DisplayNamein both discovery and folded execution.DisplayNameprecedence and null/whitespace behavior. Argument labels are verbatim text, not templates; null or blank labels retain existing naming behavior. Dynamic row labels take precedence over source-level naming callbacks and require an updated adapter.UpdateXlftarget.Validation
Passed with the pinned repository SDK
12.0.100-alpha.1.26480.103, packed MSTest components4.5.0-dev, and Microsoft.Testing.Platform2.5.0-dev:TestContextnames, ignored rows, categories, and VSTest serialization fallback. Framework-only consumers explicitly enable analyzers, receive MSTEST0089 through the transitive package dependency, and compile cleanly after removing either conflicting property.Reproducible validation commands (all exited successfully)
Run from the repository root after building. Acceptance assets restore fresh copies of the packed packages.
TRX reports and build/binlogs are retained under
artifacts. The acceptance host uses runtime roll-forward locally; its generated consumers run on their specified target frameworks.