Hello Andrew,

29.07.2024 13:54, Andrew Dunstan wrote:

On 2024-07-29 Mo 4:00 AM, Alexander Lakhin wrote:

And another interesting fact is that TEMP_CONFIG is apparently ignored by
`meson test regress/regress`. For example, with temp.config containing
invalid settings, `meson test pg_upgrade/002_pg_upgrade` fails, but
`meson test regress/regress` passes just fine.



Well, that last fact explains the discrepancy I originally complained about. How the heck did that happen? It looks like we just ignored its use in Makefile.global.in :-(

Please look at the attached patch (partially based on ideas from [1]) for
meson.build, that aligns it with `make` in regard to use of TEMP_CONFIG.

Maybe it could be implemented via a separate meson option, but that would
also require modifying at least the buildfarm client...

[1] 
https://www.postgresql.org/message-id/CAN55FZ304Kp%2B510-iU5-Nx6hh32ny9jgGn%2BOB5uqPExEMK1gQQ%40mail.gmail.com

Best regards,
Alexander
diff --git a/meson.build b/meson.build
index cd711c6d01..90f4e6da04 100644
--- a/meson.build
+++ b/meson.build
@@ -3388,6 +3388,12 @@ else
   runningcheck = false
 endif
 
+temp_config_env = run_command([
+  python,
+  '-c',
+  'import os; print(os.getenv("TEMP_CONFIG", ""))'
+], check: true).stdout().strip()
+
 testwrap = files('src/tools/testwrap')
 
 foreach test_dir : tests
@@ -3451,6 +3457,10 @@ foreach test_dir : tests
       env = test_env
       env.prepend('PATH', temp_install_bindir, test_dir['bd'])
 
+      if temp_config_env != ''
+        test_command_base += [ '--temp-config=' + temp_config_env ]
+      endif
+
       test_kwargs = {
         'protocol': 'tap',
         'priority': 10,

Reply via email to