summaryrefslogtreecommitdiff
path: root/.github/scripts/tests/test_release_workflow_policy.py
diff options
context:
space:
mode:
authorChristoph Berg <myon@debian.org>2026-10-14 14:39:32 +0200
committerChristoph Berg <myon@debian.org>2026-10-14 14:39:32 +0200
commitcc627cc2a9a66014fa25c4c2c81c1b26833564e4 (patch)
tree47f39d2c2d0f7228a5c9dd91c1b7213471272d21 /.github/scripts/tests/test_release_workflow_policy.py
parent95a9df4014710930dc3011546ca0673e7531c1ce (diff)
parentc576a4281ef8c87990ae6399393a827dfaccacd5 (diff)
Update upstream source from tag 'upstream/3.3.0_beta2+dfsg'
Update to upstream version '3.3.0~beta2+dfsg' with Debian dir 2b24afa6aafe083cbcb475061c2678a067f4608b
Diffstat (limited to '.github/scripts/tests/test_release_workflow_policy.py')
-rw-r--r--.github/scripts/tests/test_release_workflow_policy.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/.github/scripts/tests/test_release_workflow_policy.py b/.github/scripts/tests/test_release_workflow_policy.py
index 8765cbe1..68e8c23d 100644
--- a/.github/scripts/tests/test_release_workflow_policy.py
+++ b/.github/scripts/tests/test_release_workflow_policy.py
@@ -150,6 +150,22 @@ class ReleaseWorkflowPolicyTests(unittest.TestCase):
self.assertEqual(len(re.findall(r"^\s+continue$", publish, re.M)), 1)
self.assertEqual(publish.count('cmp "$file"'), 1)
+ def test_a_new_release_body_carries_the_change_list_or_keeps_the_generated_notes(self):
+ self.assertIn("fetch-depth: 0", job(PUBLIC, "publish"))
+ publish = step(PUBLIC, "Publish public GitHub Release")
+ self.assertIn("--generate-notes", publish)
+ notes = publish[publish.index('if [ "$CREATED" = true ]; then'):]
+ self.assertIn('CHANGES=$(python3 .github/scripts/generate-change-list.py \\\n'
+ ' "$GITHUB_REPOSITORY" "$GITHUB_REF_NAME" || true)', notes)
+ self.assertRegex(notes, r'if \[ -z "\$CHANGES" \]; then\s+echo "::warning::[^"]*"\s+'
+ r'CHANGES=\$\(gh release view "\$GITHUB_REF_NAME" --json body --jq \.body \|\| true\)')
+ # Notes never fail a publication, and a body without changes never replaces GitHub's notes.
+ edit = notes.index("gh release edit")
+ self.assertRegex(notes[:edit], r'if \[ -z "\$CHANGES" \]; then\s+echo "::warning::[^"]*"\s+else\s+NOTES=\$CHANGES\s')
+ self.assertRegex(notes[edit:], r'^gh release edit "\$GITHUB_REF_NAME" --notes-file "\$RUNNER_TEMP/release-notes.md" \\\n'
+ r'\s+\|\| echo "::warning::[^"]*"\n\s+fi\n')
+ self.assertEqual(notes.count("gh release edit"), 1)
+
def test_windows_signing_guard_admits_only_rc_and_ga(self):
guard = step(SIGN, "Require a public RC or GA invocation")
self.assertIn('test "$(jq -r .channel <<<"$IDENTITY")" = "$CHANNEL"', guard)