mirror of
https://gerrit.googlesource.com/git-repo
synced 2025-06-26 20:17:52 +00:00
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>
This commit is contained in:
15
run_tests
15
run_tests
@ -36,20 +36,7 @@ def is_ci() -> bool:
|
||||
def run_pytest(argv: List[str]) -> int:
|
||||
"""Returns the exit code from pytest."""
|
||||
if is_ci():
|
||||
# TODO(b/266734831): Find out why smoke tests fail.
|
||||
# TODO(b/266734831): Find out why each superproject test takes 8m+.
|
||||
tests_to_skip = (
|
||||
"test_smoke_repo",
|
||||
"test_smoke_git",
|
||||
"test_superproject_get_superproject_invalid_branch",
|
||||
"test_superproject_get_superproject_invalid_url",
|
||||
)
|
||||
|
||||
print("WARNING: Skipping tests:", tests_to_skip)
|
||||
argv = [
|
||||
"-k",
|
||||
" and ".join(f"not {x}" for x in tests_to_skip),
|
||||
] + argv
|
||||
argv = ["-m", "not skip_cq"] + argv
|
||||
|
||||
return pytest.main(argv)
|
||||
|
||||
|
Reference in New Issue
Block a user