fix(nunit, xunit): exclude redundant data from display names and testMethod #576
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Context
Currently, the default test names assigned by
Allure.Xunithave the following format:<namespace>.<class>.<method>(<parameters>)(the same format is used for full names ifuseLegacyIdis set totrue):This leads to redundant data being included in a test's name:
titlePathandpackageThe same is also true for Allure.Xunit's
testMethodvalues (it's used instead of display names on thePackagestab). These values additionally include test arguments (the actual values used during the test execution), which are redundant for the same reason the parameters are redundant in display names.The only motivation I can think of for having such detailed names is to create a somewhat manageable report, in case no hierarchy is properly defined. As we at least have the
packageshierarchy, which contains the namespaces and the class names, the redundant data can be excluded from the names.Similarly,
Allure.NUnituses the following format:<method>.(<arguments>), whereargumentsare redundant for the same reason asparametersare redundant for Allure.Xunit:Additionally, having argument-dependent names doesn't play well with TestOps, as one of these argument-specific names will be picked up by the parameterized test case, which is confusing.
The PR shortens the default names to only include method names.
Checklist