[PATCH 1/2] test-appliance: edit out xmlns from the result.xml file

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]



Commit b76a6cdb40b5 ("report: derive an xml schema for the xunit
report") in fstests upstream adds an xmlns attribute to the xunit
<testcase/> tag.  Unfortunately, this breaks the junitparser.py Python
package, since it uses lxml Python package, and by adding an xmlns
specifier, junitxml.py would need to know the schema and map that to
namespace tag.

So edit it out of the xml file using sed, which relies on the fact
that fstests will add the xmlns file on a single line.  The "right"
way would be to use an XSLT processor, but that would bloat the test
appliance significantly.  So we'll just cheat for now while we discuss
with fstests upstream whether adding the xmlns attribute is really
worth the pain and incompatibility that it causes.

Signed-off-by: Theodore Ts'o <tytso@xxxxxxx>
---
 test-appliance/files/root/runtests.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/test-appliance/files/root/runtests.sh b/test-appliance/files/root/runtests.sh
index 9b32d287..c4ddb739 100755
--- a/test-appliance/files/root/runtests.sh
+++ b/test-appliance/files/root/runtests.sh
@@ -23,6 +23,7 @@ function copy_xunit_results()
 
     if test -f "$RESULT"
     then
+	sed -i.orig -e 's/xmlns=\".*\"//' "$RESULT"
 	if test -f "$RESULTS"
 	then
 	    merge_xunit "$RESULTS" "$RESULT"
-- 
2.31.0




[Index of Archives]     [Linux Filesystems Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux