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

Tibor Digana commented on SUREFIRE-1822:
----------------------------------------

[~mguille...@yahoo.fr]
Sorry that i am late. I am still working on a complex improvement of the plugin 
performance.
So. Yes, the _name=""_ looks like reasonable case for a failure in BeforeAll.
I saw your 
[commit|https://github.com/jenkinsci/junit-plugin/pull/135/commits/32c7ed4c960a9366fdd744063ecbb75e7f5d4f0f]
 with the fix.
My proposal is to proceed with your fix and get the feedback from the users of 
Jenkins.
We can reopen it and open the discussion at any time.
I would close this issue for now.
Thx for reporting it.

> XML report with empty name attribute by 3.0.0-M5 when failing in 
> @BeforeAll/@BeforeClass
> ----------------------------------------------------------------------------------------
>
>                 Key: SUREFIRE-1822
>                 URL: https://issues.apache.org/jira/browse/SUREFIRE-1822
>             Project: Maven Surefire
>          Issue Type: Bug
>          Components: Maven Surefire Plugin, xml generation
>    Affects Versions: 3.0.0-M5
>            Reporter: Marc Guillemot
>            Priority: Major
>
> If a JUnit test fails in @BeforeAll (or a JUnit 4 test in @BeforeClass), then 
> Surefire reports it correctly on the console and fails the build (what was 
> not the case with 3.0.0-M4 with @BeforeAll) *but the testcase name attribute 
> in the XML report is now empty*:
> Example:
> {code:java}
>   <testcase name="" classname="test.TestJUnit5FailingInBeforeAll" 
> time="0.017">
>     <failure 
> type="org.opentest4j.AssertionFailedError"><![CDATA[org.opentest4j.AssertionFailedError:
>  Failure in @BeforeAll method
>         at 
> test.TestJUnit5FailingInBeforeAll.setup(TestJUnit5FailingInBeforeAll.java:14)
> ]]></failure>
>     <system-out><![CDATA[In setup...
> ]]></system-out>
>   </testcase>
> {code}
> As a reference, Surefire 2.2 writes the same content in the classname and 
> name attributes:
> {code:java}
>   <testcase name="test.TestJUnit5FailingInBeforeAll" 
> classname="test.TestJUnit5FailingInBeforeAll" time="0.016">
>     <failure message="Failure in @BeforeAll method" 
> type="org.opentest4j.AssertionFailedError">org.opentest4j.AssertionFailedError:
>  Failure in @BeforeAll method
>         at 
> test.TestJUnit5FailingInBeforeAll.setup(TestJUnit5FailingInBeforeAll.java:14)
> </failure>
>     <system-out><![CDATA[In setup...
> ]]></system-out>
>   </testcase>
> {code}
> It is not really wrong to consider that the testcase node has no name here 
> but it would be a change compared to prior versions that other systems need 
> to handle (Jenkins for instance doesn't display the report correctly in this 
> case).
> Bug or feature? If this considered as a bug, I can try to provide a patch.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to