FS/XFS testing framework
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <djwong@kernel.org>
To: Theodore Ts'o <tytso@mit.edu>
Cc: fstests@vger.kernel.org
Subject: Re: [PATCH 1/2] test-appliance: edit out xmlns from the result.xml file
Date: Fri, 21 Apr 2023 18:45:56 -0700	[thread overview]
Message-ID: <20230422014556.GR360895@frogsfrogsfrogs> (raw)
In-Reply-To: <20230420160837.1083228-2-tytso@mit.edu>

On Thu, Apr 20, 2023 at 12:08:36PM -0400, Theodore Ts'o wrote:
> 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@mit.edu>
> ---
>  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"

FWIW I wouldn't mind commenting out the xmlns bits in common/report.

Some XML parsers have this annoying quirk that as soon as anyone
attaches a namespace to the document, every query against that document
has to reference the given namespace explicitly.

Though really, the *frustrating* thing is that in order to enable
automatic validation via the schema document, one has to embed the
xsi:schemaLocation attribute, which forces you to put in a namespace.
Then un-namespaced queries fail, and yay XML. :?

Thoughts?

--D

>  	if test -f "$RESULTS"
>  	then
>  	    merge_xunit "$RESULTS" "$RESULT"
> -- 
> 2.31.0
> 

  reply	other threads:[~2023-04-22  1:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-20 16:08 [PATCH 0/2] Work around various report.xml compatibility issues Theodore Ts'o
2023-04-20 16:08 ` [PATCH 1/2] test-appliance: edit out xmlns from the result.xml file Theodore Ts'o
2023-04-22  1:45   ` Darrick J. Wong [this message]
2023-04-20 16:08 ` [PATCH 2/2] test-appliance: support a timestamp specifier which contains a timezone Theodore Ts'o
2023-04-22  1:49   ` Darrick J. Wong
  -- strict thread matches above, loose matches on Subject: below --
2023-04-20  3:20 [PATCH 0/2] Work around various report.xml compatibility issues Theodore Ts'o
2023-04-20  3:20 ` [PATCH 1/2] test-appliance: edit out xmlns from the result.xml file Theodore Ts'o

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230422014556.GR360895@frogsfrogsfrogs \
    --to=djwong@kernel.org \
    --cc=fstests@vger.kernel.org \
    --cc=tytso@mit.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox