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-10-31T17:58:18Z
Lists: pgsql-hackers

Attachments

Hi Ashutosh and Jian,

Sorry for the late reply and thanks for the feedback!

On Fri, 4 Oct 2024 at 16:13, jian he <jian.universality@gmail.com> wrote:
>
> v3, 0001 documentation:
> We can at least write something on
> https://wiki.postgresql.org/wiki/Meson about this feature.

I agree. It seems that I need to apply for an editor access on the
wiki page. I am planning to do that after the commit.

> TESTS='check check_btree' meson test amcheck/regress --verbose
> works, but I feel like there is a discoverability issue .
>
> TESTS='check check_btree' meson test amcheck/regress --list --verbose
> shows:
> postgresql:amcheck / amcheck/regress
>
>
> For small tests, listing all the available tests would be great.

I agree but unfortunately this seems not possible. 'meson test --list'
option only shows tests that are registered to meson build (i.e.
test() calls in the meson.build files).

On Fri, 4 Oct 2024 at 18:40, Ashutosh Bapat
<ashutosh.bapat.oss@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.

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

> Also I don't think "Note that setup
> # suite tests (at least tmp_install and initdb_cache tests) may need to be run
> # before running these tests." is needed. This is true irrespective of
> whether we specify TESTS or not.

Done.

--
Regards,
Nazir Bilal Yavuz
Microsoft