Skip to content
Merged
Changes from all commits
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
14 changes: 14 additions & 0 deletions tests/test_head_review.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,20 @@ def test_judge_ok_and_back_dispatch_orderless_prs_without_positional_edit_ids(he
assert len(tuple(call for call in github.calls() if f"statuses/{request.head}" in call[1])) == 2


def test_judge_reviewing_after_ok_withdraws_the_accepted_status_on_that_head(head_bus):
"""GitHub keeps the newest status per context on a commit, so reviewing an approved head
holds it out of the merge queue until a new ok."""
comms, github, request = head_bus
context = order.Commander.read_root(comms.root)
common = ["--repo", request.repo.to_wire(), "--pr", str(request.pr), "--head", request.head,
"--why", ACCEPTED.text]
judge.main(["ok", *common], context)
judge.main(["reviewing", *common], context)
posts = tuple(call for call in github.calls() if f"statuses/{request.head}" in call[1])
assert [next(part for part in post if part.startswith("state=")) for post in posts] == [
"state=success", "state=pending"]


def test_moved_head_posts_and_records_nothing(head_bus):
comms, github, request = head_bus
moved = replace(request, head="a" * 40)
Expand Down
Loading