Re: meson missing test dependencies
Nazir Bilal Yavuz <byavuz81@gmail.com>
From: Nazir Bilal Yavuz <byavuz81@gmail.com>
To: Michael Paquier <michael@paquier.xyz>
Cc: Peter Eisentraut <peter@eisentraut.org>,
pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2024-12-03T08:52:28Z
Lists: pgsql-hackers
Hi,
On Tue, 3 Dec 2024 at 04:05, Michael Paquier <michael@paquier.xyz> wrote:
>
> On Mon, Dec 02, 2024 at 01:50:57PM +0300, Nazir Bilal Yavuz wrote:
> > On Mon, 2 Dec 2024 at 13:11, Peter Eisentraut <peter@eisentraut.org> wrote:
> >> Is there any reason this was not done yet?
> >
> > This looks useful. I am not sure why this was not done before.
>
> Do you think that it would be possible to automate the addition of the
> dependency link between the module and the tests in some way? The
> most common case where the only dependency needed by the test is the
> module itself would cover a lot of ground if this could be enforced in
> some fashion.
I tried something like:
diff --git a/meson.build b/meson.build
index 451c3f6d851..ddf6045d472 100644
--- a/meson.build
+++ b/meson.build
@@ -3366,6 +3366,13 @@ foreach test_dir : tests
t = test_dir[kind]
+ t_dep = [get_variable(test_dir['name'], '')]
+ message('Adding test = @0@ and dep = @1@'.format(test_dir['name'], t_dep))
+ if t_dep != ['']
+ t += {'deps': t_dep}
+ endif
+
The code above creates a dependency between the module (*whose name is
same with the test*) and the test. This errors out for the 'libpq,
ssl, ldap and icu' because the type of these variables is dependency;
but test.depends can be one of the '[BuildTarget | CustomTarget |
CustomTargetIndex]' types, it can not be a dependency type.
And this can not create a link for the 'scripts, regress, isolation,
authentication, postmaster, recovery, subscription, brin, commit_ts,
gin, test_extensions, test_json_parser, test_misc, test_pg_dump,
typcache, unsafe_tests, worker_spi, kerberos and ecpg' tests. I think
only 'regress, isolation, test_json_parser, worker_spi and ecpg' are
wrong in this list as their modules names are not the same with their
tests.
--
Regards,
Nazir Bilal Yavuz
Microsoft
Commits
-
oauth: Correct test dependency on oauth_hook_client
- 444826b6dc17 18.2 landed
- c6a10a89feab 19 (unreleased) landed
-
meson: Add missing dependencies for libpq tests
- ad80e5823a50 16.7 landed
- 73ed502ea677 17.3 landed
- 26aca4de43d5 18.0 landed
-
meson: Add missing dependencies to libpq_pipeline test
- 5acf0636f874 16.7 landed
- 09df23cf321e 17.3 landed
- c89525d57bce 18.0 landed
-
meson: Add pg_regress_ecpg to ecpg test dependencies
- 057762066792 16.7 landed
- f52bc2388277 17.3 landed
- 69b05d581eca 18.0 landed
-
meson: Add test dependencies for test_json_parser
- 493398de2c4e 17.3 landed
- 1be5c3737243 18.0 landed
-
meson: Improve dependencies for tmp_install test target
- dab83a62fc62 16.7 landed
- 74ef4855b081 18.0 landed
- 25cb77694128 17.3 landed
-
meson: Narrow dependencies for 'install-quiet' target
- 80620931053d 16.7 landed
- c2ede6640ca2 18.0 landed
- 6a4815c49226 17.3 landed