Skip to content
Open

test #22

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
13 changes: 12 additions & 1 deletion .github/workflows/all_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,22 @@ jobs:
# - ci_top_attention_doc_page_build validates doc build through the prebuilt Docker image.
# - ci_top_attention_bin_kvtest keeps the Rust kv_test entry under the testbed scene contract.
# - ci_top_attention_mq_core keeps MQ correctness coverage inside the same CI testbed contract.
# - ci_top_attention_mq_mpsc / ci_top_attention_mq_mpmc / ci_top_attention_mq_mpmc_bench
# keep the API channel and heavier MPMC bench-style coverage in the same CI contract.
# - ci_top_attention_ctrl_c_kv / ci_top_attention_ctrl_c_mq keep signal-exit coverage
# under the runner-native CI scene model instead of ad hoc side entrypoints.
suite["scenes"] = {
key: value
for key, value in suite["scenes"].items()
if key in (
"ci_top_attention_doc_page_build",
"ci_top_attention_bin_kvtest",
"ci_top_attention_mq_core",
"ci_top_attention_mq_mpsc",
"ci_top_attention_mq_mpmc",
"ci_top_attention_mq_mpmc_bench",
"ci_top_attention_ctrl_c_kv",
"ci_top_attention_ctrl_c_mq",
)
}

Expand All @@ -95,8 +104,10 @@ jobs:
# Scale selection:
# - Keep the original per-scene scales from ci_test_list.yaml.
# - ci_top_attention_doc_page_build stays on n1_kvowner_dram_3gib.
# - ci_top_attention_ctrl_c_kv stays on n1_kvowner_dram_3gib.
# - ci_top_attention_bin_kvtest stays on n1_kvowner_dram_20gib.
# - ci_top_attention_mq_core stays on n1_kvowner_dram_20gib.
# - ci_top_attention_mq_core / ci_top_attention_mq_mpsc / ci_top_attention_mq_mpmc /
# ci_top_attention_mq_mpmc_bench / ci_top_attention_ctrl_c_mq stay on n1_kvowner_dram_20gib.

out_path.write_text(
yaml.safe_dump(suite, sort_keys=False, allow_unicode=False),
Expand Down
60 changes: 60 additions & 0 deletions fluxon_test_stack/ci_test_list.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,46 @@ scenes:
scales: [n1_kvowner_dram_20gib]
profiles: [fluxon_tcp]

ci_top_attention_mq_mpsc:
ci:
subject: mq
runtime_contract: cluster_kv_owner
select:
scales: [n1_kvowner_dram_20gib]
profiles: [fluxon_tcp]

ci_top_attention_mq_mpmc:
ci:
subject: mq
runtime_contract: cluster_kv_owner
select:
scales: [n1_kvowner_dram_20gib]
profiles: [fluxon_tcp]

ci_top_attention_mq_mpmc_bench:
ci:
subject: mq
runtime_contract: cluster_kv_owner
select:
scales: [n1_kvowner_dram_20gib]
profiles: [fluxon_tcp]

ci_top_attention_ctrl_c_kv:
ci:
subject: rust
runtime_contract: rust_self_managed
select:
scales: [n1_kvowner_dram_3gib]
profiles: [fluxon_tcp]

ci_top_attention_ctrl_c_mq:
ci:
subject: mq
runtime_contract: cluster_kv_owner
select:
scales: [n1_kvowner_dram_20gib]
profiles: [fluxon_tcp]

kv_read_heavy_zipf:
test_stack:
mode: KVSTORE
Expand Down Expand Up @@ -320,6 +360,11 @@ profiles:
ci_top_attention_bin_kvtest:
kv_test_rounds: all
ci_top_attention_mq_core: {}
ci_top_attention_mq_mpsc: {}
ci_top_attention_mq_mpmc: {}
ci_top_attention_mq_mpmc_bench: {}
ci_top_attention_ctrl_c_kv: {}
ci_top_attention_ctrl_c_mq: {}
runtime_contracts:
cluster_kv_owner: &cluster_kv_owner_runtime
base_runtime:
Expand Down Expand Up @@ -466,6 +511,11 @@ profiles:
ci_top_attention_bin_kvtest:
kv_test_rounds: all
ci_top_attention_mq_core: {}
ci_top_attention_mq_mpsc: {}
ci_top_attention_mq_mpmc: {}
ci_top_attention_mq_mpmc_bench: {}
ci_top_attention_ctrl_c_kv: {}
ci_top_attention_ctrl_c_mq: {}
test_stack:
<<: *common_test_stack_runtime
fluxon_sockudo_ws:
Expand All @@ -479,6 +529,11 @@ profiles:
ci_top_attention_bin_kvtest:
kv_test_rounds: all
ci_top_attention_mq_core: {}
ci_top_attention_mq_mpsc: {}
ci_top_attention_mq_mpmc: {}
ci_top_attention_mq_mpmc_bench: {}
ci_top_attention_ctrl_c_kv: {}
ci_top_attention_ctrl_c_mq: {}
test_stack:
<<: *common_test_stack_runtime
fluxon_tcp:
Expand All @@ -492,6 +547,11 @@ profiles:
ci_top_attention_bin_kvtest:
kv_test_rounds: all
ci_top_attention_mq_core: {}
ci_top_attention_mq_mpsc: {}
ci_top_attention_mq_mpmc: {}
ci_top_attention_mq_mpmc_bench: {}
ci_top_attention_ctrl_c_kv: {}
ci_top_attention_ctrl_c_mq: {}
test_stack:
<<: *common_test_stack_runtime
redis_sharded:
Expand Down
65 changes: 65 additions & 0 deletions fluxon_test_stack/test_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,11 @@ def _runner_native_ci_scene_ids() -> Tuple[str, ...]:
"ci_top_attention_doc_page_build",
"ci_top_attention_bin_kvtest",
"ci_top_attention_mq_core",
"ci_top_attention_mq_mpsc",
"ci_top_attention_mq_mpmc",
"ci_top_attention_mq_mpmc_bench",
"ci_top_attention_ctrl_c_kv",
"ci_top_attention_ctrl_c_mq",
)


Expand Down Expand Up @@ -7039,6 +7044,66 @@ def _runner_native_ci_commands_for_case(case: _ResolvedCase, *, ctx: str) -> Lis
"timeout_seconds": 21600,
}
]
if scene_id == "ci_top_attention_mq_mpsc":
return [
{
"id": "top_attention_mq_mpsc",
"command": (
"__RUN_DIR__/venv/bin/python3 -u "
"__RUN_DIR__/src/fluxon_test_stack/top_attention_test_index/_mq_mpsc.py "
"--case-config __RUN_DIR__/configs/ci_scene_config.yaml"
),
"timeout_seconds": 21600,
}
]
if scene_id == "ci_top_attention_mq_mpmc":
return [
{
"id": "top_attention_mq_mpmc",
"command": (
"__RUN_DIR__/venv/bin/python3 -u "
"__RUN_DIR__/src/fluxon_test_stack/top_attention_test_index/_mq_mpmc.py "
"--case-config __RUN_DIR__/configs/ci_scene_config.yaml"
),
"timeout_seconds": 21600,
}
]
if scene_id == "ci_top_attention_mq_mpmc_bench":
return [
{
"id": "top_attention_mq_mpmc_bench",
"command": (
"__RUN_DIR__/venv/bin/python3 -u "
"__RUN_DIR__/src/fluxon_test_stack/top_attention_test_index/_mq_mpmc_bench.py "
"--case-config __RUN_DIR__/configs/ci_scene_config.yaml"
),
"timeout_seconds": 21600,
}
]
if scene_id == "ci_top_attention_ctrl_c_kv":
return [
{
"id": "top_attention_ctrl_c_kv",
"command": (
"__RUN_DIR__/venv/bin/python3 -u "
"__RUN_DIR__/src/fluxon_test_stack/top_attention_test_index/_ctrl_c_kv.py "
"--case-config __RUN_DIR__/configs/ci_scene_config.yaml"
),
"timeout_seconds": 10800,
}
]
if scene_id == "ci_top_attention_ctrl_c_mq":
return [
{
"id": "top_attention_ctrl_c_mq",
"command": (
"__RUN_DIR__/venv/bin/python3 -u "
"__RUN_DIR__/src/fluxon_test_stack/top_attention_test_index/_ctrl_c_mq.py "
"--case-config __RUN_DIR__/configs/ci_scene_config.yaml"
),
"timeout_seconds": 21600,
}
]
raise ValueError(f"{ctx} unsupported runner-native CI scene: {scene_id!r}")


Expand Down
50 changes: 50 additions & 0 deletions fluxon_test_stack/tests/test_ci_2_virt_node_contract.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ class TestCi2VirtNodeContract(unittest.TestCase):
_KVTEST_SCENE_ID = "ci_top_attention_bin_kvtest"
_DOC_SCENE_ID = "ci_top_attention_doc_page_build"
_MQ_SCENE_ID = "ci_top_attention_mq_core"
_MQ_MPSC_SCENE_ID = "ci_top_attention_mq_mpsc"
_MQ_MPMC_SCENE_ID = "ci_top_attention_mq_mpmc"
_MQ_MPMC_BENCH_SCENE_ID = "ci_top_attention_mq_mpmc_bench"
_CTRL_C_KV_SCENE_ID = "ci_top_attention_ctrl_c_kv"
_CTRL_C_MQ_SCENE_ID = "ci_top_attention_ctrl_c_mq"

def test_generated_suite_is_public_dual_local_nodes_ci_only(self) -> None:
suite_cfg = _ENTRY._load_yaml_mapping(_ENTRY.DEFAULT_SUITE_PATH, ctx="suite")
Expand Down Expand Up @@ -148,6 +153,51 @@ def test_generated_suite_supports_mq_core_ci_scene(self) -> None:
)
self.assertEqual(set(generated["scales"].keys()), {"n1_kvowner_dram_20gib"})

def test_generated_suite_supports_extra_ci_scenes(self) -> None:
suite_cfg = _ENTRY._load_yaml_mapping(_ENTRY.DEFAULT_SUITE_PATH, ctx="suite")
scene_ids = [
self._MQ_MPSC_SCENE_ID,
self._MQ_MPMC_SCENE_ID,
self._MQ_MPMC_BENCH_SCENE_ID,
self._CTRL_C_KV_SCENE_ID,
self._CTRL_C_MQ_SCENE_ID,
]
generated = _ENTRY._rewrite_suite_for_local_dual_nodes(
suite_cfg=suite_cfg,
scene_ids=scene_ids,
primary_node_name="local-node-a",
secondary_node_name="local-node-b",
host_ip="10.1.1.119",
wheel_name="fluxon-0.2.1-cp38-abi3-manylinux_2_28_x86_64.whl",
controller_port=19080,
)

self.assertEqual(set(generated["scenes"].keys()), set(scene_ids))
self.assertEqual(
generated["scenes"][self._CTRL_C_KV_SCENE_ID]["ci"]["runtime_contract"],
"rust_self_managed",
)
self.assertEqual(
generated["scenes"][self._CTRL_C_MQ_SCENE_ID]["ci"]["runtime_contract"],
"cluster_kv_owner",
)
self.assertEqual(
generated["scenes"][self._MQ_MPSC_SCENE_ID]["ci"]["subject"],
"mq",
)
self.assertEqual(
generated["scenes"][self._MQ_MPMC_SCENE_ID]["ci"]["subject"],
"mq",
)
self.assertEqual(
generated["scenes"][self._MQ_MPMC_BENCH_SCENE_ID]["ci"]["subject"],
"mq",
)
self.assertEqual(
set(generated["scales"].keys()),
{"n1_kvowner_dram_3gib", "n1_kvowner_dram_20gib"},
)

def test_generated_suite_preserves_source_scene_configs(self) -> None:
suite_cfg = _ENTRY._load_yaml_mapping(_ENTRY.DEFAULT_SUITE_PATH, ctx="suite")
suite_cfg["profiles"]["fluxon_tcp"]["runtime"]["ci"]["scene_configs"][self._KVTEST_SCENE_ID]["kv_test_rounds"] = "p2p_only"
Expand Down
23 changes: 23 additions & 0 deletions fluxon_test_stack/tests/test_runner_contract.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ def _build_checks(selected_test_id: Optional[str]) -> List[Tuple[str, Callable[[
"ci_top_attention_mq_core_uses_cluster_kv_owner_runtime",
test_ci_top_attention_mq_core_uses_cluster_kv_owner_runtime,
),
(
"ci_top_attention_extra_runner_native_scenes_are_registered",
test_ci_top_attention_extra_runner_native_scenes_are_registered,
),
]
if selected_test_id is None:
return checks
Expand Down Expand Up @@ -291,5 +295,24 @@ def test_ci_top_attention_mq_core_uses_cluster_kv_owner_runtime() -> None:
print("PASS: test_ci_top_attention_mq_core_uses_cluster_kv_owner_runtime")


def test_ci_top_attention_extra_runner_native_scenes_are_registered() -> None:
expected = {
"ci_top_attention_mq_mpsc",
"ci_top_attention_mq_mpmc",
"ci_top_attention_mq_mpmc_bench",
"ci_top_attention_ctrl_c_kv",
"ci_top_attention_ctrl_c_mq",
}
actual = set(_TEST_RUNNER._runner_native_ci_scene_ids())
missing = sorted(expected - actual)
if missing:
print(
"FAIL: test_ci_top_attention_extra_runner_native_scenes_are_registered - "
f"missing scenes: {missing!r}"
)
return
print("PASS: test_ci_top_attention_extra_runner_native_scenes_are_registered")


if __name__ == "__main__":
raise SystemExit(main())
19 changes: 19 additions & 0 deletions fluxon_test_stack/tests/test_test_runner_testbed_contract.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,25 @@ def test_top_attention_mq_core_ci_execution_plan_is_runner_native(self) -> None:
)
self.assertIn("--case-config __RUN_DIR__/configs/ci_scene_config.yaml", planned[0].ci_commands[0]["command"])

def test_top_attention_extra_ci_execution_plans_are_runner_native(self) -> None:
suite_cfg = yaml.safe_load((_RUNNER.RUNNER_REPO_ROOT / "fluxon_test_stack" / "ci_test_list.yaml").read_text(encoding="utf-8"))
suite = _RUNNER._parse_suite_config(suite_cfg)
cases = _RUNNER._expand_cases(suite)
expected = {
"ci_top_attention_mq_mpsc": ("top_attention_mq_mpsc", "_mq_mpsc.py"),
"ci_top_attention_mq_mpmc": ("top_attention_mq_mpmc", "_mq_mpmc.py"),
"ci_top_attention_mq_mpmc_bench": ("top_attention_mq_mpmc_bench", "_mq_mpmc_bench.py"),
"ci_top_attention_ctrl_c_kv": ("top_attention_ctrl_c_kv", "_ctrl_c_kv.py"),
"ci_top_attention_ctrl_c_mq": ("top_attention_ctrl_c_mq", "_ctrl_c_mq.py"),
}
for scene_id, (command_id, script_name) in expected.items():
case = next(item for item in cases if item.scene_id == scene_id and item.profile_id == "fluxon_tcp")
planned = _RUNNER._build_ci_execution_plan(case, suite)
self.assertEqual(len(planned), 1)
self.assertEqual(planned[0].ci_commands[0]["id"], command_id)
self.assertIn(script_name, planned[0].ci_commands[0]["command"])
self.assertIn("--case-config __RUN_DIR__/configs/ci_scene_config.yaml", planned[0].ci_commands[0]["command"])

def test_doc_page_ci_execution_plan_uses_online_docker_image(self) -> None:
suite_cfg = yaml.safe_load((_RUNNER.RUNNER_REPO_ROOT / "fluxon_test_stack" / "ci_test_list.yaml").read_text(encoding="utf-8"))
suite = _RUNNER._parse_suite_config(suite_cfg)
Expand Down
Loading
Loading