Skip to content

Commit b604356

Browse files
lkotuladahlerlend
authored andcommitted
Bug#37689487 - JIT tests in router suite must be skippable
Description =========== MySQL REST Service in router introduced new plugin jit_executor.so, which builds only when cmake was configured with external jit-executor: cmake -DMRS_JIT_EXECUTOR_LIB=/export/mysql/libs/jit-executor-commercial-23.0.1-ubuntu24.04-x86-64bit/ . This results in placing jit-executor.so is inside router plugin directory, and router can load it. Fix === Added "have_jit_executor.inc", which can be used by router tests that loads "jit-executor". (POST-PUSH FIX WL#15440) Change-Id: I84b1d0af0bd2a1c83eeb303b556512425e9b5b1d
1 parent 3247c02 commit b604356

File tree

3 files changed

+49
-5
lines changed

3 files changed

+49
-5
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Should be used by the Router test when it uses jit_executor plugin.
2+
# The plugin is build only when cmake was configurated with:
3+
#
4+
# -DMRS_JIT_EXECUTOR_LIB=...
5+
#

mysql-test/lib/mtr_cases.pm

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1565,9 +1565,34 @@ sub collect_one_test_case {
15651565
skip_test($tinfo, "No router executable available.");
15661566
return $tinfo;
15671567
}
1568+
1569+
if ($::plugin_mysqlrouter_routing eq "") {
1570+
# Packaging problem, must be deployed with MySQLRouter
1571+
skip_test($tinfo, "No routing plugin available.");
1572+
return $tinfo;
1573+
}
15681574
}
15691575
$router_test = 1 if ($tinfo->{'router_test'});
15701576

1577+
# Check for router-jit-executor tests
1578+
if ($tinfo->{'router_jit_executor_test'}) {
1579+
# check if the router executable was found (built)
1580+
if ($::plugin_mysqlrouter_jit_executor eq "") {
1581+
skip_test($tinfo, "No jit_executor plugin available.");
1582+
return $tinfo;
1583+
}
1584+
}
1585+
1586+
# Check for MySQL Router bootstrap tests
1587+
if ($tinfo->{'router_bootstrap_test'}) {
1588+
# check if the routing plugin was found (built)
1589+
if ($::plugin_mysqlrouter_routing eq "") {
1590+
# Packaging problem, must be deployed with MySQLRouter
1591+
skip_test($tinfo, "No routing plugin available.");
1592+
return $tinfo;
1593+
}
1594+
}
1595+
15711596
if ($tinfo->{'not_windows'} && IS_WINDOWS) {
15721597
skip_test($tinfo, "Test not supported on Windows");
15731598
return $tinfo;
@@ -1706,7 +1731,10 @@ my @tags = (
17061731

17071732
[ "include/not_asan.inc", "not_asan", 1 ],
17081733
[ "include/not_ubsan.inc", "not_ubsan", 1 ],
1734+
1735+
# Tests with below .inc files are considered to be MySQL Router tests.
17091736
[ "have_router.inc", "router_test", 1 ],
1737+
[ "have_jit_executor.inc", "router_jit_executor_test", 1 ],
17101738
[ "have_router_bootstrap.inc", "router_bootstrap_test", 1 ],
17111739

17121740
# Tests with below .inc file needs either big-test or only-big-test

mysql-test/mysql-test-run.pl

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,8 @@
366366
our $exe_mysqlrouter;
367367
our $exe_mysqlrouter_mrs_client;
368368
our $exe_mysqlrouter_keyring;
369+
our $plugin_mysqlrouter_jit_executor;
370+
our $plugin_mysqlrouter_routing;
369371

370372
our $glob_debugger = 0;
371373
our $group_replication = 0;
@@ -2987,6 +2989,9 @@ ()
29872989
my_find_bin($bindir,
29882990
[ "runtime_output_directory", "libexec", "sbin", "bin" ],
29892991
"mysqlrouter_mrs_client", NOT_REQUIRED);
2992+
2993+
$plugin_mysqlrouter_jit_executor = find_router_plugin("jit_executor");
2994+
$plugin_mysqlrouter_routing = find_router_plugin("routing");
29902995
}
29912996

29922997
sub client_debug_arg($$) {
@@ -3187,6 +3192,16 @@ ($)
31873192
"$basedir/lib/" . $plugin_filename);
31883193
}
31893194

3195+
sub find_router_plugin($) {
3196+
my ($plugin) = @_;
3197+
my $router_plugin = find_plugin($plugin, "plugin_output_directory");
3198+
if (!$router_plugin) {
3199+
$router_plugin = find_router_plugin_in_package($plugin);
3200+
}
3201+
return $router_plugin;
3202+
}
3203+
3204+
31903205
# Read plugin defintions file
31913206
sub read_plugin_defs($$) {
31923207
my ($defs_file, $remove_config) = @_;
@@ -5268,11 +5283,7 @@ ($)
52685283
if (!$tinfo->{router_test}) {
52695284
$config_router = ();
52705285
if ($tinfo->{router_bootstrap_test}) {
5271-
my $routing_plugin = find_plugin("routing", "plugin_output_directory");
5272-
if (!$routing_plugin) {
5273-
$routing_plugin = find_router_plugin_in_package("routing") or die();
5274-
}
5275-
my $plugin_dir = dirname($routing_plugin);
5286+
my $plugin_dir = dirname($plugin_mysqlrouter_routing);
52765287
$ENV{"ROUTER_PLUGIN_DIRECTORY"} = $plugin_dir;
52775288
}
52785289
}

0 commit comments

Comments
 (0)