maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Christian Stein (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (SUREFIRE-1546) JUnit 5 runner does not honor JUnit 5 display names
Date Fri, 01 Feb 2019 16:26:00 GMT

    [ https://issues.apache.org/jira/browse/SUREFIRE-1546?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16758470#comment-16758470
] 

Christian Stein commented on SUREFIRE-1546:
-------------------------------------------

Display names are not intended and are not even able to be used reliably as suggested by [~dantran]
– see this [TestIdentifier.html#getDisplayName()|https://junit.org/junit5/docs/current/api/org/junit/platform/launcher/TestIdentifier.html#getDisplayName()] documentation:
{quote}A _display name_ is a human-readable name for a test or container that is typically
used for test reporting in IDEs and build tools. Display names may contain spaces, special
characters, and emoji, and the format may be customized by [{{TestEngines}}|https://junit.org/junit5/docs/current/api/org/junit/platform/engine/TestEngine.html] or
potentially by end users as well. Consequently, display names should never be parsed; rather,
they should be used for display purposes only.
{quote}
Using display name in place like

{{<testcase name="test case using displayName" classname="class name using displayName"
time="0"/>}}

will lead to problems. Users may provide a single shard display name for all containers and
tests... or down-stream tools might rely on having "real" Java class names and method names
here.
{quote}We plan to print display name in std-out and std-err.
{quote}
This is the option chosen by the JUnit Team. It attaches the arbitrary display name to the
report entry of the originating source. So, down-stream tools can extract from here. Find
the sources of our soon released XML writer at GitHub, and the lines related to new attributes
(like unique-id and displayName) here: https://github.com/junit-team/junit5/blob/master/junit-platform-reporting/src/main/java/org/junit/platform/reporting/legacy/xml/XmlReportWriter.java#L279-L280

I strongly suggest to *not* alter the XML format used by Ant/Surefire in an incompatible manner.

> JUnit 5 runner does not honor JUnit 5 display names
> ---------------------------------------------------
>
>                 Key: SUREFIRE-1546
>                 URL: https://issues.apache.org/jira/browse/SUREFIRE-1546
>             Project: Maven Surefire
>          Issue Type: Bug
>          Components: JUnit 5.x support
>    Affects Versions: 2.22.0
>            Reporter: Romain Manni-Bucau
>            Assignee: Tibor Digana
>            Priority: Major
>              Labels: junit5
>             Fix For: 3.0.0-M4
>
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> JUnit 5 runner should respect the test @DisplayName instead of displaying the classname
if any is defined. Seems last release doesn't support that feature of JUnit 5 making the console
output and reports not the expected ones.
>  
> Origin: https://github.com/junit-team/junit5/issues/990



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message