Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion scripts/type_check_gate.py
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,9 @@ def cmd_check(head: Mapping[str, int], base_ref: str) -> None:
print(
f"FAIL: basedpyright produced no errors, but {BUDGET_PATH.name} allows "
f"up to ~{expected}. The type checker almost certainly crashed or emitted "
f"nothing; refusing to certify a vacuous run."
f"nothing; refusing to certify a vacuous run. This usually means this "
f"branch is missing type checker fixes from its base branch: pull the "
f"latest {DEFAULT_BASE.removeprefix('origin/')} and merge or rebase onto it."
)
raise SystemExit(1)
if not over_ceiling(head, budget):
Expand Down
10 changes: 10 additions & 0 deletions tests/test_litellm/test_type_check_gate.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,16 @@ def test_genuine_zero_and_empty_budget_are_not_vacuous():
)


def test_vacuous_run_failure_tells_the_user_to_pull_latest_staging(capsys):
import pytest

with pytest.raises(SystemExit):
gate.cmd_check({}, gate.DEFAULT_BASE)
out = capsys.readouterr().out
assert "refusing to certify a vacuous run" in out
assert "pull the latest litellm_internal_staging and merge or rebase onto it" in out


def test_update_ratchets_a_limit_down_by_what_the_branch_fixed():
# A rule that dropped from 40 (branch point) to 30 (current) fixed 10, so its
# limit of 100 falls to 90 -- the granted headroom (60) is preserved, not the
Expand Down