From 0cfa3c79a30a6e884676a1e1d85aa3413fa25538 Mon Sep 17 00:00:00 2001 From: Fengzdadi <453788063@qq.com> Date: Mon, 26 Oct 2026 16:25:10 -0400 Subject: [PATCH] test(release): isolate parallel gate fixtures from PC_UPGRADE_SOURCE_SHA Since #2248 the parallel upgrade gate identifies the checkout by PC_UPGRADE_SOURCE_SHA and falls back to GITHUB_SHA, and upgrade-release.yml exports PC_UPGRADE_SOURCE_SHA to every step. The checkout case of test_parallel_workers_reject_changed_preparation_inputs changes only GITHUB_SHA, so inside the upgrade acceptance job the identity the gate reads stays the same and no GateError is raised. Locally and in the unit test job the variable is unset, the gate falls back to GITHUB_SHA, and the case passes. The parallel_reports fixture now unsets the variable, so these tests model an unpinned checkout in any environment and keep covering the GITHUB_SHA fallback. The pinned path stays covered by test_manual_release_evidence_tracks_target_checkout_not_workflow_commit, which sets both variables. --- tests/test_upgrade_release_gate.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/test_upgrade_release_gate.py b/tests/test_upgrade_release_gate.py index 7c9beeefdd..976a5feb8c 100644 --- a/tests/test_upgrade_release_gate.py +++ b/tests/test_upgrade_release_gate.py @@ -922,6 +922,8 @@ def parallel_reports(release, monkeypatch, request): dist = root / "dist" dist.mkdir() shutil.copyfile(wheel, dist / wheel.name) + # Model an unpinned checkout even inside the upgrade workflow, which exports PC_UPGRADE_SOURCE_SHA. + monkeypatch.delenv("PC_UPGRADE_SOURCE_SHA", raising=False) prepared = root / "prepared" scheduled = parallel.prepare(root, dist, prepared, release=False, release_notes=None, selection=selection) executed = []