Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/CI-lint-groups-json.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ jobs:
run: python3 test/tap/groups/lint_groups_json.py
- name: Check AI TAP shard split
run: python3 test/tap/groups/test_ai_group_shards.py
- name: Check TAP Makefile dependency graph
run: python3 test/tap/groups/test_makefile_dependencies.py
- name: Check every TAP source is registered in groups.json
run: python3 test/tap/groups/check_groups.py --source
- name: Check cluster simulator coverage contract
Expand Down
63 changes: 63 additions & 0 deletions test/tap/groups/test_makefile_dependencies.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
#!/usr/bin/env python3
"""Regression contracts for TAP Makefile dependency boundaries."""

import subprocess
import unittest
from pathlib import Path


ROOT = Path(__file__).resolve().parents[3]
TAP_TESTS_DIR = ROOT / "test/tap/tests"
MYSQLX_BRIDGE_TARGETS = (
"test_mysqlx_plugin_load-t",
"test_mysqlx_admin_tables-t",
)


class MakefileDependencyTest(unittest.TestCase):
def test_mysqlx_bridge_targets_share_one_unit_submake(self):
result = subprocess.run(
[
"make",
"--no-print-directory",
"-C",
str(TAP_TESTS_DIR),
"-n",
"-j2",
"MAKE=echo",
*MYSQLX_BRIDGE_TARGETS,
],
cwd=ROOT,
text=True,
capture_output=True,
check=False,
timeout=30,
)

self.assertEqual(result.returncode, 0, result.stdout + result.stderr)

unit_submakes = [
line.split()[2:]
for line in result.stdout.splitlines()
if line.startswith("-C unit ")
]
self.assertEqual(
unit_submakes,
[list(MYSQLX_BRIDGE_TARGETS)],
result.stdout,
)

symlinks = [
line
for line in result.stdout.splitlines()
if line.startswith("ln -fs unit/")
]
self.assertCountEqual(
symlinks,
[f"ln -fs unit/{target} {target}" for target in MYSQLX_BRIDGE_TARGETS],
result.stdout,
)


if __name__ == "__main__":
unittest.main()
20 changes: 11 additions & 9 deletions test/tap/tests/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -293,15 +293,17 @@ test_tokenizer-t: test_tokenizer-t.cpp $(TAP_LDIR)/libtap$(SHLIB_EXT)
test_mysql_query_digests_stages-t: test_mysql_query_digests_stages-t.cpp $(TAP_LDIR)/libtap$(SHLIB_EXT)
$(CXX) $< $(IDIRS) $(LDIRS) $(OPT) $(MYLIBS) -o $@

.PHONY: test_mysqlx_plugin_load-t
test_mysqlx_plugin_load-t:
$(MAKE) -C unit test_mysqlx_plugin_load-t
ln -fs unit/test_mysqlx_plugin_load-t $@

.PHONY: test_mysqlx_admin_tables-t
test_mysqlx_admin_tables-t:
$(MAKE) -C unit test_mysqlx_admin_tables-t
ln -fs unit/test_mysqlx_admin_tables-t $@
MYSQLX_BRIDGE_TESTS := test_mysqlx_plugin_load-t test_mysqlx_admin_tables-t

# Build both bridge tests in one unit submake. Separate recursive makes do not
# share a dependency graph and can otherwise rebuild common objects such as
# unit/obj/test_init.o concurrently.
.PHONY: mysqlx-bridge-tests $(MYSQLX_BRIDGE_TESTS)
mysqlx-bridge-tests:
$(MAKE) -C unit $(MYSQLX_BRIDGE_TESTS)

$(MYSQLX_BRIDGE_TESTS): mysqlx-bridge-tests
ln -fs unit/$@ $@

# test_mysqlx_listener_smoke-t was retired with the dormant MysqlxWorker
# path in 98aee7db2. Listener-lifecycle coverage now lives in
Expand Down
Loading