v29.4-roots.4 · Commit 12: [PATCH 12/37] release: add pre-tag artifact rehearsal
ci/test/test_create_patch_series.py
Before: ci/test/test_create_patch_series.py · After: ci/test/test_create_patch_series.py
File metadata
index 56194dbde5fd4bc41bdc2467bc876b9d107bc477..6f9fe3ecb1d5742cffb477370d4f91a4af7cd3be 100755
Download original patch · Release notes
Diff rows 1–33 of 33. 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_create_patch_series.py
CHANGED
|
@@ -27,15 +27,17 @@ class CreatePatchSeriesTest(unittest.TestCase):
|
|
| 27 |
self.git(repository, "config", "user.name", "Patch test")
|
| 28 |
self.git(repository, "config", "user.email", "patch@example.invalid")
|
| 29 |
(repository / "source").write_text("core\n", encoding="utf-8")
|
|
|
|
| 30 |
workflow = repository / ".github/workflows/ci.yml"
|
| 31 |
workflow.parent.mkdir(parents=True)
|
| 32 |
workflow.write_text("name: Core CI\n", encoding="utf-8")
|
| 33 |
-
self.git(repository, "add", "source", ".github")
|
| 34 |
self.git(repository, "commit", "-m", "core", capture_output=True)
|
| 35 |
core_commit = self.git(repository, "rev-parse", "HEAD", capture_output=True, text=True).stdout.strip()
|
| 36 |
self.git(repository, "tag", "-a", "v29.4", "-m", "Core v29.4")
|
| 37 |
self.git(repository, "switch", "-c", "roots/29.4", capture_output=True)
|
| 38 |
(repository / "source").write_text("roots\n", encoding="utf-8")
|
|
|
|
| 39 |
self.git(repository, "commit", "-am", "roots text", capture_output=True)
|
| 40 |
(repository / "binary.dat").write_bytes(bytes(range(256)))
|
| 41 |
self.git(repository, "add", "binary.dat")
|
|
@@ -65,7 +67,7 @@ class CreatePatchSeriesTest(unittest.TestCase):
|
|
| 65 |
self.git(replay, "checkout", "--detach", core_commit, capture_output=True)
|
| 66 |
self.git(
|
| 67 |
replay, "-c", "user.name=Patch replay", "-c", "user.email=replay@example.invalid",
|
| 68 |
-
"am", "-3", output, capture_output=True,
|
| 69 |
)
|
| 70 |
self.git(
|
| 71 |
replay, "diff", "--quiet", RELEASE_TAG, "HEAD", "--",
|
|
@@ -73,6 +75,7 @@ class CreatePatchSeriesTest(unittest.TestCase):
|
|
| 73 |
)
|
| 74 |
self.git(replay, "diff", "--quiet", core_commit, "HEAD", "--", ".github")
|
| 75 |
self.assertEqual((replay / ".github/workflows/ci.yml").read_text(encoding="utf-8"), "name: Core CI\n")
|
|
|
|
| 76 |
|
| 77 |
def test_rejects_noncanonical_release(self):
|
| 78 |
repository, _ = self.make_release_repository()
|
|
|
|
| 27 |
self.git(repository, "config", "user.name", "Patch test")
|
| 28 |
self.git(repository, "config", "user.email", "patch@example.invalid")
|
| 29 |
(repository / "source").write_text("core\n", encoding="utf-8")
|
| 30 |
+
(repository / "crlf.svg").write_bytes(b"<svg>\r\ncore\r\n</svg>\r\n")
|
| 31 |
workflow = repository / ".github/workflows/ci.yml"
|
| 32 |
workflow.parent.mkdir(parents=True)
|
| 33 |
workflow.write_text("name: Core CI\n", encoding="utf-8")
|
| 34 |
+
self.git(repository, "add", "source", "crlf.svg", ".github")
|
| 35 |
self.git(repository, "commit", "-m", "core", capture_output=True)
|
| 36 |
core_commit = self.git(repository, "rev-parse", "HEAD", capture_output=True, text=True).stdout.strip()
|
| 37 |
self.git(repository, "tag", "-a", "v29.4", "-m", "Core v29.4")
|
| 38 |
self.git(repository, "switch", "-c", "roots/29.4", capture_output=True)
|
| 39 |
(repository / "source").write_text("roots\n", encoding="utf-8")
|
| 40 |
+
(repository / "crlf.svg").write_bytes(b"<svg>\r\nroots\r\n</svg>\r\n")
|
| 41 |
self.git(repository, "commit", "-am", "roots text", capture_output=True)
|
| 42 |
(repository / "binary.dat").write_bytes(bytes(range(256)))
|
| 43 |
self.git(repository, "add", "binary.dat")
|
|
|
|
| 67 |
self.git(replay, "checkout", "--detach", core_commit, capture_output=True)
|
| 68 |
self.git(
|
| 69 |
replay, "-c", "user.name=Patch replay", "-c", "user.email=replay@example.invalid",
|
| 70 |
+
"am", "-3", "--keep-cr", output, capture_output=True,
|
| 71 |
)
|
| 72 |
self.git(
|
| 73 |
replay, "diff", "--quiet", RELEASE_TAG, "HEAD", "--",
|
|
|
|
| 75 |
)
|
| 76 |
self.git(replay, "diff", "--quiet", core_commit, "HEAD", "--", ".github")
|
| 77 |
self.assertEqual((replay / ".github/workflows/ci.yml").read_text(encoding="utf-8"), "name: Core CI\n")
|
| 78 |
+
self.assertEqual((replay / "crlf.svg").read_bytes(), b"<svg>\r\nroots\r\n</svg>\r\n")
|
| 79 |
|
| 80 |
def test_rejects_noncanonical_release(self):
|
| 81 |
repository, _ = self.make_release_repository()
|