v30.3-roots.1 · Commit 62: [PATCH 62/68] fix(release): create drafts from reviewed immutable assets
ci/test/test_prepare_release.py
Before: ci/test/test_prepare_release.py · After: ci/test/test_prepare_release.py
File metadata
index fe6ebe020e35539a2a189a828886d53a5f06286c..7e75c554da77596fffbeb962346d367b25860858 100755
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_prepare_release.py
CHANGED
|
@@ -82,26 +82,16 @@ class PrepareReleaseTest(unittest.TestCase):
|
|
| 82 |
self.assertFalse((output / "SHA512SUMS").exists())
|
| 83 |
self.assertFalse((output / archive.name).exists())
|
| 84 |
|
| 85 |
-
def test_draft_workflow_assembly_step_rejects_intermediate_package(self):
|
| 86 |
-
lines = (ROOT / ".github/workflows/release.yml").read_text().splitlines()
|
| 87 |
-
start = lines.index(" - name: Prepare release assets and manifest")
|
| 88 |
-
start = lines.index(" run: |", start) + 1
|
| 89 |
-
end = start
|
| 90 |
-
while end < len(lines) and (lines[end].startswith(" ") or not lines[end]):
|
| 91 |
-
end += 1
|
| 92 |
-
block = "\n".join(line[10:] for line in lines[start:end])
|
| 93 |
with tempfile.TemporaryDirectory() as temporary_dir:
|
| 94 |
work = Path(temporary_dir)
|
| 95 |
-
(work / "ci").symlink_to(ROOT / "ci", target_is_directory=True)
|
| 96 |
downloads = work / "downloaded-artifacts"
|
| 97 |
downloads.mkdir()
|
| 98 |
self.write_package(downloads / "bitcoin-roots-linux-x86_64.tar.gz",
|
| 99 |
"bitcoin-roots-30.3-roots.1", b"binary", notices=False)
|
| 100 |
(downloads / "series.patch").write_text("patch\n")
|
| 101 |
-
environment = {**os.environ, "PUBLIC_KEY_FILE": str(PUBLIC_KEY),
|
| 102 |
-
"RELEASE_TAG": "v30.3-roots.1", "EXPECTED_PACKAGE_COUNT": "1"}
|
| 103 |
-
result = subprocess.run(["bash", "-c", block], cwd=work, env=environment,
|
| 104 |
-
capture_output=True, text=True)
|
| 105 |
self.assertNotEqual(result.returncode, 0)
|
| 106 |
self.assertFalse((work / "release-assets/SHA512SUMS").exists())
|
| 107 |
|
|
|
|
| 82 |
self.assertFalse((output / "SHA512SUMS").exists())
|
| 83 |
self.assertFalse((output / archive.name).exists())
|
| 84 |
|
| 85 |
+
def test_explicit_assembly_rejects_intermediate_package(self):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 86 |
with tempfile.TemporaryDirectory() as temporary_dir:
|
| 87 |
work = Path(temporary_dir)
|
|
|
|
| 88 |
downloads = work / "downloaded-artifacts"
|
| 89 |
downloads.mkdir()
|
| 90 |
self.write_package(downloads / "bitcoin-roots-linux-x86_64.tar.gz",
|
| 91 |
"bitcoin-roots-30.3-roots.1", b"binary", notices=False)
|
| 92 |
(downloads / "series.patch").write_text("patch\n")
|
| 93 |
+
result = subprocess.run([SCRIPT, downloads, work / "release-assets", PUBLIC_KEY,
|
| 94 |
+
"v30.3-roots.1", "1"], capture_output=True, text=True)
|
|
|
|
|
|
|
| 95 |
self.assertNotEqual(result.returncode, 0)
|
| 96 |
self.assertFalse((work / "release-assets/SHA512SUMS").exists())
|
| 97 |
|