Bug 1291112

Summary: [RFE] improve appearance of result names when JUnit XML is imported into Jenkins
Product: [Retired] Beaker Reporter: Dan Callaghan <dcallagh>
Component: generalAssignee: Dan Callaghan <dcallagh>
Status: CLOSED CURRENTRELEASE QA Contact: tools-bugs <tools-bugs>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: developCC: bpeck, dcallagh, dowang, mjia, rjoost
Target Milestone: 22.0Keywords: FutureFeature, Patch
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-01-14 05:34:03 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Dan Callaghan 2015-12-14 02:05:57 UTC
The Beaker results model does not match JUnit's very closely at all, so when Beaker is generating JUnit XML formatted results we have to kind of cram it in. There are a few corner cases which currently do not work very well.

The JUnit XML format has package, class, and name (as in, Java package, Java class, and test method name) which is supposed to correspond to the JUnit test methods. Jenkins displays these as <package>.<class>.<name>.

In Beaker we have tasks with filesystem-path-style names (e.g. /distribution/beaker/dogfood) and task results. In the RHTS tradition the results are named after the task with a path suffix (e.g. /distribution/beaker/dogfood/yum_install) but there are many other possibilities. For example, Beakerlib uses plain hyphen-separated result names (no slashes) and Beaker itself has the special /start result for the installation.

Currently to produce the JUnit XML we put the task name into class="" and the result name into name="", re-using the web UI's result prefix stripping logic. That works well for some common cases:

Task /distribution/beaker/dogfood
Result /distribution/beaker/dogfood/yum_install
in Jenkins appears as /distribution/beaker/dogfood.yum_install

Task /distribution/beaker/setup
Result Build-Beaker-from-git
in Jenkins appears as /distribution/beaker/setup.Build-Beaker-from-git

However the common case of:
Task /distribution/beaker/dogfood
Result /distribution/beaker/dogfood
appears in Jenkins as /distribution/beaker/dogfood../
but should probably instead be /distribution/beaker/dogfood.(none)
We want name="(none)" to distinguish it from the overall task which has no name="" attribute.

Also the ubiquitous installation result:
Task /distribution/install
Result /start
appears in Jenkins as /distribution/install./start
We should strip leading slashes from the result names.

Internal slashes are okay, as in
/distribution/beaker/dogfood.rhts_task/exit
which is suboptimal but makes reasonable sense.

Comment 1 Dan Callaghan 2015-12-14 02:07:14 UTC
Bill, adding you to cc in case you have any other thoughts about this.

Comment 2 Dan Callaghan 2015-12-14 23:39:43 UTC
http://gerrit.beaker-project.org/4539

Comment 3 Bill Peck 2015-12-14 23:42:04 UTC
Thanks Dan,

Your explanation and proposal makes sense to me.

Comment 6 Dan Callaghan 2016-01-14 05:34:03 UTC
Beaker 22.0 has been released.