Service Virtualization

 View Only

Optimize junitlisa Ant task for better report structure

  • 1.  Optimize junitlisa Ant task for better report structure

    Posted Nov 12, 2014 10:51 AM

    When I run LISA tests with the "junitlisa" Ant-task, it writes a JUnit compatible XML report of the results. This is great for the integration into existing CI infrastructure.


    However, JUnit reports are Java oriented and therefore the result structure is based on the package and class names of the tests. The "junitlisa" task (the test runner behind it) seems to write the report with static information in these fields. Therefore the reports are always interpreted as one testclass containing all the tests. Even when I have multiple reports from multiple testsuites, they are merged into one view by Jenkins.



    I have multiple report XMLs from running multiple LISA testsuites. The attribute values in red are the same for all report XMLs.

    <testsuite errors="0" failures="0" hostname="myHost" name="com.itko.lisa.testing.JUnitRunLISA" tests="1" time="2.363" timestamp="2014-11-12T01:22:07">

      <testcase classname="com.itko.lisa.testing.RegressionRunner" name="SendSecureMessage.tst|Run1User1Cycle.stg|SL_SecureMessaging_CRM2Web_TestSuite.ste" time="2.322"/>



    This produces in Jenkins the following "structure" to browse the results: 14 Tests from 2 Testsuites are merged and interpreted as "test methods" of the class "com.itko.lisa.testing.RegressionRunner".


    The package "com.itko.lisa.testing" in the first picture is the package name taken from the attribute "name" of the tag "testsuite", while the classname "RegressionRunner" in the second picture is taken from the attribute "classname" of the tag "testcase". All the relevant names like the name of the testsuite and the name of the testcase are concatenated in the testname. 


    It would be much nicer to have the name of the LISA testsuite in the name attribute of the testsuite-tag (interpreted by Jenkins as "package") and the name of the LISA testcase as classname of the testcase (interpreted by Jenkins as "class").