qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: John Snow <jsnow@redhat.com>
To: Jeff Cody <jcody@redhat.com>, qemu-devel@nongnu.org
Cc: kwolf@redhat.com, qemu-block@nongnu.org, armbru@redhat.com,
	stefanha@redhat.com
Subject: Re: [Qemu-devel] [PATCH v3 5/5] qemu-iotests: add option to save temp files on error
Date: Wed, 30 Aug 2017 18:38:40 -0400	[thread overview]
Message-ID: <c5a2ea74-7c0b-0596-f07c-3b1ab00aa9b5@redhat.com> (raw)
In-Reply-To: <e99a5e3feefe5fdb54d64fb80b09089618a0ff49.1504111803.git.jcody@redhat.com>



On 08/30/2017 12:52 PM, Jeff Cody wrote:
> Now that ./check takes care of cleaning up after each tests, it
> can also selectively not clean up.  Add option to leave all output from
> tests intact if that test encountered an error.
> 
> Note: this currently only works for bash tests, as the python tests
> still clean up after themselves manually.
> 
> Signed-off-by: Jeff Cody <jcody@redhat.com>
> ---
>  tests/qemu-iotests/check  | 10 +++++++++-
>  tests/qemu-iotests/common |  6 ++++++
>  2 files changed, 15 insertions(+), 1 deletion(-)
> 
> diff --git a/tests/qemu-iotests/check b/tests/qemu-iotests/check
> index f6ca85d..8a5fc0d 100755
> --- a/tests/qemu-iotests/check
> +++ b/tests/qemu-iotests/check
> @@ -370,7 +370,15 @@ do
>              fi
>          fi
>  
> -        rm -rf "$TEST_DIR_SEQ"
> +        #TODO: There is some intial work to save intermediate files
> +        #      in python tests, but it is imperfect.  Having each
> +        #      test record its test name, and the tearDown function
> +        #      just move intermediate images to a subdirectory with
> +        #      the test name may prove more useful.
> +        if [ "$save_on_err" != "true" ] || [ "$err" != "true" ]
> +        then
> +            rm -rf "$TEST_DIR_SEQ"
> +        fi
>  
>      fi
>  
> diff --git a/tests/qemu-iotests/common b/tests/qemu-iotests/common
> index d34c11c..d08b233 100644
> --- a/tests/qemu-iotests/common
> +++ b/tests/qemu-iotests/common
> @@ -42,6 +42,7 @@ expunge=true
>  have_test_arg=false
>  randomize=false
>  cachemode=false
> +save_on_err=false
>  rm -f $tmp.list $tmp.tmp $tmp.sed
>  
>  export IMGFMT=raw
> @@ -172,6 +173,7 @@ other options
>      -T                  output timestamps
>      -r                  randomize test order
>      -c mode             cache mode
> +    -s                  save test scratch directory on test failure
>  
>  testlist options
>      -g group[,group...]        include tests from these groups
> @@ -349,6 +351,10 @@ testlist options
>              xgroup=true
>              xpand=false
>              ;;
> +        -s)
> +            save_on_err=true
> +            xpand=false
> +            ;;
>          '[0-9][0-9][0-9] [0-9][0-9][0-9][0-9]')
>              echo "No tests?"
>              status=1
> 

This, however, is definitely awesome.

Tested-by: John Snow <jsnow@redhat.com>
Reviewed-by: John Snow <jsnow@redhat.com>

      parent reply	other threads:[~2017-08-30 22:38 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-30 16:52 [Qemu-devel] [PATCH v3 0/5] qemu-iotests: place output in unique dir Jeff Cody
2017-08-30 16:52 ` [Qemu-devel] [PATCH v3 1/5] qemu-iotests: set TEST_DIR to a unique dir for each test Jeff Cody
2017-08-30 22:15   ` John Snow
2017-08-30 22:39     ` Jeff Cody
2017-08-30 16:52 ` [Qemu-devel] [PATCH v3 2/5] qemu-iotests: remove file cleanup from bash tests Jeff Cody
2017-08-30 22:17   ` John Snow
2017-09-05 11:17   ` Kevin Wolf
2017-08-30 16:52 ` [Qemu-devel] [PATCH v3 3/5] qemu-iotests: add 'blind_remove' for python tests Jeff Cody
2017-08-30 18:13   ` Eric Blake
2017-08-30 22:21     ` John Snow
2017-08-30 16:52 ` [Qemu-devel] [PATCH v3 4/5] qemu-iotests: make python tests attempt to leave intermediate files Jeff Cody
2017-08-30 18:33   ` Eric Blake
2017-08-30 22:28     ` John Snow
2017-08-30 22:35       ` Eric Blake
2017-08-30 22:40         ` John Snow
2017-08-31 15:39           ` Stefan Hajnoczi
2017-08-31 15:47             ` Jeff Cody
2017-09-04  9:51               ` Stefan Hajnoczi
2017-09-04 14:42                 ` Jeff Cody
2017-08-30 16:52 ` [Qemu-devel] [PATCH v3 5/5] qemu-iotests: add option to save temp files on error Jeff Cody
2017-08-30 18:49   ` Eric Blake
2017-08-30 22:38   ` John Snow [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=c5a2ea74-7c0b-0596-f07c-3b1ab00aa9b5@redhat.com \
    --to=jsnow@redhat.com \
    --cc=armbru@redhat.com \
    --cc=jcody@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@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).