Re: Add support for EXTRA_REGRESS_OPTS for meson

From: Rustam ALLAKOV <rustamallakov(at)gmail(dot)com>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Cc: Andreas Karlsson <andreas(at)proxel(dot)se>
Subject: Re: Add support for EXTRA_REGRESS_OPTS for meson
Date: 2025-03-19 22:25:46
Message-ID: 174242314653.510.8908680181703298899.pgcf@coridan.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

The following review has been posted through the commitfest application:
make installcheck-world: not tested
Implements feature: tested, failed
Spec compliant: tested, failed
Documentation: tested, failed

Hello everyone,
for v2 patch I suggest to refactor from

> -sp = subprocess.Popen(args.test_command, env=env_dict, stdout=subprocess.PIPE)
> +if args.testname in ['regress', 'isolation', 'ecpg'] and 'EXTRA_REGRESS_OPTS' in env_dict:
> + test_command = args.test_command + shlex.split(env_dict['EXTRA_REGRESS_OPTS'])
> +else:
> + test_command = args.test_command
> +
> +sp = subprocess.Popen(test_command, env=env_dict, stdout=subprocess.PIPE)

to

-sp = subprocess.Popen(args.test_command, env=env_dict, stdout=subprocess.PIPE)
+if args.testname in ['regress', 'isolation', 'ecpg']:
+ test_command = args.test_command[:]
+ if 'TEMP_CONFIG' in env_dict:
+ test_command.insert(1, '--temp-config=' + env_dict['TEMP_CONFIG'])
+ if 'EXTRA_REGRESS_OPTS' in env_dict:
+ test_command += shlex.split(env_dict['EXTRA_REGRESS_OPTS'])
+else:
+ test_command = args.test_command
+
+sp = subprocess.Popen(test_command, env=env_dict, stdout=subprocess.PIPE)

I double checked whether shlex module was built in Python, and yes it is,
so no need for additional requirement.txt input for pip to install.

in addition to the above, might be worth to add some documentation like

Environment Variables Supported:
EXTRA_REGRESS_OPTS: Additional options to pass to regression, isolation, or ecpg tests.
TEMP_CONFIG: Specify a temporary configuration file for testing purposes.
Example Usage:
# Use EXTRA_REGRESS_OPTS to load an extension
EXTRA_REGRESS_OPTS="--load-extension=pgcrypto" meson test
# Use TEMP_CONFIG to specify a temporary configuration file
TEMP_CONFIG="path/to/test.conf" meson test
# Use both EXTRA_REGRESS_OPTS and TEMP_CONFIG together
TEMP_CONFIG="path/to/test.conf" EXTRA_REGRESS_OPTS="--load-extension=pgcrypto" meson test

Should we cover these new lines with test? Asking, because I see EXTRA_REGRESS_OPTS
being tested for autotools in src/interfaces/ecpg/test/makefile

Regards.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Munro 2025-03-19 22:28:50 Re: [PoC] Federated Authn/z with OAUTHBEARER
Previous Message Tom Lane 2025-03-19 22:19:23 Re: [PoC] Federated Authn/z with OAUTHBEARER