diff options
Diffstat (limited to 'tests/test_progress_dashboard.py')
| -rw-r--r-- | tests/test_progress_dashboard.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/test_progress_dashboard.py b/tests/test_progress_dashboard.py index ad22e8149..b5a15e80c 100644 --- a/tests/test_progress_dashboard.py +++ b/tests/test_progress_dashboard.py | |||
| @@ -618,6 +618,22 @@ class Outputs(unittest.TestCase): | |||
| 618 | with open(os.path.join(out, "history.json"), encoding="utf-8") as f: | 618 | with open(os.path.join(out, "history.json"), encoding="utf-8") as f: |
| 619 | self.assertEqual(len(json.load(f)), 1) | 619 | self.assertEqual(len(json.load(f)), 1) |
| 620 | 620 | ||
| 621 | def test_different_snapshots_in_the_same_second_are_preserved(self): | ||
| 622 | first = {"generated_at": "2026-11-24T00:00:00Z", "git": {"head": "a" * 40}, | ||
| 623 | "metrics": [], "content_hash": "a" * 64} | ||
| 624 | second = {**first, "git": {"head": "b" * 40}, "content_hash": "b" * 64} | ||
| 625 | with tempfile.TemporaryDirectory() as out: | ||
| 626 | self.assertTrue(pd.write_outputs(first, out)) | ||
| 627 | self.assertTrue(pd.write_outputs(second, out)) | ||
| 628 | self.assertFalse(pd.write_outputs(second, out)) | ||
| 629 | |||
| 630 | folder = Path(out) | ||
| 631 | snapshots = [json.loads(path.read_text(encoding="utf-8")) | ||
| 632 | for path in (folder / "snapshots").glob("progress_*.json")] | ||
| 633 | self.assertCountEqual(snapshots, [first, second]) | ||
| 634 | history = json.loads((folder / "history.json").read_text(encoding="utf-8")) | ||
| 635 | self.assertEqual(history, [pd.summary_line(first), pd.summary_line(second)]) | ||
| 636 | |||
| 621 | def test_unmatched_test_filter_preserves_cached_results(self): | 637 | def test_unmatched_test_filter_preserves_cached_results(self): |
| 622 | with tempfile.TemporaryDirectory() as out: | 638 | with tempfile.TemporaryDirectory() as out: |
| 623 | cached = os.path.join(out, "unit_results.json") | 639 | cached = os.path.join(out, "unit_results.json") |