@@ -2889,6 +2889,21 @@ endif
28892889# Test Generation
28902890###############################################################
28912891
2892+ # when using a meson version understanding exclude_suites, define a 'default'
2893+ # test setup that excludes tests running against a pre-existing install and a
2894+ # 'running' setup that conflicts with creation of the temporary installation
2895+ # and tap tests (which don't support running against a running server).
2896+ if meson .version().version_compare(' >=0.57' )
2897+ add_test_setup (' default' ,
2898+ is_default : true ,
2899+ exclude_suites : [' running' ])
2900+ add_test_setup (' running' ,
2901+ exclude_suites : [' temp-install' , ' setup' , ' tap' ])
2902+ runningcheck = true
2903+ else
2904+ runningcheck = false
2905+ endif
2906+
28922907testwrap = files (' src/tools/testwrap' )
28932908
28942909foreach test_dir : tests
@@ -2917,18 +2932,27 @@ foreach test_dir : tests
29172932
29182933 test_output = test_result_dir / test_dir[' name' ] / kind
29192934
2935+ # unless specified by the test, choose a non-conflicting database name,
2936+ # to avoid conflicts when running against existing server.
2937+ dbname = t.get(' dbname' ,
2938+ ' regression_@0@_@1@' .format(test_dir[' name' ], kind))
2939+
29202940 test_command = [
29212941 runner.full_path(),
29222942 ' --inputdir' , t.get(' inputdir' , test_dir[' sd' ]),
29232943 ' --expecteddir' , t.get(' expecteddir' , test_dir[' sd' ]),
29242944 ' --outputdir' , test_output,
2925- ' --temp-instance' , test_output / ' tmp_check' ,
29262945 ' --bindir' , '' ,
29272946 ' --dlpath' , test_dir[' bd' ],
29282947 ' --max-concurrent-tests=20' ,
2929- ' --port ' , testport.to_string() ,
2948+ ' --dbname ' , dbname ,
29302949 ] + t.get(' regress_args' , [])
29312950
2951+ test_command_tmp_install = test_command + [
2952+ ' --temp-instance' , test_output / ' tmp_check' ,
2953+ ' --port' , testport.to_string(),
2954+ ]
2955+
29322956 if t.has_key(' schedule' )
29332957 test_command += [' --schedule' , t[' schedule' ],]
29342958 endif
@@ -2943,7 +2967,6 @@ foreach test_dir : tests
29432967 env.prepend(' PATH' , temp_install_bindir, test_dir[' bd' ])
29442968
29452969 test_kwargs = {
2946- ' suite' : [test_dir[' name' ]],
29472970 ' priority' : 10 ,
29482971 ' timeout' : 1000 ,
29492972 ' depends' : test_deps + t.get(' deps' , []),
@@ -2954,11 +2977,26 @@ foreach test_dir : tests
29542977 python,
29552978 args : testwrap_base + [
29562979 ' --testname' , kind,
2957- ' --' , test_command ,
2980+ ' --' , test_command_tmp_install ,
29582981 ],
2982+ suite : [test_dir[' name' ], ' temp-install' ],
29592983 kwargs : test_kwargs,
29602984 )
29612985
2986+ # some tests can't support running against running DB
2987+ if runningcheck and t.get(' runningcheck' , true )
2988+ test (test_dir[' name' ] / kind + ' -running' ,
2989+ python,
2990+ args : testwrap_base + [
2991+ ' --testname' , kind,
2992+ ' --' , test_command,
2993+ ],
2994+ is_parallel : t.get(' runningcheck-parallel' , true ),
2995+ suite : [test_dir[' name' ], ' running' ],
2996+ kwargs : test_kwargs,
2997+ )
2998+ endif
2999+
29623000 testport += 1
29633001 elif kind == ' tap'
29643002 if not tap_tests_enabled
@@ -2982,7 +3020,7 @@ foreach test_dir : tests
29823020
29833021 test_kwargs = {
29843022 ' protocol' : ' tap' ,
2985- ' suite' : [test_dir[' name' ]],
3023+ ' suite' : [test_dir[' name' ], ' tap ' ],
29863024 ' timeout' : 1000 ,
29873025 ' depends' : test_deps + t.get(' deps' , []),
29883026 ' env' : env,
0 commit comments