git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "Johannes Schindelin via GitGitGadget" <gitgitgadget@gmail.com>
Cc: git@vger.kernel.org, Johannes Schindelin <johannes.schindelin@gmx.de>
Subject: Re: [PATCH] tests(junit-xml): avoid invalid XML
Date: Mon, 23 Mar 2020 09:28:10 -0700	[thread overview]
Message-ID: <xmqqlfnr5945.fsf@gitster.c.googlers.com> (raw)
In-Reply-To: <pull.732.git.git.1584967475669.gitgitgadget@gmail.com> (Johannes Schindelin via GitGitGadget's message of "Mon, 23 Mar 2020 12:44:35 +0000")

"Johannes Schindelin via GitGitGadget" <gitgitgadget@gmail.com>
writes:

> From: Johannes Schindelin <johannes.schindelin@gmx.de>
>
> When a test case is run in a subshell, we finalize the JUnit-style XML
> when said subshell exits. But then we continue to write into that XML as
> if nothing had happened.
>
> This leads to Azure Pipelines' Publish Test Results task complaining:
>
> 	Failed to read /home/vsts/work/1/s/t/out/TEST-t0000-basic.xml.
> 	Error : Unexpected end tag. Line 110, position 5.
>
> And indeed, the resulting XML is incorrect.
>
> Let's "re-open" the XML in such a case, i.e. remove the previously added
> closing tags.
>
> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
> ---
>     Fix Azure Pipelines for t0000
>     
>     When running t0000 in our Azure Pipeline, the "Publish Test Results"
>     step complains about an invalid JUnit-style XML, and it is correct.
>     Let's fix that.

Hmph, I have a vague recollection that I've seen this one, looked at
the patch and even understood the issue.  Did I then forget to apply
it back then?  If so, apologies for failing to do so before the
release.

Will queue.

Thanks.

> Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-732%2Fdscho%2Fci-xml-error-v1
> Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-732/dscho/ci-xml-error-v1
> Pull-Request: https://github.com/git/git/pull/732
>
>  t/test-lib.sh | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/t/test-lib.sh b/t/test-lib.sh
> index 0ea1e5a05ed..7f0c02c016b 100644
> --- a/t/test-lib.sh
> +++ b/t/test-lib.sh
> @@ -1085,6 +1085,7 @@ finalize_junit_xml () {
>  		junit_time=$(test-tool date getnanos $junit_suite_start)
>  		sed -e "s/\(<testsuite.*\) time=\"[^\"]*\"/\1/" \
>  			-e "s/<testsuite [^>]*/& time=\"$junit_time\"/" \
> +			-e '/^ *<\/testsuite/d' \
>  			<"$junit_xml_path" >"$junit_xml_path.new"
>  		mv "$junit_xml_path.new" "$junit_xml_path"
>  
>
> base-commit: be8661a3286c67a5d4088f4226cbd7f8b76544b0

  reply	other threads:[~2020-03-23 16:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-23 12:44 [PATCH] tests(junit-xml): avoid invalid XML Johannes Schindelin via GitGitGadget
2020-03-23 16:28 ` Junio C Hamano [this message]
2020-03-23 20:56   ` Johannes Schindelin

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=xmqqlfnr5945.fsf@gitster.c.googlers.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    --cc=johannes.schindelin@gmx.de \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).