From: Kevin Wolf <kwolf@redhat.com>
To: "Alex Bennée" <alex.bennee@linaro.org>
Cc: thuth@redhat.com, qemu-devel@nongnu.org,
"open list:Block layer core" <qemu-block@nongnu.org>,
Max Reitz <mreitz@redhat.com>
Subject: Re: [Qemu-devel] [RFC PATCH] tests/qemu-iotests: re-format output to for make check-block
Date: Tue, 7 May 2019 10:10:04 +0200 [thread overview]
Message-ID: <20190507081004.GA5808@localhost.localdomain> (raw)
In-Reply-To: <20190503143904.31211-1-alex.bennee@linaro.org>
Am 03.05.2019 um 16:39 hat Alex Bennée geschrieben:
> This attempts to clean-up the output to better match the output of the
> rest of the QEMU check system. This includes:
>
> - formatting as " TEST iotest: nnn"
> - calculating time diff at the end
> - only dumping config on failure
>
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Hm... I see that this makes the output more consistent with other tests,
which is nice when it's run in the context of make check. I also think
the more consistent new output is uglier than the old output format.
I wonder whether we should have two modes - one that blends in with make
check, and another one that is provides nice and possibly more complete
output when the script is run manually.
> @@ -709,19 +703,6 @@ trap "_wrapup; exit \$status" 0 1 2 3 15
> FULL_IMGFMT_DETAILS=$(_full_imgfmt_details)
> FULL_HOST_DETAILS=$(_full_platform_details)
>
> -cat <<EOF
> -QEMU -- "$QEMU_PROG" $QEMU_OPTIONS
> -QEMU_IMG -- "$QEMU_IMG_PROG" $QEMU_IMG_OPTIONS
> -QEMU_IO -- "$QEMU_IO_PROG" $QEMU_IO_OPTIONS
> -QEMU_NBD -- "$QEMU_NBD_PROG" $QEMU_NBD_OPTIONS
> -IMGFMT -- $FULL_IMGFMT_DETAILS
> -IMGPROTO -- $IMGPROTO
> -PLATFORM -- $FULL_HOST_DETAILS
> -TEST_DIR -- $TEST_DIR
> -SOCKET_SCM_HELPER -- $SOCKET_SCM_HELPER
> -
> -EOF
At the first sight, I have two things that I like to see improved at
least in the manual mode:
* The output above is now produced for each failing case when multiple
tests are failing. I don't usually want to have my scroll buffer
filled with tons of these, but I just want to see as many diffs as
possible with as little scrolling as possible.
If we have two modes, we can unconditionally display it at the start
(like before this patch) in manual mode and completely disable it in
make check mode. (It's rare that I need this information, and if make
check fails, I should be trivially able to re-run it manually.)
* I'd like to see the currently running test with its start time and
expected duration before it has finished. When running tests in the
background, I often look at this information to check whether what's
running is just a long-running test case or whether it hangs.
> -
> seq="check"
>
> [ -n "$TESTS_REMAINING_LOG" ] && echo $list > $TESTS_REMAINING_LOG
> @@ -729,7 +710,9 @@ seq="check"
> for seq in $list
> do
> err=false
> - printf %s "$seq"
> + reason=""
> + times=""
> +
> if [ -n "$TESTS_REMAINING_LOG" ] ; then
> sed -e "s/$seq//" -e 's/ / /' -e 's/^ *//' $TESTS_REMAINING_LOG > $TESTS_REMAINING_LOG.tmp
> mv $TESTS_REMAINING_LOG.tmp $TESTS_REMAINING_LOG
> @@ -738,7 +721,7 @@ do
>
> if $showme
> then
> - echo
> + echo " TEST iotest: $seq (not actually run)"
> continue
> elif [ -f expunged ] && $expunge && egrep "^$seq([ ]|\$)" expunged >/dev/null
> then
> @@ -753,17 +736,11 @@ do
> # really going to try and run this one
> #
> rm -f $seq.out.bad
> - lasttime=$(sed -n -e "/^$seq /s/.* //p" <$TIMESTAMP_FILE)
> - if [ "X$lasttime" != X ]; then
> - printf %s " ${lasttime}s ..."
> - else
> - printf " " # prettier output with timestamps.
> - fi
> rm -f core $seq.notrun
> rm -f $seq.casenotrun
>
> start=$(_wallclock)
> - $timestamp && printf %s " [$(date "+%T")]"
> + $timestamp && times="[$(date "+%T")]"
>
> if [ "$(head -n 1 "$source_iotests/$seq")" == "#!/usr/bin/env python" ]; then
> run_command="$PYTHON $seq"
> @@ -781,26 +758,26 @@ do
> $run_command >$tmp.out 2>&1)
> fi
> sts=$?
> - $timestamp && _timestamp
> + $timestamp && times="$times -> [$(date "+%T")]"
> stop=$(_wallclock)
>
> if [ -f core ]
> then
> - printf " [dumped core]"
> mv core $seq.core
> + reason="dumped core $seq.core"
> err=true
> fi
>
> if [ -f $seq.notrun ]
> then
> - $timestamp || printf " [not run] "
> - $timestamp && echo " [not run]" && printf %s " $seq -- "
> + $timestamp || reason="[not run]"
> + $timestamp && reason="[not run] $seq -- "
I don't see this reason turn up in the output anywhere. It gets printed
only for failures, but "not run" is not a failure. So all I get is
something like this:
$ ./check -T -raw 001-010
006 - unknown test, ignored
TEST iotest: 001 [09:48:38] -> [09:48:39] 1s (last 1s)
TEST iotest: 002 [09:48:39] -> [09:48:40] 1s (last 1s)
TEST iotest: 003 [09:48:40] -> [09:48:40] 0s (last 1s)
TEST iotest: 004 [09:48:40] -> [09:48:41] 1s (last 0s)
TEST iotest: 005 [09:48:41] -> [09:48:41] 0s (last 0s)
not suitable for this image format: raw
TEST iotest: 007 [09:48:41] -> [09:48:41]
TEST iotest: 008 [09:48:41] -> [09:48:41] 0s (last 1s)
TEST iotest: 009 [09:48:41] -> [09:48:42] 1s (last 0s)
TEST iotest: 010 [09:48:42] -> [09:48:42] 0s (last 0s)
Not run: 007
Passed all 8 tests
Note that the "not suitable for this image format: raw" comes _before_
the test that it refers to, without including the test number. If I
didn't know that 007 was the skipped test, I would interpret it as
belonging to test 005.
The indentation for the message that we had previously felt nicer, too,
but maybe only for manual mode because none of make check is nice like
that? Actually, is there any reason for make check to even print that
message for skipped tests? It only tests a subset of tests anyway, and
we'll still get the "Not run" list at the end.
Kevin
prev parent reply other threads:[~2019-05-07 8:11 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-03 14:39 [Qemu-devel] [RFC PATCH] tests/qemu-iotests: re-format output to for make check-block Alex Bennée
2019-05-03 14:39 ` Alex Bennée
2019-05-03 15:02 ` Thomas Huth
2019-05-03 15:02 ` Thomas Huth
2019-05-03 16:15 ` Alex Bennée
2019-05-03 16:15 ` Alex Bennée
2019-05-05 15:54 ` Thomas Huth
2019-05-05 15:54 ` Thomas Huth
2019-05-06 17:14 ` Vladimir Sementsov-Ogievskiy
2019-05-06 18:53 ` Alex Bennée
2019-05-06 17:32 ` Eric Blake
2019-05-06 19:02 ` Alex Bennée
2019-05-05 16:01 ` Thomas Huth
2019-05-05 16:01 ` Thomas Huth
2019-05-07 8:10 ` Kevin Wolf [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=20190507081004.GA5808@localhost.localdomain \
--to=kwolf@redhat.com \
--cc=alex.bennee@linaro.org \
--cc=mreitz@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=thuth@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;
as well as URLs for NNTP newsgroup(s).