@@ -157,20 +157,24 @@ def as_cmd_arg(self) -> list[str]:
157157class DiscoverPluginMTRSuites (Command ):
158158 # MARIADB_ADD_PLUGIN's INSTALL_MYSQL_TEST (cmake/plugin.cmake) installs
159159 # a plugin's mysql-test suite(s) under <mtr_base_dir>/plugin/<X>/<name>/,
160- # e.g. plugin/rocksdb/rocksdb/suite.pm or
161- # plugin/columnstore/columnstore/suite.pm -- the same layout MariaDB-test
162- # itself uses for the suites it bundles for its own plugins (rocksdb,
163- # columnstore, auth_gssapi, ...). Once MariaDB-test is installed
164- # alongside our plugin there's no way to tell "ours" apart by re-scanning
165- # the merged plugin/ directory -- doing that picked up every bundled
166- # suite as well as (or instead of) the plugin actually under test.
167- # Read the suite name(s) straight off the plugin's own just-built
168- # package listing instead, before MariaDB-test ever gets installed. <X>
169- # is the plugin's own CMake project/target name, which isn't always the
170- # same as the Foundry "plugin" property (e.g. tidesql's CMake target is
171- # actually "tidesdb"), so this discovers whatever actually landed under
172- # plugin/*/*/suite.pm rather than guessing it. Emits comma-separated
173- # suite name(s) on stdout for capture into a property (e.g. via
160+ # e.g. plugin/rocksdb/rocksdb/ or plugin/tidesdb/tidesdb/. <X> is the
161+ # plugin's own CMake source-dir name, which isn't always the same as the
162+ # Foundry "plugin" property (e.g. tidesql's is actually "tidesdb"), so
163+ # this discovers whatever actually landed under plugin/*/*/ rather than
164+ # guessing it. A suite dir is identified by its t/*.test files, not a
165+ # suite.pm -- suite.pm is optional (only needed for custom My::Suite
166+ # logic) and plenty of real suites, tidesdb's included, ship only
167+ # t/*.test + suite.opt/r/include and no suite.pm at all.
168+ #
169+ # This is the same plugin/*/*/ layout MariaDB-test itself uses for the
170+ # suites it bundles for its own plugins (rocksdb, columnstore,
171+ # auth_gssapi, ...). Once MariaDB-test is installed alongside our plugin
172+ # there's no way to tell "ours" apart by re-scanning the merged plugin/
173+ # directory -- doing that picked up every bundled suite as well as (or
174+ # instead of) the plugin actually under test. Read the suite name(s)
175+ # straight off the plugin's own just-built package listing instead,
176+ # before MariaDB-test ever gets installed. Emits comma-separated suite
177+ # name(s) on stdout for capture into a property (e.g. via
174178 # PropFromShellStep) and use as RunPluginMTRSuite's suites arg.
175179 def __init__ (self , package_type : str , workdir : PurePath = PurePath ("." )):
176180 self .package_type = package_type
@@ -189,8 +193,12 @@ def as_cmd_arg(self) -> list[str]:
189193set -euo pipefail
190194
191195suites=""
192- for name in $({ list_files_cmd } | grep -oE '/plugin/[^/]+/[^/]+/suite\\ .pm$' | awk -F/ '{{print $(NF-1)}}' | sort -u); do
193- suites="$suites,$name"
196+ for path in $({ list_files_cmd } | grep -oE '/plugin/[^/]+/[^/]+/t/[^/]+\\ .test$' || true); do
197+ name=$(basename "$(dirname "$(dirname "$path")")")
198+ case ",$suites," in
199+ *",$name,"*) ;;
200+ *) suites="$suites,$name" ;;
201+ esac
194202done
195203suites=$(echo "$suites" | sed 's/^,//')
196204echo "$suites"
0 commit comments