diff options
| author | Mike Frysinger <vapier@google.com> | 2025-04-01 23:50:30 -0400 |
|---|---|---|
| committer | LUCI <gerrit-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2025-04-02 13:50:29 -0700 |
| commit | 85ee1738e62741bb2fdec0581988c4eeb11712f1 (patch) | |
| tree | 242772044dfd3ddf2274355777e22c7c2a830147 | |
| parent | f070331a4c9993f4eedcc7fcb1c4b4807db69d02 (diff) | |
| download | git-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>
| -rwxr-xr-x | run_tests | 23 | ||||
| -rw-r--r-- | run_tests.vpython3.8 | 67 |
2 files changed, 90 insertions, 0 deletions
| @@ -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 | ||
| 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 | |||
| 44 | def run_black(): | 66 | def 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, |
diff --git a/run_tests.vpython3.8 b/run_tests.vpython3.8 new file mode 100644 index 00000000..aed5c0c7 --- /dev/null +++ b/run_tests.vpython3.8 | |||
| @@ -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 | > | ||
