Bind visualization status to snapshot freshness
This commit is contained in:
parent
24bd13f9d9
commit
176b2d2784
9 changed files with 627 additions and 43 deletions
|
|
@ -533,6 +533,20 @@ class AdapterContractTests(unittest.TestCase):
|
|||
self.assertEqual(0, read_counters["adapter_source_extractions"])
|
||||
self.assertEqual(0, read_counters["index_builds"])
|
||||
|
||||
pinned_state = project.incremental_state()
|
||||
assert pinned_state is not None
|
||||
loader.sources["guide.foundation"] = "Changed after viewer pin."
|
||||
client = ViewerManagerClient(index)
|
||||
self.assertEqual(
|
||||
"stale",
|
||||
client._source_state(
|
||||
{
|
||||
"revision": pinned_state.revision,
|
||||
"source_hash": pinned_state.source_hash,
|
||||
}
|
||||
),
|
||||
)
|
||||
|
||||
legacy = AdapterProject(
|
||||
Loader(self.projection(root)),
|
||||
cache_root=root / ".cache" / "legacy",
|
||||
|
|
@ -544,6 +558,15 @@ class AdapterContractTests(unittest.TestCase):
|
|||
self.assertEqual(1, legacy_counters["project_loads"])
|
||||
self.assertEqual(1, legacy_counters["adapter_projection_loads"])
|
||||
self.assertEqual(0, legacy_counters["adapter_source_extractions"])
|
||||
self.assertEqual(
|
||||
"unknown",
|
||||
ViewerManagerClient(ProjectIndex(legacy))._source_state(
|
||||
{
|
||||
"revision": "legacy",
|
||||
"source_hash": "0" * 64,
|
||||
}
|
||||
),
|
||||
)
|
||||
|
||||
def test_incremental_adapter_reuses_sources_and_invalidates_reverse_dependencies(self) -> None:
|
||||
with tempfile.TemporaryDirectory() as directory:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue