CI: parity on main, a batch of merges at a time; releases wait for it
parity-main runs the vanilla harnesses on every push to main, one run at a time: merges that land during a run wait in one pending run, which checks every merge since main's last green parity-main (tools/parity_main.py base, then parity.py --changed). A failure is bisected over the batch's first-parent merges, running only the failing harnesses, and the breaking merge's pull request gets a comment. Game releases ship only a commit both checks and parity-main passed on (release_train.py; release.yml also starts when parity-main finishes; a forced release doesn't wait). The per-PR parity job now runs only for a PR that changes a harness, an oracle, a probe or the runner, or carries run-parity. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -2,6 +2,7 @@ import datetime as dt
|
||||
from pathlib import Path
|
||||
import tempfile
|
||||
import unittest
|
||||
from unittest import mock
|
||||
|
||||
from tools import release_train as train
|
||||
|
||||
@@ -147,6 +148,26 @@ class ReleaseTrainTests(unittest.TestCase):
|
||||
self.assertFalse(train.decision("game", [], NOW, new_line="0.3", blockers=[7])[0])
|
||||
self.assertTrue(train.decision("game", [pr(1)], NOW, blockers=[])[0])
|
||||
|
||||
def test_game_releases_ship_only_what_parity_main_passed(self):
|
||||
def runs(parity, checks):
|
||||
def gh_json(*arguments):
|
||||
table = parity if "parity-main" in arguments else checks
|
||||
if "--commit" in arguments:
|
||||
sha = arguments[arguments.index("--commit") + 1]
|
||||
return [{"status": s, "conclusion": c} for h, s, c in table if h == sha]
|
||||
return [{"headSha": h, "status": s, "conclusion": c} for h, s, c in table]
|
||||
return mock.patch.object(train, "gh_json", gh_json)
|
||||
checks = [("c", "in_progress", ""), ("b", "completed", "success"), ("a", "completed", "success")]
|
||||
with runs([("c", "queued", ""), ("b", "completed", "cancelled"), ("a", "completed", "success")], checks):
|
||||
self.assertEqual(train.green_main_head(), "b", "checks alone: the newest green checks")
|
||||
self.assertEqual(train.green_main_head(parity=True), "a", "a superseded parity-main run counts for nothing")
|
||||
self.assertTrue(train.passed_on("parity-main", "a"))
|
||||
self.assertFalse(train.passed_on("parity-main", "b"))
|
||||
with runs([("b", "completed", "failure"), ("a", "completed", "success")], checks):
|
||||
self.assertIsNone(train.green_main_head(parity=True), "a failed batch holds releases until fixed")
|
||||
with runs([("c", "completed", "success")], checks):
|
||||
self.assertIsNone(train.green_main_head(parity=True), "its checks must pass too")
|
||||
|
||||
def test_a_release_is_published_only_after_its_smoke_test_and_with_no_blocker(self):
|
||||
drew = {"error": None, "frames": 12710, "chunks": 81, "meshed_sections": 550, "player": [160.5, 71.0, 156.5]}
|
||||
self.assertIsNone(train.gate(drew, []))
|
||||
|
||||
Reference in New Issue
Block a user