Bug 9682

Summary: enable xml output in OeTest class for report consumers
Product: [QA/Testing] Build Testing Reporter: Benjamin Esquivel <benjamin.esquivel>
Component: generalAssignee: Benjamin Esquivel <benjamin.esquivel>
Status: RESOLVED FIXED QA Contact: Francisco Pedraza <francisco.j.pedraza.gonzalez>
Severity: enhancement    
Priority: Medium+ CC: anibal.limon, belen.barros.pena, bluelightning, joshuagloe, leonardo.sandoval.gonzalez, michael.g.wood
Version: 2.2   
Target Milestone: 2.2 M2   
Hardware: x86   
OS: Multiple   
See Also: https://bugzilla.yoctoproject.org/show_bug.cgi?id=9954
https://bugzilla.yoctoproject.org/show_bug.cgi?id=9997
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)
Bug Depends on:    
Bug Blocks: 9954    
Attachments:
Description Flags
oe-selftest log with XML report generation
none
oe-selftest log with XML report functionality but NO library installed
none
xml sample output
none
pre and post xmlrunner text output none

Description Benjamin Esquivel 2016-05-27 22:06:47 UTC
Report consumers usually take JUnit xml formatted output and the OeTest class is incapable of adding this support.

The fact that OeTest uses the TextTestRunner, which is a sample implementation, makes it incompatible with the xmlrunner as it is a very limited design.

A standard implementation of the unittest.main() instead of the TextTestRunner would easily allow to get the xml output. The proposal is to move away from the TextTestRunner in favor of unittest.main()
Comment 1 Benjamin Esquivel 2016-07-21 15:50:28 UTC
Created attachment 3302 [details]
oe-selftest log with XML report generation
Comment 2 Benjamin Esquivel 2016-07-21 15:52:39 UTC
Created attachment 3303 [details]
oe-selftest log with XML report functionality but NO library installed

The attachment shows how oe-selftest log defaults to the no XML results reporting when the module is not installed. Keeping the previous functionality intact.
Comment 3 Benjamin Esquivel 2016-07-21 19:19:12 UTC
Created attachment 3304 [details]
xml sample output

Attaching sample XML output of 3 bitbake tests
Comment 4 Benjamin Esquivel 2016-07-21 20:02:31 UTC
Created attachment 3305 [details]
pre and post xmlrunner text output

collateral changes in the text output of oe-selftest listed at the attachment. This will be addressed with a different bug so it can be proposed at the xmlrunner code.