Cactus
  1. Cactus
  2. CACTUS-70

junit report should include the server names

    Details

    • Type: Improvement Improvement
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Maven Integration
    • Labels:
      None
    • Environment:
      Operating System: Other
      Platform: Other

      Description

      Running cactus tests under multiple application servers results in multiple
      entries in the report for each different test - one for each server, however
      none of these are clarified by server.

      It would be good to either clarify the test names with the server, group the
      test results by server, or perhaps produce a separate report by server.

      Having test results all in one report but grouped by server would be my preference.

        Activity

        Hide
        Felipe Leme added a comment -

        Vincent,

        Regarding the Ant task you proposed in the devs list (which would extends junitreport): would it handle multiple servers or would it a task for each server (and then we would glue all together with Jelly)?

        – Felipe

        Show
        Felipe Leme added a comment - Vincent, Regarding the Ant task you proposed in the devs list (which would extends junitreport): would it handle multiple servers or would it a task for each server (and then we would glue all together with Jelly)? – Felipe
        Hide
        Felipe Leme added a comment -

        Ok, after a little bit more thinking, here is a doable solution: change the <cactustag:junitreport> tag.

        Right now, it creates just one junitreport XML with all condensed server; we could change it to create one junitreport XML for each server and then merge all XMLs in one big XML - the only difference in the final result is that we would add the <server> tag

        Once we have the results grouped by server, we have more freedom on how to define the new layout (we could even add info about the server itself, like port, jdk version, diretctory, etc...)

        Show
        Felipe Leme added a comment - Ok, after a little bit more thinking, here is a doable solution: change the <cactustag:junitreport> tag. Right now, it creates just one junitreport XML with all condensed server; we could change it to create one junitreport XML for each server and then merge all XMLs in one big XML - the only difference in the final result is that we would add the <server> tag Once we have the results grouped by server, we have more freedom on how to define the new layout (we could even add info about the server itself, like port, jdk version, diretctory, etc...)
        Hide
        Felipe Leme added a comment -

        PS: I researched a little bit more, and looks like the XML is generated by the JUnit Ant Task. From CactusTask:

        private void executeInContainer(Container theContainer,
        DeployableFile theFile)
        {
        Enumeration tests = getIndividualTests();
        while (tests.hasMoreElements())

        { JUnitTest test = (JUnitTest) tests.nextElement(); execute(test); // CactusTask extends JunitTask, so this method is handled by JUnit }

        }
        }

        So, looks like option 2.1 would also require hacking JUnit

        Another option would be adding an intermediate XLST transformation to add the server in the xmls, but I guess that would make the tests even slower

        Show
        Felipe Leme added a comment - PS: I researched a little bit more, and looks like the XML is generated by the JUnit Ant Task. From CactusTask: private void executeInContainer(Container theContainer, DeployableFile theFile) { Enumeration tests = getIndividualTests(); while (tests.hasMoreElements()) { JUnitTest test = (JUnitTest) tests.nextElement(); execute(test); // CactusTask extends JunitTask, so this method is handled by JUnit } } } So, looks like option 2.1 would also require hacking JUnit Another option would be adding an intermediate XLST transformation to add the server in the xmls, but I guess that would make the tests even slower
        Hide
        Felipe Leme added a comment -

        report (without CSS and other files)

        Show
        Felipe Leme added a comment - report (without CSS and other files)
        Hide
        Felipe Leme added a comment -

        Brett,

        The description of this issue is simple and I thought the solution would be simple as well, but unfortunately it requires a lot of work. First, we can break the problem in 3 parts:

        1.Deciding the new layout
        2.Adding the server name in the XMLs
        3.Change cactus.jsl to display the server name

        The first part is what you called "clarify the test names with the server, group the
        test results by server, or perhaps produce a separate report by server". I'm afraid we won't have the option to choose here - we might have to choose the option less impossible to implement.

        For the second part we have 3 options:

        2.1 add a server attribute on each individual junit xml (on the <testsuite> element). I haven't figured out how to do it, but I think it would require changing the Cactus Ant taks (and if that's the case, it might be better to wait for the Cargo integration before doing the change)
        2.2 add a new element one level above the <testsuite> element (for instance, <server name="xxxx">). This is hard, as the XML is generated by the junitreport Ant task (so we would need to hack that class)
        2.3 create a TESTS-TestSuites-Cactus.xml for each server (instead of consolidating everything in just one). This is also tough, as it would require a full refactoring in the report (at least it would allow the options that group by reports)

        There is also another problem with the 2nd part: how to name the servers. I think the easiest way is to add a new property for each server, with a default value. For instance:

        cactus.name.tomcat4x=Tomcat 4

        Finally, the third part will depend on the previous 2.

        So, it looks to me that 2.2 is the easiest way. I changed cactus.jsl and manually modified the TESTS-TestSuites-Cactus.xml and it worked fine (see attachment). I still need to figure it out how to change the <testsutite> element automatically though.

        Felipe

        Show
        Felipe Leme added a comment - Brett, The description of this issue is simple and I thought the solution would be simple as well, but unfortunately it requires a lot of work. First, we can break the problem in 3 parts: 1.Deciding the new layout 2.Adding the server name in the XMLs 3.Change cactus.jsl to display the server name The first part is what you called "clarify the test names with the server, group the test results by server, or perhaps produce a separate report by server". I'm afraid we won't have the option to choose here - we might have to choose the option less impossible to implement. For the second part we have 3 options: 2.1 add a server attribute on each individual junit xml (on the <testsuite> element). I haven't figured out how to do it, but I think it would require changing the Cactus Ant taks (and if that's the case, it might be better to wait for the Cargo integration before doing the change) 2.2 add a new element one level above the <testsuite> element (for instance, <server name="xxxx">). This is hard, as the XML is generated by the junitreport Ant task (so we would need to hack that class) 2.3 create a TESTS-TestSuites-Cactus.xml for each server (instead of consolidating everything in just one). This is also tough, as it would require a full refactoring in the report (at least it would allow the options that group by reports) There is also another problem with the 2nd part: how to name the servers. I think the easiest way is to add a new property for each server, with a default value. For instance: cactus.name.tomcat4x=Tomcat 4 Finally, the third part will depend on the previous 2. So, it looks to me that 2.2 is the easiest way. I changed cactus.jsl and manually modified the TESTS-TestSuites-Cactus.xml and it worked fine (see attachment). I still need to figure it out how to change the <testsutite> element automatically though. Felipe

          People

          • Assignee:
            Unassigned
            Reporter:
            Brett Porter
          • Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:

              Development