Skip to content

Commit 85ee173

Browse files
vapierLUCI
authored and
LUCI
committed
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 <[email protected]> Tested-by: Mike Frysinger <[email protected]> Commit-Queue: Mike Frysinger <[email protected]>
1 parent f070331 commit 85ee173

File tree

2 files changed

+90
-0
lines changed

2 files changed

+90
-0
lines changed

run_tests

+23
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,28 @@ def run_pytest(argv: List[str]) -> int:
4141
return pytest.main(argv)
4242

4343

44+
def 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+
4466
def run_black():
4567
"""Returns the exit code from black."""
4668
# Black by default only matches .py files. We have to list standalone
@@ -75,6 +97,7 @@ def main(argv):
7597
"""The main entry."""
7698
checks = (
7799
functools.partial(run_pytest, argv),
100+
functools.partial(run_pytest_py38, argv),
78101
run_black,
79102
run_flake8,
80103
run_isort,

run_tests.vpython3.8

+67
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# This is a vpython "spec" file.
2+
#
3+
# Read more about `vpython` and how to modify this file here:
4+
# https://chromium.googlesource.com/infra/infra/+/main/doc/users/vpython.md
5+
# List of available wheels:
6+
# https://chromium.googlesource.com/infra/infra/+/main/infra/tools/dockerbuild/wheels.md
7+
8+
python_version: "3.8"
9+
10+
wheel: <
11+
name: "infra/python/wheels/pytest-py3"
12+
version: "version:8.3.4"
13+
>
14+
15+
# Required by pytest==8.3.4
16+
wheel: <
17+
name: "infra/python/wheels/py-py2_py3"
18+
version: "version:1.11.0"
19+
>
20+
21+
# Required by pytest==8.3.4
22+
wheel: <
23+
name: "infra/python/wheels/iniconfig-py3"
24+
version: "version:1.1.1"
25+
>
26+
27+
# Required by pytest==8.3.4
28+
wheel: <
29+
name: "infra/python/wheels/packaging-py3"
30+
version: "version:23.0"
31+
>
32+
33+
# Required by pytest==8.3.4
34+
wheel: <
35+
name: "infra/python/wheels/pluggy-py3"
36+
version: "version:1.5.0"
37+
>
38+
39+
# Required by pytest==8.3.4
40+
wheel: <
41+
name: "infra/python/wheels/toml-py3"
42+
version: "version:0.10.1"
43+
>
44+
45+
# Required by pytest==8.3.4
46+
wheel: <
47+
name: "infra/python/wheels/tomli-py3"
48+
version: "version:2.1.0"
49+
>
50+
51+
# Required by pytest==8.3.4
52+
wheel: <
53+
name: "infra/python/wheels/pyparsing-py3"
54+
version: "version:3.0.7"
55+
>
56+
57+
# Required by pytest==8.3.4
58+
wheel: <
59+
name: "infra/python/wheels/attrs-py2_py3"
60+
version: "version:21.4.0"
61+
>
62+
63+
# Required by pytest==8.3.4
64+
wheel: <
65+
name: "infra/python/wheels/exceptiongroup-py3"
66+
version: "version:1.1.2"
67+
>

0 commit comments

Comments
 (0)