<div dir="ltr"><div>I'm in the middle of moving our CI infrastructure to the Docker environment we've been using internally for a while.  This has brought to light 2 issues that I had to work around when originally setting up that infrastructure...</div><div><br></div><div>The XML results files generated from the unit tests and the testsuite were supposed to be jUnit compatible so they can be easily read by Jenkins.  Neither is in fact.  Worse, their XML structures differ.  The Testsuite's top level element is "testsuites" and has 1 child element "testsuite".  The unit test output omits the top level <span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">"testsuites" and has just <span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">"testsuite" as it's top level element.</span></span></div><div><span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><br></span></span></div><div><span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">Both XML files use '/' to separate the test name components as though they were path names but jUnit expects package and classname style names.</span></span></div><div><span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><br></span></span></div><div><span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">Neither XML files munge test names with Java reserved words in them.</span></span></div><div><span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><br></span></span></div><div>In the current internal environment, I have to run a groovy script to reformat the results XML but I'd like to eliminate that script altogether by making the native output jUnit compatible as it should have been originally.</div><div><br></div><div><ol><li> Add a "testsuites" top level element to the unit tests to make the structure the same as the testsuite.<br></li><li> Change the testcase name construction:</li><ol><li>Split the "name" attribute of the "testcase" elements to the proper "classname" and "name" attributes.  All but the last component of the current name would go in the classname and the final component in the name.</li><li>Add a '_' prefix to test name components that are reserved words.</li><li>Remove common path prefixes like "tests".</li><li>All '/' separators remaining in classname would be changed to '.'.</li></ol></ol></div><div>Example:<br></div><div>name="tests/channels/pjsip/native/accountcode"</div><div>would become</div><div><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial">classname="<span style="background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">channels.pjsip._native</span>" name="accountcode"</div><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial"><br></div><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial">I'd like to do this this week in all branches.</div><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial"><br></div><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial">Thoughts?</div><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial"><br></div><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial"><br></div><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial"><br></div><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial"><br></div><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial"><br></div><br class="gmail-Apple-interchange-newline"><br></div><div><br></div><div><br></div><div><br></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><span style="font-size:12.8px">George Joseph</span><br style="font-size:12.8px"><span style="font-size:12.8px">Digium, Inc. | Software Developer</span><span style="font-size:12.8px"><br>445 Jan Davis Drive NW - Huntsville, AL 35806 - US<br></span><span style="font-size:12.8px">Check us out at: </span><a href="http://www.digium.com/" rel="noreferrer" style="color:rgb(17,85,204);font-size:12.8px" target="_blank">www.digium.com</a><span style="font-size:12.8px"> & </span><a href="http://www.asterisk.org/" rel="noreferrer" style="color:rgb(17,85,204);font-size:12.8px" target="_blank">www.asterisk.org</a><br><div><br></div></div></div></div>