v30.3-roots.1 · Commit 67: [PATCH 67/68] fix(release): defer expanded dependency notice coverage
ci/test/test_prepare_release.py
Before: ci/test/test_prepare_release.py · After: ci/test/test_prepare_release.py
File metadata
index 5291ba5e9172891476f960294528c670a765daf6..5ed09a1fd970db7e5329d7c4ad7d02c9167c30eb 100755
Download original patch · Release notes
Diff rows 1–75 of 75. 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
|
@@ -57,31 +57,18 @@ class PrepareReleaseTest(unittest.TestCase):
|
|
|
57
57
|
for name, data in notice_members.items():
|
|
58
58
|
package.writestr(name, data)
|
|
59
59
|
|
|
60
|
-
def test_final_gate_rejects_missing_faulty_or_wrong_platform_notices(self):
|
|
61
|
-
for fault in ("missing", "faulty-index", "wrong-platform"):
|
|
62
|
-
with self.subTest(fault=fault), tempfile.TemporaryDirectory() as temporary_dir:
|
|
63
|
-
downloads = Path(temporary_dir) / "downloads"
|
|
64
|
-
downloads.mkdir()
|
|
65
|
-
archive = downloads / "bitcoin-roots-darwin-arm64.zip"
|
|
66
|
-
root = "bitcoin-roots-30.3-roots.1"
|
|
67
|
-
self.write_package(archive, root, b"binary", notices=False)
|
|
68
|
-
if fault != "missing":
|
|
69
|
-
work = Path(temporary_dir)
|
|
70
|
-
platform = "darwin-x86_64" if fault == "wrong-platform" else "darwin-arm64"
|
|
71
|
-
descriptor = notice_fixtures.ReleaseNoticesTest().descriptor(work, platform)
|
|
72
|
-
notice_fixtures.NOTICES.collect(platform, descriptor, work / "collected")
|
|
73
|
-
with zipfile.ZipFile(archive, "a") as package:
|
|
74
|
-
for file in (work / "collected").rglob("*"):
|
|
75
|
-
if file.is_file():
|
|
76
|
-
content = b'{}' if fault == "faulty-index" and file.name == "index.json" else file.read_bytes()
|
|
77
|
-
package.writestr(f"{root}/notices/{file.relative_to(work / 'collected').as_posix()}", content)
|
|
78
|
-
(downloads / "series.patch").write_text("patch\n")
|
|
79
|
-
output = Path(temporary_dir) / "output"
|
|
80
|
-
result = subprocess.run([SCRIPT, downloads, output, PUBLIC_KEY, "v30.3-roots.1", "1"],
|
|
81
|
-
capture_output=True, text=True)
|
|
82
|
-
self.assertNotEqual(result.returncode, 0)
|
|
83
|
-
self.assertFalse((output / "SHA512SUMS").exists())
|
|
84
|
-
self.assertFalse((output / archive.name).exists())
|
|
60
|
+
def test_final_gate_accepts_canonical_copying_without_dependency_index(self):
|
|
61
|
+
with tempfile.TemporaryDirectory() as temporary_dir:
|
|
62
|
+
downloads = Path(temporary_dir) / "downloads"
|
|
63
|
+
downloads.mkdir()
|
|
64
|
+
archive = downloads / "bitcoin-roots-darwin-arm64.zip"
|
|
65
|
+
self.write_package(archive, "bitcoin-roots-30.3-roots.1", b"binary", notices=False)
|
|
66
|
+
(downloads / "series.patch").write_text("patch\n")
|
|
67
|
+
output = Path(temporary_dir) / "output"
|
|
68
|
+
result = subprocess.run([SCRIPT, downloads, output, PUBLIC_KEY, "v30.3-roots.1", "1"],
|
|
69
|
+
capture_output=True, text=True)
|
|
70
|
+
self.assertEqual(result.returncode, 0, result.stderr)
|
|
71
|
+
self.assertTrue((output / "SHA512SUMS").exists())
|
|
85
72
|
|
|
86
73
|
def test_explicit_assembly_rejects_intermediate_package(self):
|
|
87
74
|
with tempfile.TemporaryDirectory() as temporary_dir:
|
|
@@ -89,7 +76,7 @@ class PrepareReleaseTest(unittest.TestCase):
|
|
|
89
76
|
downloads = work / "downloaded-artifacts"
|
|
90
77
|
downloads.mkdir()
|
|
91
78
|
self.write_package(downloads / "bitcoin-roots-linux-x86_64.tar.gz",
|
|
92
|
-
"bitcoin-roots-30.3-roots.1", b"binary", notices=False)
|
|
79
|
+
"bitcoin-roots-30.3-roots.1", b"binary", copying=b"", notices=False)
|
|
93
80
|
(downloads / "series.patch").write_text("patch\n")
|
|
94
81
|
result = subprocess.run([SCRIPT, downloads, work / "release-assets", PUBLIC_KEY,
|
|
95
82
|
"v30.3-roots.1", "1"], capture_output=True, text=True)
|
|
@@ -120,7 +107,7 @@ class PrepareReleaseTest(unittest.TestCase):
|
|
|
120
107
|
subprocess.run(["python3", ARCHIVE_TOOL, "validate", archive, root.name,
|
|
121
108
|
"--copying", ROOT / "COPYING"], check=True)
|
|
122
109
|
|
|
123
|
-
def test_actual_unix_workflow_stages_notices_and_prepares(self):
|
|
110
|
+
def test_actual_unix_workflow_stages_copying_without_dependency_index_and_prepares(self):
|
|
124
111
|
lines = (ROOT / ".github/workflows/release.yml").read_text().splitlines()
|
|
125
112
|
def packaging_block(name):
|
|
126
113
|
start = lines.index(f" - name: {name}")
|
|
@@ -149,8 +136,6 @@ class PrepareReleaseTest(unittest.TestCase):
|
|
|
149
136
|
with zipfile.ZipFile(deploy / "Bitcoin-Roots.zip", mode="w") as package:
|
|
150
137
|
package.writestr("Bitcoin-Qt.app/Contents/MacOS/Bitcoin-Qt", b"binary fixture")
|
|
151
138
|
block = packaging_block("Stage release package")
|
|
152
|
-
descriptor = notice_fixtures.ReleaseNoticesTest().descriptor(work, platform)
|
|
153
|
-
notice_fixtures.NOTICES.collect(platform, descriptor, work / "runner/release-notices/notices")
|
|
154
139
|
subprocess.run(["bash", "-c", block], cwd=ROOT, env=environment, check=True)
|
|
155
140
|
archive = next((work / "runner/release-packages").iterdir())
|
|
156
141
|
member = "bitcoin-roots-30.3-roots.1/COPYING"
|
|
@@ -163,8 +148,6 @@ class PrepareReleaseTest(unittest.TestCase):
|
|
|
163
148
|
notice = package.read(member)
|
|
164
149
|
self.assertEqual(package.read("bitcoin-roots-30.3-roots.1/Bitcoin-Qt.app/Contents/MacOS/Bitcoin-Qt"), b"binary fixture")
|
|
165
150
|
self.assertEqual(notice, (ROOT / "COPYING").read_bytes())
|
|
166
|
-
subprocess.run(["python3", ROOT / "ci/release/notices.py", "validate", archive,
|
|
167
|
-
"bitcoin-roots-30.3-roots.1", platform], check=True)
|
|
168
151
|
downloads = work / "assembled-downloads"
|
|
169
152
|
downloads.mkdir()
|
|
170
153
|
assembled = downloads / archive.name
|