summaryrefslogtreecommitdiffstats
path: root/run_tests
diff options
context:
space:
mode:
authorMike Frysinger <vapier@google.com>2025-04-01 23:50:30 -0400
committerLUCI <gerrit-scoped@luci-project-accounts.iam.gserviceaccount.com>2025-04-02 13:50:29 -0700
commit85ee1738e62741bb2fdec0581988c4eeb11712f1 (patch)
tree242772044dfd3ddf2274355777e22c7c2a830147 /run_tests
parentf070331a4c9993f4eedcc7fcb1c4b4807db69d02 (diff)
downloadgit-repo-85ee1738e62741bb2fdec0581988c4eeb11712f1.tar.gz
run_tests: enable Python 3.8 CI coverage
Change-Id: I507da20d3b7234e9f2a22d7654a6405b362eebaf Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/464541 Reviewed-by: Gavin Mak <gavinmak@google.com> Tested-by: Mike Frysinger <vapier@google.com> Commit-Queue: Mike Frysinger <vapier@google.com>
Diffstat (limited to 'run_tests')
-rwxr-xr-xrun_tests23
1 files changed, 23 insertions, 0 deletions
diff --git a/run_tests b/run_tests
index 20dad8da..ef7c04b7 100755
--- a/run_tests
+++ b/run_tests
@@ -41,6 +41,28 @@ def run_pytest(argv: List[str]) -> int:
41 return pytest.main(argv) 41 return pytest.main(argv)
42 42
43 43
44def run_pytest_py38(argv: List[str]) -> int:
45 """Returns the exit code from pytest under Python 3.8."""
46 if is_ci():
47 argv = ["-m", "not skip_cq"] + argv
48
49 try:
50 return subprocess.run(
51 [
52 "vpython3",
53 "-vpython-spec",
54 "run_tests.vpython3.8",
55 "-m",
56 "pytest",
57 ]
58 + argv,
59 check=False,
60 ).returncode
61 except FileNotFoundError:
62 # Skip if the user doesn't have vpython from depot_tools.
63 return 0
64
65
44def run_black(): 66def run_black():
45 """Returns the exit code from black.""" 67 """Returns the exit code from black."""
46 # Black by default only matches .py files. We have to list standalone 68 # Black by default only matches .py files. We have to list standalone
@@ -75,6 +97,7 @@ def main(argv):
75 """The main entry.""" 97 """The main entry."""
76 checks = ( 98 checks = (
77 functools.partial(run_pytest, argv), 99 functools.partial(run_pytest, argv),
100 functools.partial(run_pytest_py38, argv),
78 run_black, 101 run_black,
79 run_flake8, 102 run_flake8,
80 run_isort, 103 run_isort,