Skip to content

Commit ea267c4

Browse files
fix mtr runner suites path
1 parent ae799b0 commit ea267c4

2 files changed

Lines changed: 31 additions & 6 deletions

File tree

configuration/builders/sequences/foundry/autobake.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,11 @@ def deb(config: DockerConfig, repo_file_url: str):
120120
)
121121
sequence.add_step(
122122
InContainer(
123-
ShellStep(command=RunPluginMTRSuite("/usr/share/mysql/mysql-test")),
123+
ShellStep(
124+
command=RunPluginMTRSuite(
125+
["/usr/share/mariadb-test", "/usr/share/mysql/mysql-test"]
126+
)
127+
),
124128
docker_environment=config,
125129
)
126130
)
@@ -170,7 +174,11 @@ def rpm(config: DockerConfig, repo_file_url: str):
170174
)
171175
sequence.add_step(
172176
InContainer(
173-
ShellStep(command=RunPluginMTRSuite("/usr/share/mysql-test")),
177+
ShellStep(
178+
command=RunPluginMTRSuite(
179+
["/usr/share/mariadb-test", "/usr/share/mysql-test"]
180+
)
181+
),
174182
docker_environment=config,
175183
)
176184
)

configuration/steps/commands/foundry.py

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,25 +43,42 @@ class RunPluginMTRSuite(Command):
4343
# the plugin's fetched source (<plugin>.build/) that has a suite.opt --
4444
# copies them into the installed suite tree, and runs them. A plugin
4545
# with no MTR suite is skipped rather than failing the build.
46-
def __init__(self, mtr_base_dir: str, workdir: PurePath = PurePath(".")):
47-
self.mtr_base_dir = mtr_base_dir
46+
def __init__(self, candidate_mtr_dirs: list[str], workdir: PurePath = PurePath(".")):
47+
# candidate_mtr_dirs: possible install locations for
48+
# mysql-test-run.pl, since the exact path varies across MariaDB
49+
# package versions/layouts -- the first one that actually exists
50+
# (post MariaDB-test/mariadb-test install) is used.
51+
self.candidate_mtr_dirs = candidate_mtr_dirs
4852
super().__init__(name="Run plugin MTR suite", workdir=workdir, user="root")
4953

5054
def as_cmd_arg(self) -> list[str]:
55+
candidates = " ".join(self.candidate_mtr_dirs)
5156
return [
5257
"bash",
5358
"-exc",
5459
util.Interpolate(
5560
f"""
5661
set -euo pipefail
5762
63+
mtr_base_dir=""
64+
for candidate in {candidates}; do
65+
if [ -f "$candidate/mysql-test-run.pl" ]; then
66+
mtr_base_dir="$candidate"
67+
break
68+
fi
69+
done
70+
if [ -z "$mtr_base_dir" ]; then
71+
echo "Could not find mysql-test-run.pl in any of: {candidates}" >&2
72+
exit 1
73+
fi
74+
5875
plugin_build="%(prop:plugin)s.build"
5976
suites=""
6077
for mt in $(find "$plugin_build" -type d -name mysql-test 2>/dev/null); do
6178
for d in "$mt"/*/ "$mt"/suite/*/; do
6279
[ -f "${{d}}suite.opt" ] || continue
6380
name=$(basename "$d")
64-
cp -r "$d" "{self.mtr_base_dir}/suite/$name"
81+
cp -r "$d" "$mtr_base_dir/suite/$name"
6582
suites="$suites,$name"
6683
done
6784
done
@@ -72,7 +89,7 @@ def as_cmd_arg(self) -> list[str]:
7289
exit 0
7390
fi
7491
75-
perl {self.mtr_base_dir}/mysql-test-run.pl --suite="$suites" --user=root
92+
perl "$mtr_base_dir/mysql-test-run.pl" --suite="$suites" --user=root
7693
"""
7794
),
7895
]

0 commit comments

Comments
 (0)