Re: meson and check-tests

Nazir Bilal Yavuz <byavuz81@gmail.com>

From: Nazir Bilal Yavuz <byavuz81@gmail.com>
To: Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
Cc: jian he <jian.universality@gmail.com>, Tristan Partin <tristan@partin.io>, Tom Lane <tgl@sss.pgh.pa.us>, Andres Freund <andres@anarazel.de>, pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2024-11-19T13:13:29Z
Lists: pgsql-hackers

Attachments

Hi,

Thanks for checking it!

On Tue, 19 Nov 2024 at 15:19, Ashutosh Bapat
<ashutosh.bapat.oss@gmail.com> wrote:
>
> On Thu, Oct 31, 2024 at 11:28 PM Nazir Bilal Yavuz <byavuz81@gmail.com> wrote:
> >
> > 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.

I got it, the comment is removed.

> > > 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.

Yes. All the tests without schedule option are collected in the
test_selection in the meson.build file:

test_selection = []
if kind == 'isolation'
  test_selection += t.get('specs', [])
else
  test_selection += t.get('sql', [])
endif

And, AFAIU all the regression test suites accept both schedule option
and tests by their names. So, it should be safe to pass both
--schedule and --tests.

-- 
Regards,
Nazir Bilal Yavuz
Microsoft