qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Hanna Reitz <hreitz@redhat.com>
To: Nir Soffer <nsoffer@redhat.com>, qemu-devel@nongnu.org
Cc: "Thomas Huth" <thuth@redhat.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Kevin Wolf" <kwolf@redhat.com>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>,
	"Marc-André Lureau" <marcandre.lureau@redhat.com>,
	qemu-block@nongnu.org, "Daniel P. Berrangé" <berrange@redhat.com>
Subject: Re: [PATCH v2 2/5] Support format or cache specific out file
Date: Mon, 12 Dec 2022 11:38:19 +0100	[thread overview]
Message-ID: <a5923263-befe-30a4-afa2-a80ecb6b1ad2@redhat.com> (raw)
In-Reply-To: <20221128141514.388724-3-nsoffer@redhat.com>

On 28.11.22 15:15, Nir Soffer wrote:
> Extend the test finder to find tests with format (*.out.qcow2) or cache
> specific (*.out.nocache) out file. This worked before only for the
> numbered tests.
> ---
>   tests/qemu-iotests/findtests.py | 10 ++++++++--
>   1 file changed, 8 insertions(+), 2 deletions(-)

This patch lacks an S-o-b, too.

> diff --git a/tests/qemu-iotests/findtests.py b/tests/qemu-iotests/findtests.py
> index dd77b453b8..f4344ce78c 100644
> --- a/tests/qemu-iotests/findtests.py
> +++ b/tests/qemu-iotests/findtests.py
> @@ -38,31 +38,37 @@ def chdir(path: Optional[str] = None) -> Iterator[None]:
>           os.chdir(saved_dir)
>   
>   
>   class TestFinder:
>       def __init__(self, test_dir: Optional[str] = None) -> None:
>           self.groups = defaultdict(set)
>   
>           with chdir(test_dir):
>               self.all_tests = glob.glob('[0-9][0-9][0-9]')
>               self.all_tests += [f for f in glob.iglob('tests/*')
> -                               if not f.endswith('.out') and
> -                               os.path.isfile(f + '.out')]
> +                               if self.is_test(f)]

So previously a file was only considered a test file if there was a 
corresponding reference output file (`f + '.out'`), so files without 
such a reference output aren’t considered test files...

>               for t in self.all_tests:
>                   with open(t, encoding="utf-8") as f:
>                       for line in f:
>                           if line.startswith('# group: '):
>                               for g in line.split()[2:]:
>                                   self.groups[g].add(t)
>                               break
>   
> +    def is_test(self, fname: str) -> bool:
> +        """
> +        The tests directory contains tests (no extension) and out files
> +        (*.out, *.out.{format}, *.out.{option}).
> +        """
> +        return re.search(r'.+\.out(\.\w+)?$', fname) is None

...but this new function doesn’t check that.  I think we should check it 
(just whether there’s any variant of `/{fname}\.out(\.\w+)?/` to go with 
`fname`) so that behavior isn’t changed.

Hanna



  reply	other threads:[~2022-12-12 10:41 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-28 14:15 [PATCH v2 0/5] Add qemu-img checksum command using blkhash Nir Soffer
2022-11-28 14:15 ` [PATCH v2 1/5] qemu-img.c: Move IO_BUF_SIZE to the top of the file Nir Soffer
2022-12-12 10:35   ` Hanna Reitz
2022-11-28 14:15 ` [PATCH v2 2/5] Support format or cache specific out file Nir Soffer
2022-12-12 10:38   ` Hanna Reitz [this message]
2022-12-13 15:56     ` Nir Soffer
2022-12-13 18:09       ` Hanna Reitz
2022-12-13 19:53         ` Nir Soffer
2022-11-28 14:15 ` [PATCH v2 3/5] qemu-img: Add checksum command Nir Soffer
2022-12-12 10:42   ` Hanna Reitz
2022-11-28 14:15 ` [PATCH v2 4/5] iotests: Test qemu-img checksum Nir Soffer
2022-12-12 10:43   ` Hanna Reitz
2022-11-28 14:15 ` [PATCH v2 5/5] qemu-img: Speed up checksum Nir Soffer
2022-12-12 10:43   ` Hanna Reitz

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=a5923263-befe-30a4-afa2-a80ecb6b1ad2@redhat.com \
    --to=hreitz@redhat.com \
    --cc=berrange@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=nsoffer@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=philmd@linaro.org \
    --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).