Service Virtualization

Expand all | Collapse all

Test Report doesn't show in Reporting Dashboard when a test suite is run with the help of JUNIT and ANT

Marcy Nunns

Marcy NunnsJul 13, 2017 09:28 AM

Shiney Abraham

Shiney AbrahamJul 17, 2017 11:36 AM

  • 1.  Test Report doesn't show in Reporting Dashboard when a test suite is run with the help of JUNIT and ANT

    Posted Jul 12, 2017 07:56 PM

    Hi,

       I am trying to execute Devtest Tests and Suites as JUNIT tests with the help of using ANT build. i followed the tutorials and some useful resources from CA communities pages and have created the set up required.

    created AntTasks.properties, build.xml, build.properties in the base directory of my Ant Project.

     

     

    i have two targets in my build.xml

     

    one target is call JunitTest and another is called JunitSuite and have tests specified in the each "lisatest" inside the "junitlisa" for the former and for the later had test suite specified.

     When i run build JunitTest it execute fine and published junit report as well as report in devtest console and portal.

     

    However when i run the ant build like build JunitSuite, the suite executes by executing tests in the suite in my case two tests and a junit report also is being produced but i dont see any report in dashboard in devtest console and also in devtest portal (CAI) under monitoring and tests.

     

    Can anyone point me if i m missing anything. 



  • 2.  Re: Test Report doesn't show in Reporting Dashboard when a test suite is run with the help of JUNIT and ANT

    Broadcom Employee
    Posted Jul 13, 2017 09:28 AM

    What version of DevTest are you on?



  • 3.  Re: Test Report doesn't show in Reporting Dashboard when a test suite is run with the help of JUNIT and ANT

    Posted Sep 13, 2017 02:22 PM

    Hi Marcy i tried it on both 9.1.0 and 10.1.0 but i still could not see results of a test suite in Monitor > Tests of CAI



  • 4.  Re: Test Report doesn't show in Reporting Dashboard when a test suite is run with the help of JUNIT and ANT

    Broadcom Employee
    Posted Jul 17, 2017 11:36 AM

    Can you upload your build.xml file ? 



  • 5.  Re: Test Report doesn't show in Reporting Dashboard when a test suite is run with the help of JUNIT and ANT

    Posted Jul 17, 2017 11:46 AM

    I am on Devtest 9.1.0 and here is my build.xml file.

     

    <?xml version="1.0"?>
    <project name="JUnit_Project" default="JUnit_Project" basedir=".">
    <loadproperties>
        <file file="build.properties"/>
    </loadproperties>
    <echo message="Project Base directory is ${basedir}"/>
    <echo message="LISA HOME directory is ${LISA_HOME}"/>

     

        <taskdef resource="AntTasks.properties">
            <classpath>                                        
                <fileset dir="${LISA_HOME}\lib\shared" includes="**/*.jar"></fileset>
                <fileset dir="${LISA_HOME}\lib\endorsed" includes="*.jar"/>
                <fileset dir="${LISA_HOME}\lib\core" includes="**/*.jar"></fileset>
            </classpath>
        </taskdef>
    <target name="JUnitTests" description="Executes a Test case.">                          
            <!-- If you are not using ACL, please comment the following lines until specified. -->
            <input message="$DevTest user:" addproperty="userName" />
            <input message="$DevTest password:" addproperty="password">
                <handler classname="org.apache.tools.ant.input.SecureInputHandler" />
            </input>
            <!-- If you are not using ACL, please comment the previous lines until here. -->
            
            <echo message="Delete Old Report directory"/>
            <delete dir="${project.build.report.dir}"/>
            <echo message="Create Report directory"/>
            <mkdir dir="${project.build.report.dir}"/>
            
            <echo message="Executes a LISA Test"/>
            <echo message="Run the lisa test in junit mode in base dir:${basedir}"/>

     

            <junitlisa toDir="${project.build.report.dir}"
                   registry="${DevTestRegistry}"
                   haltOnError="no"
                   errorProperty="test.failure"
                   stagingDoc="${basedir}/Tests/StagingDocs/Run1User1CyclePF.stg"
                   user="${userName}"
                   password="${password}">
                <lisatest test="${basedir}/Tests/Hello.tst"
                      stagingDoc="${basedir}/Tests/StagingDocs/Run1User1CyclePF.stg">
                </lisatest>
                <lisatest test="${basedir}/Tests/ListDirectories.tst"
                      stagingDoc="${basedir}/Tests/StagingDocs/Run1User1CyclePF.stg">
                </lisatest>
                
                <jvmarg value="-Dlisa.tmpdir=${project.build.temp.dir}"/>
            </junitlisa>

     

            <junitlisareport toDir="${project.build.report.dir}"/>
            <echo  message="The JUnit report is available at ${project.build.report.dir}/index.html"/>
        </target>
    <target name="JUnitSuites" description="Executes a LISA Suite.">                          
            <!-- If you are not using ACL, please comment the following lines until specified. -->
            <input message="$DevTest user:" addproperty="userName" />
            <input message="$DevTest password:" addproperty="password">
                <handler classname="org.apache.tools.ant.input.SecureInputHandler" />
            </input>
            <!-- If you are not using ACL, please comment the previous lines until here. -->
            
            <echo message="Delete Old Report directory"/>
            <delete dir="${project.build.report.dir}"/>
            <echo message="Create Report directory"/>
            <mkdir dir="${project.build.report.dir}"/>
            
            <echo message="Executes a LISA Suite"/>
            <echo message="Run the lisa test in junit mode in base dir:${basedir}"/>
        
                   <junitlisa     toDir="${project.build.report.dir}"
                        registry="${DevTestRegistry}"
                        haltOnError="no"
                        errorProperty="test.failure"
                        user="${userName}"
                        password="${password}">
                    <lisatest suite ="${basedir}/Tests/Suites/Suite1.ste"/>
                    <lisatest suite ="${basedir}/Tests/Suites/Suite2.ste"/>
                    <lisatest suite ="${basedir}/Tests/Suites/Suite3.ste"/>                  
                    <jvmarg value="-Dlisa.tmpdir=${project.build.temp.dir}"/>
            </junitlisa>
            <junitlisareport toDir="${project.build.report.dir}"/>
            <echo  message="The JUnit report is available at ${project.build.report.dir}/index.html"/>
        </target>
    </project>



  • 6.  Re: Test Report doesn't show in Reporting Dashboard when a test suite is run with the help of JUNIT and ANT

    Broadcom Employee
    Posted Jul 17, 2017 01:03 PM

    Ebenezer,  I am able to see the Suite reports using the default build.xml  that we ship with DEVTEST.  

    C:\DEVTEST9.1GA\examples\build.xml

     

    Can you try using the sample ? 



  • 7.  Re: Test Report doesn't show in Reporting Dashboard when a test suite is run with the help of JUNIT and ANT

    Posted Aug 18, 2017 12:47 PM

    Hi Shiney,

     

    Even I face same issue when we execute as test suite, but able to see the link for each test case separately in Jenkins console something like this. Can't see the whole suite in Monitor -> Tests

    devtest/#/main/testMonitorTests/detail//8621D465843011E787770242AC110003//0


  • 8.  Re: Test Report doesn't show in Reporting Dashboard when a test suite is run with the help of JUNIT and ANT

    Posted Jul 24, 2017 09:17 AM

    Ebenezer,

    Were you able to run the sample that Shiney recommended?



  • 9.  Re: Test Report doesn't show in Reporting Dashboard when a test suite is run with the help of JUNIT and ANT

    Posted Sep 13, 2017 03:07 PM

    Hi Reid, i need some instructions to run the shipped build.xml file in examples, can you explain me steps at a higher level.



  • 10.  Re: Test Report doesn't show in Reporting Dashboard when a test suite is run with the help of JUNIT and ANT

    Broadcom Employee
    Posted Sep 15, 2017 05:10 PM

    Ebenezar,  in DevTest Home examples folder , you have a build.xml file that configured to run  one Test  and  the AllTestSuite.ste

     

    Here are the steps to follow:

    ******************************

    Set ANT_HOME = C:\ANT1.9\apache-ant-x.x\
     Add it to the path =;C:\ANT1.9\apache-ant-x.x\bin

    in the environment variables.

     

    1. To run one test

    • The oneTest target runs a test case as a JUnit test. The test case is specified with the test attribute.

     

      In the build.xml we provide the name of the testcase  and the path as below

    <junitlisa toDir="${testReportDir}"
    test="Tests/DevTest_config_info.tst"
    stagingDoc="StagingDocs/1User0Think_RunContinuously.stg"
    user="admin"
    password="admin"
    registry="tcp://10.xx.xx.***:2010/Registry">
    <jvmarg value="-Dlisa.tmpdir=${lisa.temp.dir}"/>
    </junitlisa>

     

    Open a command window, and navigate to the example project.. 

    Devtest/example:>ant oneTest

     

    2. To run a suite

    • The lisaTests target runs a suite as JUnit tests. The suite is specified with the lisatest nested element.

    suite test part…
    <junitlisa toDir="${testReportDir}"
    user="admin"
    password="admin"
    registry="tcp://10.xx.xx.***:2010/Registry">
    <jvmarg value="-Dlisa.tmpdir=${lisa.temp.dir}"/>
    <lisatest suite="${basedir}/Suites/AllTestsSuite.ste"/>
    </junitlisa>

     

    in the Command window

     

    Devtest/example:>ant    ( this will run the suite) 

     

     

    hope this helps.  

     

    if you still have questions,  please open a new ticket with CA Support. 



  • 11.  Re: Test Report doesn't show in Reporting Dashboard when a test suite is run with the help of JUNIT and ANT

    Posted Sep 18, 2017 11:30 PM

    Thanks for the instructions, i tried with the shipped build.xml, it worked fine and i was able to see test suite in the CAI under monitor > Tests

    However when i use the same file and change according to test suite of my project, it is not working. I assume that it works for the tests which are shipped as part of the examples project only.



  • 12.  Re: Test Report doesn't show in Reporting Dashboard when a test suite is run with the help of JUNIT and ANT
    Best Answer

    Broadcom Employee
    Posted Sep 20, 2017 02:26 PM

    Please open a ticket with CA support.  We can look at the issue in a Webex.  

     

    Thanks



  • 13.  Re: Test Report doesn't show in Reporting Dashboard when a test suite is run with the help of JUNIT and ANT

    Posted Sep 20, 2017 02:05 PM

    Hi Shiney,

     

    Yeah, still we have issue with the Junit as Suite. we are not seeing the results in portal, but in Junit console we see seperate urls' for each test case. We have everything in one machine now(Jenkins and DevTest)



  • 14.  Re: Test Report doesn't show in Reporting Dashboard when a test suite is run with the help of JUNIT and ANT

    Posted Aug 18, 2017 03:34 PM

    I faced a similar issue but I didn't use JUNIT/Ant . I used the test runner command from the Jenkins job to run a suite and it was fixed with a patch from CA Support for Devtest 10.0 Version



  • 15.  Re: Test Report doesn't show in Reporting Dashboard when a test suite is run with the help of JUNIT and ANT

    Posted Sep 13, 2017 02:33 PM

    Hi Senthil, 

       Glad it worked for you when you ran as devtest runner. I have DevTest 10.1.0 as well, i will try to give it a try using test runner and see if im able to see the results under MOnitor > Tests in CAI



  • 16.  Re: Test Report doesn't show in Reporting Dashboard when a test suite is run with the help of JUNIT and ANT

    Posted Sep 13, 2017 03:30 PM

    Shiney,

    Can you help explain the instructions to run the shipped build.xml file in examples, can you explain me steps at a higher level?



  • 17.  Re: Test Report doesn't show in Reporting Dashboard when a test suite is run with the help of JUNIT and ANT

    Posted Oct 23, 2017 04:25 PM

    Can anyone try this on a Linux version , I tried but did not workout.



  • 18.  Re: Test Report doesn't show in Reporting Dashboard when a test suite is run with the help of JUNIT and ANT

    Posted Nov 09, 2017 08:01 AM

    I am having same issue fixed by patch,not sure how to share



  • 19.  Re: Test Report doesn't show in Reporting Dashboard when a test suite is run with the help of JUNIT and ANT

    Posted Nov 10, 2017 02:26 PM

    what was the patch? I have both Jenkins and registry on same machine. 



  • 20.  Re: Test Report doesn't show in Reporting Dashboard when a test suite is run with the help of JUNIT and ANT

    Posted Nov 15, 2017 03:36 AM

    patch_DE322145_10.1_GA.jar patch added to my server and working as expected



  • 21.  Re: Test Report doesn't show in Reporting Dashboard when a test suite is run with the help of JUNIT and ANT

    Posted Nov 16, 2017 03:26 PM

    where to get that patch? should we add in hot deploy or lib/shared?



  • 22.  Re: Test Report doesn't show in Reporting Dashboard when a test suite is run with the help of JUNIT and ANT

    Posted Nov 17, 2017 03:40 AM

    00866908-my support ticket can't share from client location,please get it from ca support using my ticket as reference.

     

    please place it under lib/patches



  • 23.  Re: Test Report doesn't show in Reporting Dashboard when a test suite is run with the help of JUNIT and ANT

    Posted Nov 09, 2017 08:04 AM

    And Make sure your worstation/machine where running build.xml has access to registery Database