Release: enforce root version across component feeds

This commit is contained in:
faumaray committed 2026-07-28 21:41:55 +03:00
1 parent f78004e822
commit 1305d37fae
6 files changed
+139 -7

No files matched your search

+53
View File
@@ -679,6 +679,59 @@ class GiteaReleaseTest(unittest.TestCase):
"3.2.1-nightly.20260727.18",
)
def test_nightly_version_prefers_newer_root_cmake_version(self) -> None:
cmake_file = Path(self.temporary.name, "CMakeLists.txt")
cmake_file.write_text(
"project(Echoion VERSION 3.0.0 LANGUAGES CXX)\n",
encoding="utf-8",
)
self.server.state.releases[1] = {
"id": 1,
"tag_name": "v2.4.0",
"target_commitish": "0123456789abcdef0123456789abcdef01234567",
"name": "Echoion 2.4.0",
"body": "",
"prerelease": False,
"draft": False,
"assets": [],
"created_at": "2026-07-26T00:00:00Z",
"published_at": "2026-07-26T00:00:00Z",
}
completed = self.run_script(
"derive-nightly-version",
"--owner",
"Void",
"--repo",
"Echoion",
"--cmake-file",
os.fspath(cmake_file),
"--date-id",
"20260728",
"--run-number",
"19",
)
self.assertEqual(
completed.stdout.strip(),
"3.0.0-nightly.20260728.19",
)
def test_root_cmake_project_version_command(self) -> None:
cmake_file = Path(self.temporary.name, "CMakeLists.txt")
cmake_file.write_text(
"project(Echoion VERSION 4.5.6 LANGUAGES CXX)\n",
encoding="utf-8",
)
completed = self.run_script(
"cmake-project-version",
"--cmake-file",
os.fspath(cmake_file),
)
self.assertEqual(completed.stdout.strip(), "4.5.6")
if __name__ == "__main__":
unittest.main()