Jenkins TestNG plugin - no reports generated

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Jenkins TestNG plugin - no reports generated

anand.dandekar
Hi Tarun,

I watched the Jenkins video and set up my maven project in a similar way. I installed the TestNG plugin on Jenkins. I ran the build 3-4 times. When I click on the TestNG results link, it says "No builds have successfully recorded TestNG results yet". I have configured the path to my testng-results.xml as described in the video.

Any ideas why it is not showing results ? I have attached the screen shot.

My POM.xml file contains this :
          <dependencies>
                <dependency>
                        <groupId>xml-apis</groupId>
                        <artifactId>xml-apis</artifactId>
                        <version>1.4.01</version>
                        <scope>runtime</scope>
                </dependency>
                <dependency>
                        <groupId>org.seleniumhq.selenium</groupId>
                        <artifactId>selenium-server</artifactId>
                        <version>2.33.0</version>
                        <scope>test</scope>
                </dependency>
                <dependency>
                        <groupId>org.testng</groupId>
                        <artifactId>testng</artifactId>
                        <version>6.8.5</version>
                        <scope>test</scope>
                </dependency>

        </dependencies>


        <build>
                <plugins>
                        <plugin>
                                <groupId>org.apache.maven.plugins</groupId>
                                <artifactId>maven-compiler-plugin</artifactId>
                                <version>3.0</version>
                                <configuration>
                                        <source>1.5</source>
                                        <target>1.5</target>
                                </configuration>
                        </plugin>
                        <plugin>
                                <groupId>org.apache.maven.plugins</groupId>
                                <artifactId>maven-surefire-plugin</artifactId>
                                <version>2.15</version>
                                <configuration>
                                        <suiteXmlFiles>
                                                <suiteXmlFile>master.xml</suiteXmlFile>
                                        </suiteXmlFiles>
                                </configuration>
                        </plugin>
                </plugins>
        </build>

Reply | Threaded
Open this post in threaded view
|

Re: Jenkins TestNG plugin - no reports generated

softwaretestingforum
Administrator
Hi Anand, What do you see on Build Console when you trigger the build?
Does it show you test run status?
~ seleniumtests.com
Reply | Threaded
Open this post in threaded view
|

Re: Jenkins TestNG plugin - no reports generated

anand.dandekar
If you are talking about the Console output then yes, i see the tests ran successfully.
I can also see the Test Result Trend in  graph. Yet, when I click on TestNG results link, it is showing me same thing, that "no builds have successfully recorded TestNG results yet."
Is there any configuration that I might be missing?
Reply | Threaded
Open this post in threaded view
|

Re: Jenkins TestNG plugin - no reports generated

softwaretestingforum
Administrator
I had a look at testng version in my pom. I am using 6.3.1, could you try with this?
I found this thread and most have been talking about testng version -

https://issues.jenkins-ci.org/browse/JENKINS-2433?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel

If it does not help, then I would suggest to uninstall and reinstall testng plugin and run tests again.

Do keep us posted on your progress.
~ seleniumtests.com
Reply | Threaded
Open this post in threaded view
|

Re: Jenkins TestNG plugin - no reports generated

anand.dandekar
I modified my pom.xml to have TestNG version 6.3.1 instead of 6.8.1 : did not work.
I uninstalled and re-installed the plugin in Jenkins: did not work.

But I observed this message on Console Output after the tests ran:

TestNG Reports Processing: START
Looking for TestNG results report in workspace using pattern: H:\Maven Projects\automation\target\surefire-reports\testng-results.xml
Did not find any matching files.


I thought because there is a space in my folder name 'Maven Projects' it is not able to find the file. So removed the space but still I have the same line:

Looking for TestNG results report in workspace using pattern: H:\MavenProjects\automation\target\surefire-reports\testng-results.xml
Did not find any matching files.


Also, I observed that, in the project configuration section, when I give the wrong path deliberately, jenkins does not tell me that it can not find the file on the path. While, if I mention the wrong path to y pom.xml, it gives me the error in red saying that there is no such file on this path. I expected jenkins to give me the same error on my 'TestNG XML Report Pattern' section under configuration.

Then I watched your video once again, and found out that you have 'forward slashes' in the testng-results.xml path. I had copied the path and it contained backslashes. I changed them to forward slashes. When I ran, it could find the file and I saw this on the console output :

TestNG Reports Processing: START
Looking for TestNG results report in workspace using pattern: H:/MavenProjects/automation/target/surefire-reports/testng-results.xml
Saving reports...
Processing 'C:\Users\anandd\.jenkins\jobs\desktop_automation\builds\2013-07-29_10-24-35\testng\testng-results.xml'
TestNG Reports Processing: FINISH


What is interesting is it does not give any error if it does not understand the backslashes. Don't know why.
Anyway, the issue has been resolved.
Reply | Threaded
Open this post in threaded view
|

Re: Jenkins TestNG plugin - no reports generated

softwaretestingforum
Administrator
Could you manually check that testng-result.xml file is available in this location when jenkins processes it -

C:\Users\anandd\.jenkins\jobs\desktop_automation\builds\2013-07-29_10-24-35\testng\testng-results.xml

Please notice this path would change with each run of test.
If file is available and you see

TestNG Reports Processing: FINISH

Towards end of test then you should as well see TestNG results

If all goes well then can you execute test thrice and click on TestNG link in jenkins to find if results are being ported on jenkins
~ seleniumtests.com
Reply | Threaded
Open this post in threaded view
|

Re: Jenkins TestNG plugin - no reports generated

Shaurya Singh
In reply to this post by anand.dandekar
Hi ,

Thanks Anand for your close observation into the thing as I was also tensed because of the same issue since last two three days.

Thanks again
Reply | Threaded
Open this post in threaded view
|

Re: Jenkins TestNG plugin - no reports generated

Goochie_007
This post was updated on .
Not to beat a dead horse already but just wanted to share another observation in TestNG, Jenkins and Maven integration.

1) TestNG has a 'test-output' directory and this has testng-results.xml.
2) Maven's 'target' directory also contains the testng-results.xml.

So when I used #1 location in Jenkins TestNG plugin to spit out test results, I always ended up with -
"TestNG Reports Processing: START
Looking for TestNG results report in workspace using pattern: /{yourtestworkspacelocation}/test-output/testng-results.xml
testng-results.xml was last modified before this build started. Ignoring it.
Saving reports...
Found matching files but did not find any TestNG results.
Finished: SUCCESS"

But when I noticed #2 and used this testng xml location, my jenkin'ized'-maven builds are displaying testng results as expected.


Thanks to the moderators/forum owners for sharing such information with the globe, this is good.