Re: Add support for EXTRA_REGRESS_OPTS for meson

From: Andres Freund <andres(at)anarazel(dot)de>
To: Andreas Karlsson <andreas(at)proxel(dot)se>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Add support for EXTRA_REGRESS_OPTS for meson
Date: 2025-02-27 13:21:22
Message-ID: gmwcpdepbuyvh7pgodnef7qdk67vrtrs46ppjx5rgufljjktou@n2wfjnxlphap
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On 2025-02-27 13:53:17 +0100, Andreas Karlsson wrote:
> We use EXTRA_REGRESS_OPTS to make sure the whole test suite passes with our
> extension loaded and since I prefer develop in meson over using autotools
> and make the lack of support for EXTRA_REGRESS_OPTS in meson
> has bugged me for a while.

Yep, we should add support for that. TEMP_CONFIG probably too.

> Question: Would it make sense to rename it to PG_REGRESS_EXTRA_OPTS or
> something similar while we already touch touch this code to make the various
> options easier to remember?

I'd not tackle that at the same time personally.

> @@ -51,7 +52,12 @@ env_dict = {**os.environ,
> if "PG_TEST_EXTRA" not in env_dict and args.pg_test_extra:
> env_dict["PG_TEST_EXTRA"] = args.pg_test_extra
>
> -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)
> # Meson categorizes a passing TODO test point as bad
> # (https://github.com/mesonbuild/meson/issues/13183) Remove the TODO
> # directive, so Meson computes the file result like Perl does. This could

I hacked up something similar before, for TEMP_CONFIG, and found that I needed
to do something like this:

+if 'TEMP_CONFIG' in os.environ and \
+ args.testname in ['regress', 'isolation', 'ecpg']:
+ # be careful to insert before non-option args, otherwise it'll fail
+ # e.g. on windows
+ args.test_command.insert(1, '--temp-config='+os.environ['TEMP_CONFIG'])

Greetings,

Andres Freund

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Ranier Vilela 2025-02-27 13:23:31 Re: Small memory fixes for pg_createsubcriber
Previous Message ryanewang (王蕾) 2025-02-27 13:16:11 Reduce the instruction overhead of OpenSSL calls