Skip to content
Bitcoin Roots

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. The two line-number columns refer to before and after.

ci/test/test_prepare_release.py CHANGED
@@ -82,26 +82,16 @@ class PrepareReleaseTest(unittest.TestCase):
82
82
  self.assertFalse((output / "SHA512SUMS").exists())
83
83
  self.assertFalse((output / archive.name).exists())
84
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])
85
+ def test_explicit_assembly_rejects_intermediate_package(self):
93
86
  with tempfile.TemporaryDirectory() as temporary_dir:
94
87
  work = Path(temporary_dir)
95
- (work / "ci").symlink_to(ROOT / "ci", target_is_directory=True)
96
88
  downloads = work / "downloaded-artifacts"
97
89
  downloads.mkdir()
98
90
  self.write_package(downloads / "bitcoin-roots-linux-x86_64.tar.gz",
99
91
  "bitcoin-roots-30.3-roots.1", b"binary", notices=False)
100
92
  (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)
93
+ result = subprocess.run([SCRIPT, downloads, work / "release-assets", PUBLIC_KEY,
94
+ "v30.3-roots.1", "1"], capture_output=True, text=True)
105
95
  self.assertNotEqual(result.returncode, 0)
106
96
  self.assertFalse((work / "release-assets/SHA512SUMS").exists())
107
97