how to configure paths for "Publish JUnit test result report" plugin

17,799 views
Skip to first unread message

Z W

unread,
Dec 25, 2012, 3:47:29 PM12/25/12
to jenkins...@googlegroups.com
Hi All

We have different projects in a a build job producing different
subdirectories of xml test results file
How do we configure multiple paths in plugin "Publish JUnit test
result report" to get the test results file from different directories
path; paths are not similar.

thanks

Harpreet singh Wadhwa

unread,
Dec 26, 2012, 10:14:52 AM12/26/12
to jenkins...@googlegroups.com
Regular expression is the key :-)
example: "**/Test-*.xml"

This will get all the files starting with Test and ending with xml (from any directory inside workspace).

Thanks

KEVIN FLEMING (BLOOMBERG/ 731 LEXIN)

unread,
Dec 26, 2012, 10:16:30 AM12/26/12
to jenkins...@googlegroups.com
That's not a regular expression, it's an Ant pattern expression. They are quite different, and serve different purposes.


From:jenkins...@googlegroups.com
To:jenkins...@googlegroups.com
Date:12/26 10:15


zw

unread,
Dec 26, 2012, 11:50:01 AM12/26/12
to jenkins...@googlegroups.com
Hi Harpreet 

My question isnt tied to one directory; 
eg **/Test-*.xml may be one but I have another set of test results under **/target/surefire-reports/*.xml

Question: How do I input in that plugin box to pick up both 2 different test results directories ?

Thanks

zw

unread,
Dec 26, 2012, 11:50:55 AM12/26/12
to jenkins...@googlegroups.com, KEVIN FLEMING
Hi Kevin

Thanks for responding.

My question isnt tied to one directory; 
eg **/Test-*.xml may be one but I have another set of test results under **/target/surefire-reports/*.xml

Question: How do I input in that plugin box to pick up both 2 different test results directories ?

Thanks


KEVIN FLEMING (BLOOMBERG/ 731 LEXIN)

unread,
Dec 26, 2012, 2:20:27 PM12/26/12
to jenkins...@googlegroups.com
A simple pattern of "**/*.xml" will collect *all* XML files in the entire workspace. If there are XML files the plugin should not inspect, then you'll have to ensure that the test result files all have some common portion of their name. For example, if all of your test result files had names that ended with "-test.xml", then "**/*-test.xml" would collect all of them, regardless of which directory they are located in. This is what the previous example was trying to show you, the "**" pattern is special and it means search all subdirectories.


From:mpc...@gmail.com
To:jenkins...@googlegroups.com
Cc:KEVIN FLEMING (BLOOMBERG/ 731 LEXIN)
Date:12/26 11:51


Harpreet singh Wadhwa

unread,
Dec 26, 2012, 6:02:32 PM12/26/12
to jenkins...@googlegroups.com, KEVIN FLEMING
@Kevin
Thanks for correcting me (on not a regex)

@zw
For you this will work. as it searches in all directories under Workspace (in this case)

Thanks

Md. Humayun Kabir Rana

unread,
Nov 26, 2014, 2:03:09 AM11/26/14
to jenkins...@googlegroups.com
But, How I will generate xml file I could not understand. and Where I will put this xml file pls

Ng, Jeff

unread,
Nov 26, 2014, 1:30:41 PM11/26/14
to jenkins...@googlegroups.com

Here’s what I do for JUnit and Emma reports:

 

1.  In the job configuration, I have a build step (execute shell) prior to executing the build, that creates a directory in the WORKSPACE for each report type (e.g. mkdir –p “${WORKSPACE}/junit-test-results”).

2.  In the build step where I execute my build target (in my case, using ant), I specify the output directory for all JUnit reports (e.g. ant –Dreport.dir=${WORKSPACE}/junit-test-results build).

3.  I do the same, but specifying the different workspace directory, for Emma when running my “coverage” ant target.

4.  Now, down in the “Post-build Actions” section, as the previous posters stated, use the Ant pattern expression to find the .xml in your workspace directory (i.e. **/junit-test-results/*.xml).

 

-Jeff Ng

 

From: jenkins...@googlegroups.com [mailto:jenkins...@googlegroups.com] On Behalf Of Md. Humayun Kabir Rana
Sent: Wednesday, November 26, 2014 12:03 AM
To: jenkins...@googlegroups.com
Subject: EXTERNAL: Re: how to configure paths for "Publish JUnit test result report" plugin

 

But, How I will generate xml file I could not understand. and Where I will put this xml file pls

On Wednesday, December 26, 2012 9:14:52 PM UTC+6, Harpreet singh Wadhwa wrote:

Regular expression is the key :-)

example: "**/Test-*.xml"

 

This will get all the files starting with Test and ending with xml (from any directory inside workspace).

 

Thanks

 

On Tue, Dec 25, 2012 at 12:47 PM, Z W <mpc...@gmail.com> wrote:

Hi All

We have different projects in a a build job producing different
subdirectories of xml test results file
How do we configure multiple paths in plugin "Publish JUnit test
result report" to get the test results file from different directories
path; paths are not similar.

thanks



 

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/9bed537c-92bb-46d6-938e-95183bd1ebe9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages