qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
To: John Snow <jsnow@redhat.com>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Cc: Kevin Wolf <kwolf@redhat.com>,
	"qemu-block@nongnu.org" <qemu-block@nongnu.org>,
	Max Reitz <mreitz@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v4 1/4] iotests: add script_initialize
Date: Mon, 16 Sep 2019 16:39:53 +0000	[thread overview]
Message-ID: <91133853-23e0-90ad-bb51-29a6c18ffc92@virtuozzo.com> (raw)
In-Reply-To: <376bbe1c-09dd-2dfc-cebe-6144f3411ec5@redhat.com>

16.09.2019 19:32, John Snow wrote:
> 
> 
> On 9/16/19 10:56 AM, Vladimir Sementsov-Ogievskiy wrote:
>> 12.09.2019 3:16, John Snow wrote:
>>> Like script_main, but doesn't require a single point of entry.
>>> Replace all existing initialization sections with this drop-in replacement.
>>>
>>> This brings debug support to all existing script-style iotests.
>>>
>>> Note: supported_oses=['linux'] was omitted, as it is a default argument.
>>
>> But after this patch all test which didn't check os start to check linux
>> (as it's default).. So all tests which worked on other platforms will now
>> be skipped on these other platforms?
>>
> 
> def verify_platform(supported_oses=['linux']):
>      if True not in [sys.platform.startswith(x) for x in supported_oses]:
>          notrun('not suitable for this OS: %s' % sys.platform)
> 
> 
> It was already the default. I didn't *make* it the default.

Yes. But for some tests, verify_platform wasn't called before this patch at all.
And now it is called and checks "linux". It's the change. Or what I miss?

> There is no
> change here. Feel free to propose a fix, but I don't think it's within
> the scope of this series.
> 
>> Finally do we support something except linux for iotests?
>> for bash tests _supported_os also used only with "Linux" in 87 tests..
>>
> 
> Evidently, not really. See bc521696607c5348fcd8a9e57b408d0ac0dbe2f8
> 
>> May be we'd better drop both _supported_os and supported_oses alltogether,
>> and don't care?
>>
> 
> Beyond the scope of this series.
> 
>> Anyway, if we support only linux, any reason to skip almost all tests,
>> if someone tries to run test on other platform? Let him run what he wants.
> 
> Maybe true, maybe not.
> 
>>
>>> Signed-off-by: John Snow <jsnow@redhat.com>
>>> ---
>>
>> [..]
>>
>>> +def execute_test(test_function=None, *args, **kwargs):
>>> +    """Run either unittest or script-style tests."""
>>> +
>>> +    debug = execute_setup_common(*args, **kwargs)
>>>        if not test_function:
>>> -        execute_unittest(output, verbosity, debug)
>>> +        execute_unittest(debug)
>>>        else:
>>>            test_function()
>>>    
>>> +# This is called from script-style iotests without a single point of entry
>>> +def script_initialize(*args, **kwargs):
>>> +    """Initialize script-style tests without running any tests."""
>>> +    execute_setup_common(*args, **kwargs)
>>> +
>>> +# This is called from script-style iotests with a single point of entry
>>>    def script_main(test_function, *args, **kwargs):
>>>        """Run script-style tests outside of the unittest framework"""
>>>        execute_test(test_function, *args, **kwargs)
>>>    
>>> +# This is called from unittest style iotests
>>>    def main(*args, **kwargs):
>>>        """Run tests using the unittest framework"""
>>
>>
>> Hmm, now two different styles of code documenting used: comment and doc-string,
>> both containing almost equal meaning.. I don't like it, still don't really mind.
> 
> I think I was trying to document what the function /does/ separately
> from a note about explaining how and where it is used. It's quite nearly
> redundant and if it's distracting I can remove it.
> 


-- 
Best regards,
Vladimir

  reply	other threads:[~2019-09-16 17:00 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-12  0:16 [Qemu-devel] [PATCH v4 0/4] iotests: use python logging John Snow
2019-09-12  0:16 ` [Qemu-devel] [PATCH v4 1/4] iotests: add script_initialize John Snow
2019-09-16 14:56   ` Vladimir Sementsov-Ogievskiy
2019-09-16 16:32     ` John Snow
2019-09-16 16:39       ` Vladimir Sementsov-Ogievskiy [this message]
2019-09-16 17:13         ` John Snow
2019-09-17 22:29     ` John Snow
2019-09-18 10:30       ` Vladimir Sementsov-Ogievskiy
2019-09-18 16:44         ` Vladimir Sementsov-Ogievskiy
2019-09-18 17:00           ` John Snow
2019-09-18 13:05       ` Thomas Huth
2019-09-18 18:41         ` John Snow
2019-09-12  0:16 ` [Qemu-devel] [PATCH v4 2/4] iotest 258: use script_main John Snow
2019-09-17  9:36   ` Vladimir Sementsov-Ogievskiy
2019-09-12  0:16 ` [Qemu-devel] [PATCH v4 3/4] iotests: specify protocol support via initialization info John Snow
2019-09-17  9:51   ` Vladimir Sementsov-Ogievskiy
2019-09-12  0:16 ` [Qemu-devel] [PATCH v4 4/4] iotests: use python logging for iotests.log() John Snow
2019-09-17 11:35   ` Vladimir Sementsov-Ogievskiy
2019-09-17 19:46     ` John Snow

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=91133853-23e0-90ad-bb51-29a6c18ffc92@virtuozzo.com \
    --to=vsementsov@virtuozzo.com \
    --cc=jsnow@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /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).