[infinispan-issues] [JBoss JIRA] (ISPN-7116) Test methods that use a TestNg dataProvider are duplicated in JUnit reports

Dan Berindei (JIRA) issues at jboss.org
Mon Oct 24 09:35:00 EDT 2016


    [ https://issues.jboss.org/browse/ISPN-7116?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13310878#comment-13310878 ] 

Dan Berindei commented on ISPN-7116:
------------------------------------

[~afield] If you look at the {{org.testng.reporters.TestHTMLReporter}} code, it uses {{TestResult.getParameters()}} to log the {{DataProvider}} parameters, but {{org.testng.reporters.JUnitXMLReporter}} only uses {{TestResult.getMethod().getMethodName()}}. So I think it's just a missing feature in the JUnit reporter.

You can add {{org.testng.reporters.JUnitXMLReporter}} as a TestNG listener in the debug configuration and set a breakpoint in the reporter itself. You can also look around in the other listeners, like the reporter set up by IntelliJ :)

And if you start working on the JUnit reporter, it would be nice if you changed {{org.infinispan.commons.test.TestNGTestListener.testName()}} to include the {{DataProvider}} parameters as well :)

> Test methods that use a TestNg dataProvider are duplicated in JUnit reports
> ---------------------------------------------------------------------------
>
>                 Key: ISPN-7116
>                 URL: https://issues.jboss.org/browse/ISPN-7116
>             Project: Infinispan
>          Issue Type: Enhancement
>          Components: Test Suite - Core
>            Reporter: Alan Field
>            Assignee: Alan Field
>
> TestNg test methods that use a {{dataProvider}} are reported as multiple duplicate test cases in the surefire results reports:
> {noformat}
>   <testcase name="testDistExecPutGet" classname="org.infinispan.client.hotrod.ExecTest" time="0.424"/>
>   <testcase name="testDistExecPutGet" classname="org.infinispan.client.hotrod.ExecTest" time="0.015"/>
>   <testcase name="testEmbeddedScriptRemoteExecution" classname="org.infinispan.client.hotrod.ExecTest" time="0.132"/>
>   <testcase name="testEmbeddedScriptRemoteExecution" classname="org.infinispan.client.hotrod.ExecTest" time="0.086"/>
>   <testcase name="testExecPutConstantGet" classname="org.infinispan.client.hotrod.ExecTest" time="0.016"/>
>   <testcase name="testExecPutConstantGet" classname="org.infinispan.client.hotrod.ExecTest" time="0.009"/>
>   <testcase name="testExecReturnNull" classname="org.infinispan.client.hotrod.ExecTest" time="0.015"/>
>   <testcase name="testExecReturnNull" classname="org.infinispan.client.hotrod.ExecTest" time="0.008"/>
>   <testcase name="testLocalExecPutGet" classname="org.infinispan.client.hotrod.ExecTest" time="0.022"/>
>   <testcase name="testLocalExecPutGet" classname="org.infinispan.client.hotrod.ExecTest" time="0.013"/>
>   <testcase name="testLocalExecPutGetWithListener" classname="org.infinispan.client.hotrod.ExecTest" time="0.037"/>
>   <testcase name="testLocalExecPutGetWithListener" classname="org.infinispan.client.hotrod.ExecTest" time="0.025"/>
>   <testcase name="testRemoteScriptRemoteExecution" classname="org.infinispan.client.hotrod.ExecTest" time="0.074"/>
>   <testcase name="testRemoteScriptRemoteExecution" classname="org.infinispan.client.hotrod.ExecTest" time="0.06"/>
>   <testcase name="testRemovingNonExistentScript" classname="org.infinispan.client.hotrod.ExecTest" time="0.002"/>
> {noformat}
> The {{name}} property should include the parameters passed to the method to differentiate the results.



--
This message was sent by Atlassian JIRA
(v6.4.11#64026)


More information about the infinispan-issues mailing list