diff options
| author | Mike Frysinger <vapier@google.com> | 2025-03-25 12:50:36 -0400 |
|---|---|---|
| committer | LUCI <gerrit-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2025-03-25 11:19:49 -0700 |
| commit | 8310436be083f8268bf8325bb2ffb65e9e178f6f (patch) | |
| tree | 1aa0a97aee95407b7bdcca89df0fc57361900b36 /run_tests | |
| parent | d5087392edcee3c0da4ba19efb6005efd9ccf706 (diff) | |
| download | git-repo-8310436be083f8268bf8325bb2ffb65e9e178f6f.tar.gz | |
run_tests: move test filtering to pytest markers
Move the test disable logic even closer to the exact test that's
disabled. This way people updating tests have a better chance of
seeing they'll get reduced coverage in the CQ.
Change-Id: I57c1a073a844019798b27e14d742fd32925d9ae8
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/462882
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, 1 insertions, 14 deletions
| @@ -36,20 +36,7 @@ def is_ci() -> bool: | |||
| 36 | def run_pytest(argv: List[str]) -> int: | 36 | def run_pytest(argv: List[str]) -> int: |
| 37 | """Returns the exit code from pytest.""" | 37 | """Returns the exit code from pytest.""" |
| 38 | if is_ci(): | 38 | if is_ci(): |
| 39 | # TODO(b/266734831): Find out why smoke tests fail. | 39 | argv = ["-m", "not skip_cq"] + argv |
| 40 | # TODO(b/266734831): Find out why each superproject test takes 8m+. | ||
| 41 | tests_to_skip = ( | ||
| 42 | "test_smoke_repo", | ||
| 43 | "test_smoke_git", | ||
| 44 | "test_superproject_get_superproject_invalid_branch", | ||
| 45 | "test_superproject_get_superproject_invalid_url", | ||
| 46 | ) | ||
| 47 | |||
| 48 | print("WARNING: Skipping tests:", tests_to_skip) | ||
| 49 | argv = [ | ||
| 50 | "-k", | ||
| 51 | " and ".join(f"not {x}" for x in tests_to_skip), | ||
| 52 | ] + argv | ||
| 53 | 40 | ||
| 54 | return pytest.main(argv) | 41 | return pytest.main(argv) |
| 55 | 42 | ||
