chore: tighten scheduling review coverage
This commit is contained in:
@@ -141,7 +141,6 @@ def test_candidate_is_at_most_one(tmp_path: Path) -> None:
|
||||
store.save_candidate(first, schedule_id="a")
|
||||
store.save_candidate(second, schedule_id="a")
|
||||
assert store.get_candidate("a") is not None
|
||||
assert store.get_candidate("a") is not None
|
||||
assert store.get_candidate("a").intended_at == datetime( # type: ignore[union-attr]
|
||||
2026, 9, 8, 13, 0, tzinfo=UTC
|
||||
)
|
||||
@@ -202,30 +201,6 @@ def test_inspection_payload_carries_contract_fields(tmp_path: Path) -> None:
|
||||
assert row["reason"] == "active=['run-1']"
|
||||
|
||||
|
||||
def test_deployment_revision_increments_on_save(tmp_path: Path) -> None:
|
||||
from wf_artifacts import FileWorkflowArtifactStore, WorkflowDeployment
|
||||
|
||||
artifacts = FileWorkflowArtifactStore(tmp_path)
|
||||
artifacts.save_deployment(
|
||||
WorkflowDeployment(
|
||||
id="dep-1",
|
||||
artifact_id="wf-1",
|
||||
artifact_version=1,
|
||||
bindings=[],
|
||||
)
|
||||
)
|
||||
assert artifacts.get_deployment("dep-1").revision == 1
|
||||
artifacts.save_deployment(
|
||||
WorkflowDeployment(
|
||||
id="dep-1",
|
||||
artifact_id="wf-1",
|
||||
artifact_version=2,
|
||||
bindings=[],
|
||||
)
|
||||
)
|
||||
assert artifacts.get_deployment("dep-1").revision == 2
|
||||
|
||||
|
||||
def _tied_entry(
|
||||
kind: str,
|
||||
checkpoint_id: str | None,
|
||||
@@ -248,13 +223,14 @@ def _traverse(store: FileScheduleStore, limit: int) -> list[dict]:
|
||||
"""Walk every page to the end, returning all rows in visit order."""
|
||||
rows: list[dict] = []
|
||||
cursor: str | None = None
|
||||
while True:
|
||||
for _ in range(1000):
|
||||
page = store.list_occurrences("a", cursor=cursor, limit=limit)
|
||||
rows.extend(page["occurrences"]) # type: ignore[arg-type]
|
||||
cursor = page["next_cursor"] # type: ignore[assignment]
|
||||
if cursor is None:
|
||||
assert page["total"] == len(rows)
|
||||
return rows
|
||||
raise AssertionError(f"pagination did not terminate; visited {len(rows)} rows")
|
||||
|
||||
|
||||
def test_history_pagination_visits_every_tied_entry_once(tmp_path: Path) -> None:
|
||||
|
||||
Reference in New Issue
Block a user