mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-05 15:58:53 +00:00
From PR #5870 (kaban-baku; its commit dd275381f), author kept. A run config with the MTP draft layer carries
--prefill-head-alias --short-read 0. quant_quality.py replaces --short-read with its own value, and the engine refuses
--prefill-head-alias without --short-read 0, so the yardstick's engine stopped before READY. The flag is added to the
list of flags the tool drops from the run config. Applies on the 0.2.16 layout (tools/ -> terminal/tools/); the PR's
new test (test_quant_quality_args.py, one test) is kept at terminal/tools/. It fails on the old code and passes with
the change.
29 lines
1.0 KiB
Python
29 lines
1.0 KiB
Python
"""Tests for the engine command tools/quant_quality.py builds, without starting an engine.
|
|
|
|
python -m unittest tools.test_quant_quality_args
|
|
"""
|
|
from __future__ import annotations
|
|
|
|
import sys
|
|
import unittest
|
|
from pathlib import Path
|
|
|
|
ROOT = Path(__file__).resolve().parents[1]
|
|
sys.path.insert(0, str(ROOT / "tools"))
|
|
import quant_quality as QQ # noqa: E402
|
|
|
|
|
|
class EngineArgs(unittest.TestCase):
|
|
def test_drops_prefill_head_alias(self):
|
|
# A run config with MTP carries --prefill-head-alias --short-read 0; the yardstick replaces --short-read,
|
|
# and the engine refuses --prefill-head-alias without --short-read 0, so it stopped before READY (#5553).
|
|
cfg = {"exe": "strata", "args": ["--pack", "P", "--prefill-head-alias", "--short-read", "0", "--kv", "int8"]}
|
|
cmd = QQ.engine_args(cfg, None, 1000)
|
|
self.assertNotIn("--prefill-head-alias", cmd)
|
|
self.assertEqual(cmd.count("--short-read"), 1)
|
|
self.assertEqual(cmd[cmd.index("--short-read") + 1], "1064")
|
|
|
|
|
|
if __name__ == "__main__":
|
|
unittest.main()
|