public inbox for fstests@vger.kernel.org
 help / color / mirror / Atom feed
From: Eryu Guan <guaneryu@gmail.com>
To: Theodore Ts'o <tytso@mit.edu>
Cc: fstests@vger.kernel.org
Subject: Re: [PATCH RESEND] report: gracefully handle XML report creation when no tests are run
Date: Sun, 16 Jun 2019 21:22:59 +0800	[thread overview]
Message-ID: <20190616132259.GB15846@desktop> (raw)
In-Reply-To: <20190609210431.26373-1-tytso@mit.edu>

On Sun, Jun 09, 2019 at 05:04:31PM -0400, Theodore Ts'o wrote:
> If no tests are run (because they have all been excluded) then make
> sure we insert a valid timestamp into the XML file, and avoid printing
> an error message when reading a non-existent test summary scratch
> file.
> 
> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
> ---
> 
> I sent this a while back, and didn't get any comments, so I'm resending.  PTAL.

Sorry, I totally missed it.. applied now, thanks!

Eryu

> 
>  common/report | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/common/report b/common/report
> index fb00b402..6cac71fc 100644
> --- a/common/report
> +++ b/common/report
> @@ -59,6 +59,9 @@ _xunit_make_section_report()
>  	local report=$tmp.report.xunit.$sect_name.xml
>  	# Header
>  	echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" > $REPORT_DIR/result.xml
> +	if [ -z "$date_time" ]; then
> +		date_time=$(date +"%F %T")
> +	fi
>  	local dtime=`echo $date_time| tr  " " 'T'`
>  	local stats="failures=\"$n_bad\" skipped=\"$n_notrun\" tests=\"$n_total\" time=\"$sect_time\""
>  	local hw_info="hostname=\"$HOST\" timestamp=\"$dtime\" "
> @@ -70,7 +73,9 @@ _xunit_make_section_report()
>  		_xunit_add_property "$p"
>  	done
>  	echo -e "\t</properties>" >> $REPORT_DIR/result.xml
> -	cat $tmp.report.xunit.$sect_name.xml >> $REPORT_DIR/result.xml
> +	if [ -f $report ]; then
> +		cat $report >> $REPORT_DIR/result.xml
> +	fi
>  	echo "</testsuite>" >> $REPORT_DIR/result.xml
>  	echo "Xunit report: $REPORT_DIR/result.xml"
>  }
> -- 
> 2.22.0
> 

      reply	other threads:[~2019-06-16 13:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-09 21:04 [PATCH RESEND] report: gracefully handle XML report creation when no tests are run Theodore Ts'o
2019-06-16 13:22 ` Eryu Guan [this message]

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=20190616132259.GB15846@desktop \
    --to=guaneryu@gmail.com \
    --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