[asterisk-dev] Unit test and Testsuite xml result files, and Docker CI Move
George Joseph
gjoseph at digium.com
Thu Jul 5 13:40:50 CDT 2018
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...
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 "testsuites" and has just "testsuite"
as it's top level element.
Both XML files use '/' to separate the test name components as though they
were path names but jUnit expects package and classname style names.
Neither XML files munge test names with Java reserved words in them.
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.
1. Add a "testsuites" top level element to the unit tests to make the
structure the same as the testsuite.
2. Change the testcase name construction:
1. 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.
2. Add a '_' prefix to test name components that are reserved words.
3. Remove common path prefixes like "tests".
4. All '/' separators remaining in classname would be changed to '.'.
Example:
name="tests/channels/pjsip/native/accountcode"
would become
classname="channels.pjsip._native" name="accountcode"
I'd like to do this this week in all branches.
Thoughts?
--
George Joseph
Digium, Inc. | Software Developer
445 Jan Davis Drive NW - Huntsville, AL 35806 - US
Check us out at: www.digium.com & www.asterisk.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20180705/1177809d/attachment.html>
More information about the asterisk-dev
mailing list