Menu

"Mark scenario as Test" feature and JUnitReporter

2013-07-24
2013-09-09
  • Vincenzo Marrazzo

    Hi

    I have discovered that when a "Mark scenario as Test" feature is used the JUnitReporter cannot fill the attribute "name" into testcase tag.

    This behaviour is important for the integration of JSystem with Jenkins, because without "name" attribute is not possible to track the "Mark scenario as Test" history. (see PS for details)

    I have verified on JS 6.0.01 ( but also JS 6.0.02-SNAPSHOT shows same code )


    --> Precondition
    "Mark scenario as Test" step into running scenario
    JUnitReporter enabled

    --> Into code
    RunnerListenersManager.java:1668 -> set methodName to null
    JUnitReporter.java:78 -> pass the null value to name setter and into testcase tag the "name" attribute is not present


    If this behaviour is wanted (no name attribute for "Mark scenario as Test" steps) it's my opinion that complex/nested scenario cannot use the "Mark scenario as Test" feature and it will lose the readability into Jenkins JUnit report.

    If this behaviour can be changed and name attribute will be filled also for "Mark scenario as Test" steps the integration with Jenkins can be improved.

    Any opinion?

    Thanks a lot
    Vincenzo

    [
    PS

    Jenkins goes in exception during evaluation of "TEST-JSystem_JUnit_report.xml" file when some error occurs into execution because try to read name attribute.

    java.lang.NullPointerException
    at java.lang.StringBuilder.<init>(StringBuilder.java:92)
    at hudson.tasks.junit.CaseResult.getSafeName(CaseResult.java:254)
    at hudson.tasks.test.TestObject.getRelativePathFrom(TestObject.java:146)
    ]

     
  • Itai Agmon

    Itai Agmon - 2013-09-08

    Hi Vincenzo

    That's seems like a bug in the JUnitReporter class. Some of the test information is harder to retrieve when the scenario is marked as test and this is probably the cause for the problem you encounter.

    I would appreciate if you could post an issue: https://github.com/Top-Q/jsystem/issues?labels=&milestone=&page=1&state=open

     
  • Vincenzo Marrazzo

    Hi Itai,

    I move the post to issue list into GitHub.

    Regards.

     
  • Itai Agmon

    Itai Agmon - 2013-09-09

    Thanks.

    This is issue #186

     

Log in to post a comment.