From: Kevin Wolf <kwolf@redhat.com>
To: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Cc: qemu-block@nongnu.org, qemu-devel@nongnu.org, mreitz@redhat.com,
den@openvz.org, jsnow@redhat.com
Subject: Re: [PATCH v3 06/10] iotests: add testfinder.py
Date: Wed, 22 Apr 2020 15:06:59 +0200 [thread overview]
Message-ID: <20200422130659.GB7155@linux.fritz.box> (raw)
In-Reply-To: <bebaad72-1c40-36e2-b562-edfc69196326@virtuozzo.com>
Am 22.04.2020 um 14:49 hat Vladimir Sementsov-Ogievskiy geschrieben:
> 22.04.2020 14:53, Kevin Wolf wrote:
> > Am 22.04.2020 um 07:35 hat Vladimir Sementsov-Ogievskiy geschrieben:
> > > 21.04.2020 19:56, Kevin Wolf wrote:
> > > > Am 21.04.2020 um 09:35 hat Vladimir Sementsov-Ogievskiy geschrieben:
> > > > > +if __name__ == '__main__':
> > > > > + if len(sys.argv) == 2 and sys.argv[1] in ['-h', '--help']:
> > > > > + TestFinder.argparser.print_help()
> > > > > + exit()
> > > > > +
> > > > > + tests, remaining_argv = find_tests(sys.argv[1:])
> > > > > + print('\n'.join(tests))
> > > > > + if remaining_argv:
> > > > > + print('\nUnhandled options: ', remaining_argv)
> > > >
> > > > I think unhandled options shouldn't be considered an error and we
> > > > shouldn't even try to find and display any tests then. I'd either print
> > > > the help text or have an error message that refers to --help.
> > >
> > > As I considered running this script as executable for testing purposes, it's
> > > good to know, which options are not handled..
> >
> > Yes, that makes sense. I just think it should be an error and not just
> > an additional hint at the end.
> >
>
> It's not and error, as usual case will leave some arguments for
> TestEnv and TestRunner. Assume you run ./check with some arguments..
>
> And it works bad. You assume that problem is in testfinder.py. Then,
> you just take the entire list of options and call ./testfinder.py with
> them. And it shows, how it parses its arguments, and what is reminded.
> Seems correct and shouldn't be an error.
Hm, I didn't consider this use case. Fair enough then.
> Still, maybe better to print unhandled options first, to be more
> noticeable.
Actually, I think it's more noticeable at the end when you execute the
script standalone, especially when it prints a long list.
Kevin
next prev parent reply other threads:[~2020-04-22 13:08 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-21 7:35 [PATCH v3 00/10] Rework iotests/check Vladimir Sementsov-Ogievskiy
2020-04-21 7:35 ` [PATCH v3 01/10] iotests/277: use dot slash for nbd-fault-injector.py running Vladimir Sementsov-Ogievskiy
2020-04-21 12:54 ` Eric Blake
2020-04-21 13:04 ` Vladimir Sementsov-Ogievskiy
2020-04-21 7:35 ` [PATCH v3 02/10] iotests: fix some whitespaces in test output files Vladimir Sementsov-Ogievskiy
2020-04-21 7:35 ` [PATCH v3 03/10] iotests/283: make executable Vladimir Sementsov-Ogievskiy
2020-04-21 12:55 ` Eric Blake
2020-05-14 6:17 ` Philippe Mathieu-Daudé
2020-04-21 7:35 ` [PATCH v3 04/10] iotests/check: move QEMU_VXHS_PROG to common.rc Vladimir Sementsov-Ogievskiy
2020-04-21 16:03 ` Kevin Wolf
2020-04-22 5:14 ` Vladimir Sementsov-Ogievskiy
2020-04-21 7:35 ` [PATCH v3 05/10] iotests: define group in each iotest Vladimir Sementsov-Ogievskiy
2020-04-21 7:35 ` [PATCH v3 06/10] iotests: add testfinder.py Vladimir Sementsov-Ogievskiy
2020-04-21 16:56 ` Kevin Wolf
2020-04-22 5:35 ` Vladimir Sementsov-Ogievskiy
2020-04-22 11:53 ` Kevin Wolf
2020-04-22 12:49 ` Vladimir Sementsov-Ogievskiy
2020-04-22 13:06 ` Kevin Wolf [this message]
2020-05-07 17:43 ` Vladimir Sementsov-Ogievskiy
2020-05-08 8:49 ` Kevin Wolf
2020-05-08 9:42 ` Vladimir Sementsov-Ogievskiy
2020-05-13 21:58 ` John Snow
2020-05-14 4:54 ` Vladimir Sementsov-Ogievskiy
2020-05-14 5:06 ` John Snow
2020-05-14 5:31 ` Vladimir Sementsov-Ogievskiy
2020-04-21 7:35 ` [PATCH v3 07/10] iotests: add testenv.py Vladimir Sementsov-Ogievskiy
2020-04-21 7:35 ` [PATCH v3 08/10] iotests: add testrunner.py Vladimir Sementsov-Ogievskiy
2020-04-21 7:36 ` [PATCH v3 09/10] iotests: rewrite check into python Vladimir Sementsov-Ogievskiy
2020-04-21 7:40 ` Vladimir Sementsov-Ogievskiy
2020-04-21 7:36 ` [PATCH v3 10/10] iotests: rename 169 and 199 Vladimir Sementsov-Ogievskiy
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=20200422130659.GB7155@linux.fritz.box \
--to=kwolf@redhat.com \
--cc=den@openvz.org \
--cc=jsnow@redhat.com \
--cc=mreitz@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=vsementsov@virtuozzo.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).