From 16eccf55500ff884fe73f054bf50903a4e7d44cd Mon Sep 17 00:00:00 2001 From: Samuel Cui Date: Sat, 31 Oct 2026 15:46:55 +0800 Subject: [PATCH] Remove the four-GiB performance fixture compatibility helper The package controllers use generate-jsonl, verify, capacity-reflink and sample; only a unit test still called the old generate helper. The test now uses fixture_records directly. Co-Authored-By: Claude Opus 5.5 --- e2e/physical_performance_fixture.py | 10 +--------- e2e/test_physical_performance.py | 4 ++-- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/e2e/physical_performance_fixture.py b/e2e/physical_performance_fixture.py index b9061b9..d00c155 100644 --- a/e2e/physical_performance_fixture.py +++ b/e2e/physical_performance_fixture.py @@ -48,12 +48,6 @@ def fixture_records(directory, case, size_gib=4): yield {"name": path.name, "size": size, "sha256": digest.hexdigest()} -def generate(directory, case): - # Compatibility for the original four-GiB helper; long runs use JSON Lines. - return {row["name"]: {"size": row["size"], "sha256": row["sha256"]} - for row in fixture_records(directory, case)} - - def generate_jsonl(directory, case, size_gib, manifest): if Path(directory).resolve() in Path(manifest).resolve().parents: raise ValueError("Fixture manifest must remain outside the selected source directory") @@ -241,9 +235,7 @@ def sample(tape_directory, pages=("34", "0C")): if __name__ == "__main__": command, *arguments = sys.argv[1:] - if command == "generate": - output = generate(*arguments) - elif command == "generate-jsonl": + if command == "generate-jsonl": output = generate_jsonl(*arguments) elif command == "capacity-reflink": output = capacity_reflink(arguments[0], json.loads(arguments[1])) diff --git a/e2e/test_physical_performance.py b/e2e/test_physical_performance.py index 701af9e..c307235 100644 --- a/e2e/test_physical_performance.py +++ b/e2e/test_physical_performance.py @@ -90,8 +90,8 @@ class PerformanceFixtureTests(unittest.TestCase): def test_deterministic_fixture_and_batched_restore_check(self): with tempfile.TemporaryDirectory() as root, mock.patch.dict(fixture.MATRIX, {"tiny": (2, 256 * 1024, True)}): first, second = Path(root) / "one", Path(root) / "two" - manifest = fixture.generate(first, "tiny") - self.assertEqual(fixture.generate(second, "tiny"), manifest) + manifest = {row["name"]: {"size": row["size"], "sha256": row["sha256"]} for row in fixture.fixture_records(first, "tiny")} + self.assertEqual([row["sha256"] for row in fixture.fixture_records(second, "tiny")], [value["sha256"] for value in manifest.values()]) for name, expected in manifest.items(): data = (first / name).read_bytes() self.assertEqual(len(data), expected["size"])