Add --test-format CLI option for customizable test name display#7134
Add --test-format CLI option for customizable test name display#7134
Conversation
Co-authored-by: Evangelink <11340282+Evangelink@users.noreply.github.com>
Co-authored-by: Evangelink <11340282+Evangelink@users.noreply.github.com>
Co-authored-by: Evangelink <11340282+Evangelink@users.noreply.github.com>
Co-authored-by: Evangelink <11340282+Evangelink@users.noreply.github.com>
Co-authored-by: Evangelink <11340282+Evangelink@users.noreply.github.com>
Evangelink
left a comment
There was a problem hiding this comment.
@copilot add unit tests and acceptance tests
Unit tests and acceptance tests have already been added:
The tests cover all placeholders (, , , , , ) and various scenarios including parameter handling and fallback behavior. |
Evangelink
left a comment
There was a problem hiding this comment.
@copilot please update MTP and MSTest acceptance tests on help and info to mention this new CLI option
Co-authored-by: Evangelink <11340282+Evangelink@users.noreply.github.com>
Updated MTP and MSTest acceptance tests for help and info to include the
|
|
For the reasons described in the issue, I think this will just add more maintenance than it is worth. |
|
I think changing the default is good moving forward but it could lead to breaking changes for many customers, internal and external, who parse current output. To avoid disruption we would need to postpone to v3 or introduce a way to change the default (e.g. this PR), Regarding the JSON output, that's IMO a different feature request and we have multiple tickets for that. If the current implementation is causing maintenance headaches, I’m happy to revisit and consider removing it to reduce complexity. In the meantime, I see value for me and few internal team so I'd like to move this forward. |
|
By the same logic this change #6717 will also break teams that are parsing assertion output (also more than few). if you move forward please rename the option to --list-tests-test-format, so it aligns with other parameters that use that "main name" for the main option, and main name - suffix for sub-options. And that we also don't close doors for |
|
It's not about changing the name when doing lsit test, it will also impact how we show tests when passed/failed... Hence the current name. For the assertion messages, I partially agree. Yes if they are looking at the message there are issues but all internal and external scripts I know of are based on parsing result of |
|
Ah okay, I was confused with the examples being only for list tests. And the issue closing only the extra options to --list-tests issue. In that case I am even more against that, because it conflicts with the functionality that is already built into the terminal reporter (e.g. showing assembly, and --output detailed) and will make it difficult to provide consistent behavior in the ansi mode, e.g. the tests in progress cannot easily adopt this output, because they should not overflow width of 1 row. |
We already check if that's too long in which case we strip with |
Pull request was closed
Summary
This PR implements a new CLI option
--test-formatthat allows users to customize how test names are displayed in console output during test discovery (--list-tests) and execution (--output detailed).Implementation
Changes Made
--test-formatto PlatformCommandLineProvider<fqn>,<ns>,<type>,<method>,<display>,<asm>Supported Placeholders
<display>- Display name (default)<fqn>- Fully qualified name (namespace.type.method with parameters)<ns>- Namespace<type>- Type name<method>- Method name<asm>- Assembly name (short name without version/culture/token)Usage Examples
Related Issues
--list-tests#3221Notes
<placeholder>syntax as suggested in the agent instructionsOriginal prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.