v29.4-roots.2 · Commit 7: [PATCH 07/21] release: establish Roots maintenance and assurance
ci/test/test_validate_release_tag.py
Before: /dev/null · After: ci/test/test_validate_release_tag.py
File metadata
new file mode 100755 index 0000000000000000000000000000000000000000..284d272059c67b753e4861f2cd1d6178ffa59295
Download original patch · Release notes
Diff rows 1–29 of 29. Line numbers refer to the original before/after files.
+ Added− RemovedUnmarked lines are context.
Scroll the code area horizontally to read long lines. Before is on the left; after is on the right. Unified view fits narrow screens more easily.
ci/test/test_validate_release_tag.py
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env python3
|
| 2 |
+
# Copyright (c) 2026-present The Bitcoin Roots developers
|
| 3 |
+
# Distributed under the MIT software license, see the accompanying
|
| 4 |
+
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
| 5 |
+
|
| 6 |
+
from pathlib import Path
|
| 7 |
+
import subprocess
|
| 8 |
+
import unittest
|
| 9 |
+
|
| 10 |
+
|
| 11 |
+
ROOT = Path(__file__).resolve().parents[2]
|
| 12 |
+
SCRIPT = ROOT / "ci/release/validate-release-tag.sh"
|
| 13 |
+
|
| 14 |
+
|
| 15 |
+
class ValidateReleaseTagTest(unittest.TestCase):
|
| 16 |
+
def test_accepts_roots_final_and_release_candidate_tags(self):
|
| 17 |
+
for tag in ["v29.4-roots.1", "v29.4.1-roots.2", "v29.4rc1-roots.1"]:
|
| 18 |
+
with self.subTest(tag=tag):
|
| 19 |
+
subprocess.run([SCRIPT, tag], check=True)
|
| 20 |
+
|
| 21 |
+
def test_rejects_unsafe_or_non_roots_tags(self):
|
| 22 |
+
for tag in ["29.4-roots.1", "v29.4", "v29.4-rc1-roots.1", "v29.4-roots.0", "v29.4-roots.1/other", "v29.4-roots.1\nother"]:
|
| 23 |
+
with self.subTest(tag=tag):
|
| 24 |
+
result = subprocess.run([SCRIPT, tag], capture_output=True, text=True)
|
| 25 |
+
self.assertNotEqual(result.returncode, 0)
|
| 26 |
+
|
| 27 |
+
|
| 28 |
+
if __name__ == "__main__":
|
| 29 |
+
unittest.main()
|