From: Qu Wenruo <quwenruo.btrfs@gmx.com>
To: "Darrick J. Wong" <djwong@kernel.org>, zlang@redhat.com
Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org, guan@eryu.me,
leah.rumancik@gmail.com
Subject: Re: [PATCH 3/8] report: capture the time zone in the test report timestamp
Date: Tue, 20 Dec 2022 10:19:57 +0800 [thread overview]
Message-ID: <51d9d9af-1302-e555-ca8a-c57a5a89b848@gmx.com> (raw)
In-Reply-To: <167149448068.332657.14583277548579655582.stgit@magnolia>
On 2022/12/20 08:01, Darrick J. Wong wrote:
> From: Darrick J. Wong <djwong@kernel.org>
>
> Make sure we put the time zone of the system running the test in the
> timestamp that is recorded in the xunit report. `date "+%F %T"' reports
> the local time zone, not UTC.
>
> Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Qu Wenruo <wqu@suse.com>
Thanks,
Qu
> ---
> common/report | 9 ++++++---
> doc/xunit.xsd | 2 +-
> 2 files changed, 7 insertions(+), 4 deletions(-)
>
>
> diff --git a/common/report b/common/report
> index 1d84650270..1817132d51 100644
> --- a/common/report
> +++ b/common/report
> @@ -38,6 +38,7 @@ _xunit_make_section_report()
> local bad_count="$3"
> local notrun_count="$4"
> local sect_time="$5"
> + local timestamp
>
> if [ $sect_name == '-no-sections-' ]; then
> sect_name='global'
> @@ -45,8 +46,10 @@ _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")
> + if [ -n "$date_time" ]; then
> + timestamp="$(date -Iseconds --date="$date_time")"
> + else
> + timestamp="$(date -Iseconds)"
> fi
>
> local fstests_ns="https://git.kernel.org/pub/scm/fs/xfs/xfstests-dev.git"
> @@ -58,7 +61,7 @@ _xunit_make_section_report()
>
> name="xfstests"
> failures="$bad_count" skipped="$notrun_count" tests="$tests_count" time="$sect_time"
> - hostname="$HOST" timestamp="${date_time/ /T}">
> + hostname="$HOST" timestamp="$timestamp">
> ENDL
>
> # Properties
> diff --git a/doc/xunit.xsd b/doc/xunit.xsd
> index 0aef8a9839..67f586b816 100644
> --- a/doc/xunit.xsd
> +++ b/doc/xunit.xsd
> @@ -12,7 +12,7 @@
> <xs:element name="testsuite" type="testsuite"/>
> <xs:simpleType name="ISO8601_DATETIME_PATTERN">
> <xs:restriction base="xs:dateTime">
> - <xs:pattern value="[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}"/>
> + <xs:pattern value="[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}[+-][0-9]{2}:[0-9]{2}"/>
> </xs:restriction>
> </xs:simpleType>
> <xs:element name="testsuites">
>
next prev parent reply other threads:[~2022-12-20 2:20 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-20 0:01 [PATCHSET RFC 0/8] fstests: improve junit xml reporting Darrick J. Wong
2022-12-20 0:01 ` [PATCH 1/8] check: generate section reports between tests Darrick J. Wong
2022-12-20 1:14 ` Qu Wenruo
2023-02-14 18:46 ` Darrick J. Wong
2023-02-15 2:06 ` Qu Wenruo
2022-12-20 3:16 ` Theodore Ts'o
2022-12-20 18:18 ` Leah Rumancik
2022-12-20 0:01 ` [PATCH 2/8] report: derive an xml schema for the xunit report Darrick J. Wong
2022-12-20 2:18 ` Qu Wenruo
2023-02-14 18:54 ` Darrick J. Wong
2022-12-20 0:01 ` [PATCH 3/8] report: capture the time zone in the test report timestamp Darrick J. Wong
2022-12-20 2:19 ` Qu Wenruo [this message]
2022-12-20 0:01 ` [PATCH 4/8] report: sort properties by name Darrick J. Wong
2022-12-20 0:01 ` [PATCH 5/8] report: pass property value to _xunit_add_property Darrick J. Wong
2022-12-20 0:01 ` [PATCH 6/8] report: collect basic information about a test run Darrick J. Wong
2022-12-20 3:29 ` Theodore Ts'o
2023-02-14 18:59 ` Darrick J. Wong
2022-12-20 0:01 ` [PATCH 7/8] report: record xfs-specific " Darrick J. Wong
2022-12-20 0:01 ` [PATCH 8/8] report: record ext*-specific " Darrick J. Wong
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=51d9d9af-1302-e555-ca8a-c57a5a89b848@gmx.com \
--to=quwenruo.btrfs@gmx.com \
--cc=djwong@kernel.org \
--cc=fstests@vger.kernel.org \
--cc=guan@eryu.me \
--cc=leah.rumancik@gmail.com \
--cc=linux-xfs@vger.kernel.org \
--cc=zlang@redhat.com \
/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