diff options
author | Mike Frysinger <vapier@google.com> | 2025-04-22 14:10:52 -0400 |
---|---|---|
committer | LUCI <gerrit-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2025-04-28 10:24:33 -0700 |
commit | 21cbcc54e99db175619959a5b185bbb4d9b81d5a (patch) | |
tree | f348d94fcfd29514a2ecdb1e50a3e4ff3e539e8f /run_tests | |
parent | 0f200bb3a1dedafdc435a86f0308f22469b4e404 (diff) | |
download | git-repo-21cbcc54e99db175619959a5b185bbb4d9b81d5a.tar.gz |
update-manpages: include in unittests
People often forget to regen when making interface changes.
We skip the test if help2man isn't installed since it's not common,
and it's not available on our CI bots currently.
Change-Id: Ib4911a0e3fa1294ad90e4ac8afc047a0b7c2b66d
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/469741
Tested-by: Mike Frysinger <vapier@google.com>
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Mike Frysinger <vapier@google.com>
Diffstat (limited to 'run_tests')
-rwxr-xr-x | run_tests | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -17,6 +17,7 @@ | |||
17 | 17 | ||
18 | import functools | 18 | import functools |
19 | import os | 19 | import os |
20 | import shutil | ||
20 | import subprocess | 21 | import subprocess |
21 | import sys | 22 | import sys |
22 | from typing import List | 23 | from typing import List |
@@ -101,6 +102,19 @@ def run_isort(): | |||
101 | ).returncode | 102 | ).returncode |
102 | 103 | ||
103 | 104 | ||
105 | def run_update_manpages() -> int: | ||
106 | """Returns the exit code from release/update-manpages.""" | ||
107 | if not shutil.which("help2mafn"): | ||
108 | print("update-manpages: help2man not found; skipping test") | ||
109 | return 0 | ||
110 | |||
111 | return subprocess.run( | ||
112 | [sys.executable, "release/update-manpages", "--check"], | ||
113 | check=False, | ||
114 | cwd=ROOT_DIR, | ||
115 | ).returncode | ||
116 | |||
117 | |||
104 | def main(argv): | 118 | def main(argv): |
105 | """The main entry.""" | 119 | """The main entry.""" |
106 | checks = ( | 120 | checks = ( |
@@ -109,6 +123,7 @@ def main(argv): | |||
109 | run_black, | 123 | run_black, |
110 | run_flake8, | 124 | run_flake8, |
111 | run_isort, | 125 | run_isort, |
126 | run_update_manpages, | ||
112 | ) | 127 | ) |
113 | # Run all the tests all the time to get full feedback. Don't exit on the | 128 | # Run all the tests all the time to get full feedback. Don't exit on the |
114 | # first error as that makes it more difficult to iterate in the CQ. | 129 | # first error as that makes it more difficult to iterate in the CQ. |