From b87c4b8deda330b11ce3fcdfd7e87fce9c7ea816 Mon Sep 17 00:00:00 2001 From: xiaomage Date: Wed, 9 Sep 2026 13:28:44 +0800 Subject: [PATCH] test(nightly): candidate manifest records the built tree, not GITHUB_SHA test_checkout_sha_mismatch_fails_before_upload guarded the removed SOURCE_SHA == GITHUB_SHA hard check. Under a ref override the two intentionally diverge; the manifest now advertises the checked-out HEAD, so assert exactly that. --- scripts/test_nightly_candidate.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/scripts/test_nightly_candidate.py b/scripts/test_nightly_candidate.py index 3e5a50401..a1dca2405 100644 --- a/scripts/test_nightly_candidate.py +++ b/scripts/test_nightly_candidate.py @@ -163,12 +163,13 @@ SH self.assertFalse(self.store.exists()) self.assertEqual(list(self.root.glob("nightly-awscli.*")), []) - def test_checkout_sha_mismatch_fails_before_upload(self): + def test_manifest_advertises_checked_out_head_even_when_github_sha_differs(self): + # With a ref override (NIGHTLY_BRANCH variable / dispatch `branch` + # input) the checked-out HEAD intentionally differs from GITHUB_SHA; + # the candidate manifest must record the tree that was built. result = self.run_publish(GITHUB_SHA="f" * 40) - self.assertNotEqual(result.returncode, 0) - self.assertIn("Checkout SHA", result.stderr) - self.assertFalse(self.output.exists()) - self.assertFalse((self.root / "aws.log").exists()) + self.assertEqual(result.returncode, 0, result.stderr) + self.assertEqual(self.manifest()["source_sha"], self.sha) def test_same_date_builds_and_reruns_keep_distinct_candidates(self): urls = []