Hi, I’ve been working on a patch and wanted to share my approach, which might be helpful for others. The patch removes the '--schedule' and '${schedule_file}' options from the regress/regress test command when the TESTS environment variable is set. Instead, it appends the TESTS variable to the end of the command.
Please note that setup suite tests (at least tmp_install and initdb_cache) should be executed before running these tests. One drawback is that while the Meson logs will still show the test command with the '--schedule' and '${schedule_file}' options, the actual command used will be changed. Some examples after the patched build: $ meson test --suite regress -> fails $ TESTS="create_table copy jsonb" meson test --suite regress -> fails ### run required setup suite tests $ meson test tmp_install $ meson test initdb_cache ### $ meson test --suite regress -> passes (12s) $ TESTS="copy" meson test --suite regress -> passes (0.35s) $ TESTS="copy jsonb" meson test --suite regress -> passes (0.52s) $ TESTS='select_into' meson test --suite regress -> fails $ TESTS='test_setup select_into' meson test --suite regress -> passes (0.52s) $ TESTS='rangetypes multirangetypes' meson test --suite regress -> fails $ TESTS='test_setup multirangetypes rangetypes' meson test --suite regres -> fails $ TESTS='test_setup rangetypes multirangetypes' meson test --suite regress -> passes (0.91s) Any feedback would be appreciated. -- Regards, Nazir Bilal Yavuz Microsoft
From 7c94889b553ffc294ddf9eba7c595ea629d24e91 Mon Sep 17 00:00:00 2001 From: Nazir Bilal Yavuz <byavu...@gmail.com> Date: Fri, 20 Sep 2024 11:39:20 +0300 Subject: [PATCH v1] Add 'make check-tests' approach to the meson based builds --- src/tools/testwrap | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/tools/testwrap b/src/tools/testwrap index 9a270beb72d..9180727b6ff 100755 --- a/src/tools/testwrap +++ b/src/tools/testwrap @@ -41,6 +41,17 @@ env_dict = {**os.environ, 'TESTDATADIR': os.path.join(testdir, 'data'), 'TESTLOGDIR': os.path.join(testdir, 'log')} +# Symmetric behaviour with make check-tests. If TESTS environment variable is +# set, only run these regression tests in regress/regress test. Note that setup +# suite tests (at least tmp_install and initdb_cache tests) need to be run +# before running these tests. +if "TESTS" in env_dict and args.testgroup == 'regress' and args.testname == 'regress': + elem = '--schedule' + schedule_index = args.test_command.index(elem) if elem in args.test_command else -1 + if schedule_index >= 0: + del args.test_command[schedule_index : schedule_index + 2] + args.test_command.extend(env_dict["TESTS"].split(' ')) + sp = subprocess.Popen(args.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 -- 2.45.2