On Thu, Oct 31, 2024 at 11:28 PM Nazir Bilal Yavuz <byavu...@gmail.com> wrote: > > On Fri, 4 Oct 2024 at 18:40, Ashutosh Bapat > <ashutosh.bapat....@gmail.com> wrote: > > --schedule or the test selection becomes part of the test command > > itself in the current master. By passing it as an argument, in these > > patches, we are allowing those to be overridden if TESTS is set at the > > time of running the test. I like this idea. I was pondering whether we > > really need two separate arguments --schedule and --tests > > respectively. IIUC, we can't pass them as a single argument (say > > --test-selection or --selection) because the subsequent --schedule > > would be treated as a separate argument if not quoted correctly. That > > isn't a problem with value of tests. To avoid quoting '--schedule > > ...', we have two separate arguments. Am I right? > > Yes, that is exactly why we have both '--schedule' and '--tests' > flags. Also, a comment is added to clarify this.
The comment is useful if we want to understand this change but I feel it's confusing when reading the code. I don't think we need the comment. The code is clearer than before as is. > > > It might be better to make this explicit in the code -- by making sure > > that only one of them is passed and writing a comment about it. > > ArgumentParser might have some trick to specify that passing both the > > arguments is an error. > > I did not understand why only one of them needed to be passed at a > time. For example in ecpg tests > (src/interfaces/ecpg/test/meson.build), both '--schedule' and > '--tests' options are passed. Is it because it has both schedule as well as sql? 'ecpg': { 'expecteddir': meson.current_source_dir(), 'inputdir': meson.current_build_dir(), 'schedule': ecpg_test_files, 'sql': [ 'sql/twophase', ], I see sql/twophase is not part of ecpg_schedule and it's passes separately to testwrap. -- Best Wishes, Ashutosh Bapat