Skip to content

Commit 4104a55

Browse files
committed
test: trim agentic eval bucket tests to essential coverage
Collapse fixtures into module constants, merge the accept/reject checks into one test, and drop redundant cases; added test lines go from 212 to 100 with the two core guards kept (agentic rows validate only in agentic_evals; realistic rows split end-to-end through the real schema). 中文:精简 agentic 评估分桶测试——fixture 合并为模块常量,接受/拒绝检查合并 为单个测试并移除冗余用例,新增测试行数从 212 降至 100,保留两项核心守卫 (agentic 行仅能通过 agentic_evals 校验;真实行形状端到端经过真实 schema 拆分)。
1 parent d374605 commit 4104a55

2 files changed

Lines changed: 45 additions & 157 deletions

File tree

utils/matrix_logic/test_validation.py

Lines changed: 24 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -1405,108 +1405,44 @@ def test_scenario_type_must_be_nonempty_and_supported(self, scenario_type):
14051405
# Test ChangelogMatrixEntry
14061406
# =============================================================================
14071407

1408-
@pytest.fixture
1409-
def valid_agentic_eval_row():
1410-
"""Agentic SWE-bench eval row as emitted by generate_sweep_configs --evals-only."""
1411-
return {
1412-
"image": "vllm/vllm-openai:nightly-dev-x86_64-cu13.0.1-904e4ec",
1413-
"model": "deepseek-ai/DeepSeek-V4-Pro",
1414-
"model-prefix": "dsv4",
1415-
"precision": "fp4",
1416-
"framework": "vllm",
1417-
"runner": "cluster:b300-nv",
1418-
"tp": 8,
1419-
"pp": 1,
1420-
"dcp-size": 1,
1421-
"pcp-size": 1,
1422-
"ep": 8,
1423-
"dp-attn": True,
1424-
"spec-decoding": "mtp",
1425-
"conc": 224,
1426-
"kv-offloading": "none",
1427-
"router": {"name": "vllm-router", "version": "0.1.14"},
1428-
"total-cpu-dram-gb": 0,
1429-
"duration": 3600,
1430-
"exp-name": "dsv4_tp8_conc224_kvnone_spec-mtp",
1431-
"scenario-type": "agentic-coding",
1432-
"run-eval": True,
1433-
"eval-only": True,
1434-
}
1435-
1436-
1437-
@pytest.fixture
1438-
def valid_changelog_metadata():
1439-
return {
1440-
"base_ref": "base",
1441-
"head_ref": "head",
1442-
"entries": [{
1443-
"config-keys": ["test-config"],
1444-
"description": ["Test entry"],
1445-
"pr-link": "https://github.com/SemiAnalysisAI/InferenceX/pull/1",
1446-
}],
1447-
}
1408+
AGENTIC_EVAL_ROW = {
1409+
"image": "vllm/vllm-openai:nightly", "model": "deepseek-ai/DeepSeek-V4-Pro",
1410+
"model-prefix": "dsv4", "precision": "fp4", "framework": "vllm",
1411+
"runner": "cluster:b300-nv", "tp": 8, "pp": 1, "dcp-size": 1,
1412+
"pcp-size": 1, "ep": 8, "dp-attn": True, "spec-decoding": "mtp",
1413+
"conc": 224, "kv-offloading": "none", "total-cpu-dram-gb": 0,
1414+
"duration": 3600, "exp-name": "dsv4_tp8_conc224_kvnone_spec-mtp",
1415+
"scenario-type": "agentic-coding", "run-eval": True, "eval-only": True,
1416+
}
1417+
1418+
CHANGELOG_METADATA = {
1419+
"base_ref": "base", "head_ref": "head",
1420+
"entries": [{
1421+
"config-keys": ["test-config"], "description": ["Test entry"],
1422+
"pr-link": "https://github.com/SemiAnalysisAI/InferenceX/pull/1",
1423+
}],
1424+
}
14481425

14491426

14501427
class TestChangelogMatrixEntry:
14511428
"""Tests for the final search-space contract consumed by run-sweep.yml."""
14521429

1453-
def test_agentic_eval_rows_validate_in_agentic_evals(
1454-
self, valid_agentic_eval_row, valid_changelog_metadata,
1455-
):
1430+
def test_agentic_eval_rows_live_in_agentic_evals_only(self):
1431+
"""`evals` is dispatched with fixed-seq-len inputs (isl/osl/
1432+
max-model-len), so agentic rows must only validate in agentic_evals."""
14561433
entry = ChangelogMatrixEntry.model_validate({
1457-
"agentic_evals": [valid_agentic_eval_row],
1458-
"changelog_metadata": valid_changelog_metadata,
1434+
"agentic_evals": [AGENTIC_EVAL_ROW],
1435+
"changelog_metadata": CHANGELOG_METADATA,
14591436
})
1460-
1461-
assert entry.agentic_evals[0].scenario_type == "agentic-coding"
14621437
assert entry.agentic_evals[0].run_eval is True
14631438
assert entry.agentic_evals[0].eval_only is True
14641439

1465-
def test_evals_bucket_rejects_agentic_rows(
1466-
self, valid_agentic_eval_row, valid_changelog_metadata,
1467-
):
1468-
"""The `evals` bucket is dispatched with fixed-seq-len inputs
1469-
(isl/osl/max-model-len), so agentic rows must never validate there."""
14701440
with pytest.raises(ValueError):
14711441
ChangelogMatrixEntry.model_validate({
1472-
"evals": [valid_agentic_eval_row],
1473-
"changelog_metadata": valid_changelog_metadata,
1442+
"evals": [AGENTIC_EVAL_ROW],
1443+
"changelog_metadata": CHANGELOG_METADATA,
14741444
})
14751445

1476-
def test_evals_bucket_accepts_fixed_seq_len_rows(
1477-
self, valid_single_node_matrix_entry, valid_changelog_metadata,
1478-
):
1479-
eval_row = {
1480-
**valid_single_node_matrix_entry,
1481-
"run-eval": True,
1482-
"eval-only": True,
1483-
}
1484-
entry = ChangelogMatrixEntry.model_validate({
1485-
"evals": [eval_row],
1486-
"changelog_metadata": valid_changelog_metadata,
1487-
})
1488-
1489-
assert entry.evals[0].run_eval is True
1490-
assert entry.evals[0].eval_only is True
1491-
1492-
def test_agentic_benchmark_rows_dump_without_eval_flags(
1493-
self, valid_agentic_eval_row, valid_changelog_metadata,
1494-
):
1495-
"""Benchmark rows omit run-eval/eval-only, and exclude_none must keep
1496-
them out of the dump so the dispatched row shape is unchanged."""
1497-
benchmark_row = {
1498-
k: v for k, v in valid_agentic_eval_row.items()
1499-
if k not in ("run-eval", "eval-only")
1500-
}
1501-
entry = ChangelogMatrixEntry.model_validate({
1502-
"single_node": {"agentic": [benchmark_row]},
1503-
"changelog_metadata": valid_changelog_metadata,
1504-
})
1505-
dumped = entry.model_dump(by_alias=True, exclude_none=True)
1506-
1507-
assert "run-eval" not in dumped["single_node"]["agentic"][0]
1508-
assert "eval-only" not in dumped["single_node"]["agentic"][0]
1509-
15101446

15111447
# =============================================================================
15121448
# Test load_config_files

utils/test_process_changelog.py

Lines changed: 21 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -599,91 +599,43 @@ def test_eval_rows_split_into_fixed_and_agentic_buckets(
599599
- Mixed fixed-seq-len and agentic eval selection
600600
pr-link: https://github.com/SemiAnalysisAI/InferenceX/pull/1
601601
"""
602-
603-
fixed_eval_row = {
602+
common = {
604603
"image": "vllm/vllm-openai:v0.11.0",
605-
"model": "deepseek-ai/DeepSeek-V4-Pro",
606-
"model-prefix": "dsv4",
607-
"precision": "fp4",
608-
"framework": "vllm",
609-
"spec-decoding": "mtp",
610-
"runner": "cluster:b300-nv",
611-
"isl": 8192,
612-
"osl": 1024,
613-
"tp": 8,
614-
"pp": 1,
615-
"dcp-size": 1,
616-
"pcp-size": 1,
617-
"ep": 8,
618-
"dp-attn": True,
619-
"conc": 224,
620-
"max-model-len": 10240,
621-
"exp-name": "dsv4_8k1k_fixed_eval",
622-
"disagg": False,
623-
"run-eval": True,
624-
"eval-only": True,
604+
"model": "deepseek-ai/DeepSeek-V4-Pro", "model-prefix": "dsv4",
605+
"precision": "fp4", "framework": "vllm", "spec-decoding": "mtp",
606+
"runner": "cluster:b300-nv", "tp": 8, "pp": 1, "dcp-size": 1,
607+
"pcp-size": 1, "ep": 8, "dp-attn": True, "conc": 224,
608+
"run-eval": True, "eval-only": True,
609+
}
610+
fixed_eval_row = {
611+
**common, "isl": 8192, "osl": 1024, "max-model-len": 10240,
612+
"disagg": False, "exp-name": "fixed_eval",
625613
}
626614
agentic_eval_row = {
627-
"image": "vllm/vllm-openai:v0.11.0",
628-
"model": "deepseek-ai/DeepSeek-V4-Pro",
629-
"model-prefix": "dsv4",
630-
"precision": "fp4",
631-
"framework": "vllm",
632-
"runner": "cluster:b300-nv",
633-
"tp": 8,
634-
"pp": 1,
635-
"dcp-size": 1,
636-
"pcp-size": 1,
637-
"ep": 8,
638-
"dp-attn": True,
639-
"spec-decoding": "mtp",
640-
"conc": 224,
641-
"kv-offloading": "none",
642-
"router": {"name": "vllm-router", "version": "0.1.14"},
643-
"total-cpu-dram-gb": 0,
644-
"duration": 3600,
645-
"exp-name": "dsv4_agentic_eval",
646-
"scenario-type": "agentic-coding",
647-
"run-eval": True,
648-
"eval-only": True,
615+
**common, "kv-offloading": "none", "total-cpu-dram-gb": 0,
616+
"duration": 3600, "scenario-type": "agentic-coding",
617+
"exp-name": "agentic_eval",
649618
}
650619

651620
monkeypatch.setattr(
652-
process_changelog,
653-
"get_added_lines",
654-
lambda *_: added_yaml,
655-
)
621+
process_changelog, "get_added_lines", lambda *_: added_yaml)
656622
monkeypatch.setattr(
657-
process_changelog,
658-
"load_config_files",
659-
lambda _: {"test-config": {}},
660-
)
623+
process_changelog, "load_config_files", lambda _: {"test-config": {}})
661624

662625
def fake_run(command, **kwargs):
663-
if "--evals-only" in command:
664-
stdout = json.dumps([fixed_eval_row, agentic_eval_row])
665-
else:
666-
stdout = "[]"
667-
return SimpleNamespace(stdout=stdout)
626+
is_evals = "--evals-only" in command
627+
rows = [fixed_eval_row, agentic_eval_row] if is_evals else []
628+
return SimpleNamespace(stdout=json.dumps(rows))
668629

669630
monkeypatch.setattr(subprocess, "run", fake_run)
670631
monkeypatch.setattr(sys, "argv", [
671-
"process_changelog.py",
672-
"--base-ref", "base",
673-
"--head-ref", "head",
632+
"process_changelog.py", "--base-ref", "base", "--head-ref", "head",
674633
"--changelog-file", "perf-changelog.yaml",
675634
])
676635

677636
process_changelog.main()
678637

679638
output = json.loads(capsys.readouterr().out)
680-
assert [row["exp-name"] for row in output["evals"]] == [
681-
"dsv4_8k1k_fixed_eval"
682-
]
683-
assert [row["exp-name"] for row in output["agentic_evals"]] == [
684-
"dsv4_agentic_eval"
685-
]
639+
assert [r["exp-name"] for r in output["evals"]] == ["fixed_eval"]
640+
assert [r["exp-name"] for r in output["agentic_evals"]] == ["agentic_eval"]
686641
assert output["multinode_evals"] == []
687-
assert output["agentic_evals"][0]["scenario-type"] == "agentic-coding"
688-
assert output["agentic_evals"][0]["run-eval"] is True
689-
assert output["agentic_evals"][0]["eval-only"] is True

0 commit comments

Comments
 (0)