diff options
| author | Christoph Berg <myon@debian.org> | 2026-10-14 14:39:20 +0200 |
|---|---|---|
| committer | Christoph Berg <myon@debian.org> | 2026-10-14 14:39:20 +0200 |
| commit | c576a4281ef8c87990ae6399393a827dfaccacd5 (patch) | |
| tree | 0f28b7d1fc2ba73ccea5d7513281b0f8cae76fb6 /.github/scripts/tests/test_release_workflow_policy.py | |
| parent | ffc62c792c9a5196cb4ce7a353287dfe20db6524 (diff) | |
New upstream version 3.3.0~beta2+dfsgupstream/3.3.0_beta2+dfsgupstream
Diffstat (limited to '.github/scripts/tests/test_release_workflow_policy.py')
| -rw-r--r-- | .github/scripts/tests/test_release_workflow_policy.py | 16 |
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) |
