fix(tester): abort when TAP_GROUP is set but has no tests registered

Previously, if TAP_GROUP was set but the group had no entries in
test/tap/groups/groups.json (typo, missing registration, etc.), the
tester logged a warning and silently fell back to running ALL 325 TAP
tests. In a multi-group parallel run this turns a misconfiguration into
a multi-hour hang that only surfaces when the per-group TIMEOUT fires.

We hit this in practice: mysql90-g[2-5] existed as launch targets in
the runner but hadn't been populated in groups.json yet. The tester
fell back to the full suite, and the groups TIMED OUT after chewing
through pgsql tests they had no business running.

Change behavior to log at CRITICAL and sys.exit(1) in two cases:
  1. TAP_GROUP is set, groups.json is present, but the group has no
     tests registered.
  2. TAP_GROUP is set and groups.json is missing entirely.

The "no TAP_GROUP specified" path is unchanged — that's the legitimate
way to run the full suite directly (outside the group runner).

Error messages explicitly tell the operator what to do: either register
tests for the group, or unset TAP_GROUP to run the full suite
intentionally.
v3.0-dbdeployer-mysql84-gr
Rene Cannao 1 month ago
parent 7eee687415
commit bee37b2cb8

@ -647,11 +647,19 @@ CREATE TABLE stats_history.mysql_server_read_only_log (
if group_has_tests:
log.info(f"Group '{TAP_GROUP}' has associated tests in groups.json")
else:
log.warning(f"Group '{TAP_GROUP}' has no associated tests in groups.json - defaulting to all TAP tests")
groups = {}
log.critical(
f"Group '{TAP_GROUP}' has no associated tests in groups.json. "
f"Refusing to fall back to running all TAP tests — aborting. "
f"Register tests for this group in test/tap/groups/groups.json, "
f"or unset TAP_GROUP to run the full suite intentionally."
)
sys.exit(1)
else:
log.warning(f"No groups.json found - group '{TAP_GROUP}' will default to all TAP tests")
groups = {}
log.critical(
f"No groups.json found but TAP_GROUP='{TAP_GROUP}' is set. "
f"Refusing to fall back to running all TAP tests — aborting."
)
sys.exit(1)
else:
# No TAP_GROUP specified - load all groups for regular group membership checking
log.info("No TAP_GROUP specified - loading all groups for membership checking")

Loading…
Cancel
Save