You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Once nice feature of JUnit 5 is overriding the outputs of test Method names with more human friendly @DisplayName annotation.
Seemingly the test output does not pick up the test names from @DisplayName but rather just shows the actual method name. Our actual method names are pretty long and not display friendly. The test result xml files should use the @DisplayName annotation.
The text was updated successfully, but these errors were encountered:
It's one thing to use @DisplayName for output rendering to the console, in fact TreePrintingTestListener supports this since the beginning (e.g. by running testOnly * -- "--display-mode=tree" or configuring test options testOptions += Tests.Argument(jupiterTestFramework, "--display-mode=tree").
Support in FlatPrintingTestListener could be done, I guess.
However, this is is about rendering to XML reporting files which is a totally different story.
JUnitXmlTestsListener is what generates those XML files. It receives the same test Events which SBT uses internally to identify tests and modifies the names (which are expected to be a fully qualified class name).
e.selector match {
caseselector: TestSelector=> selector.testName.split('.').last
casenested: NestedTestSelector=> nested.suiteId().split('.').last +"."+ nested.testName()
case other =>s"(It is not a test it is a ${other.getClass.getCanonicalName})"
}
Every test annotated with a @DisplayName containing a dot would be reported in parts only, if at all.
Then there is SBTs use of those events to identify available tests. Changing the selectors from class names to display names leads to a whole series of changes from where tests are collected to how tests are filtered.
Once nice feature of JUnit 5 is overriding the outputs of test Method names with more human friendly
@DisplayName
annotation.Seemingly the test output does not pick up the test names from
@DisplayName
but rather just shows the actual method name. Our actual method names are pretty long and not display friendly. The test result xml files should use the@DisplayName
annotation.The text was updated successfully, but these errors were encountered: