run_tests: Always check black and check it last

https://gerrit-review.googlesource.com/c/git-repo/+/363474/24..25 meant
to improve run_tests UX by letting users rerun it quickly, but it also
removed CQ enforcement of formatting since CQ passes args to run_tests.

Run pytest first so devs don't have format first and always check black
formatting so it's enforced in CQ.

Bug: b/267675342
Change-Id: I09544f110a6eb71b0c6c640787e10b04991a804e
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/365727
Tested-by: Gavin Mak <gavinmak@google.com>
Reviewed-by: Mike Frysinger <vapier@google.com>
Commit-Queue: Gavin Mak <gavinmak@google.com>
This commit is contained in:
Gavin Mak 2023-03-24 01:17:31 +00:00 committed by LUCI
parent ea2e330e43
commit 21cc3a9d53

View File

@ -31,8 +31,8 @@ def run_black():
def main(argv):
"""The main entry."""
black_ret = 0 if argv else run_black()
pytest_ret = pytest.main(argv)
black_ret = run_black()
return 0 if not black_ret and not pytest_ret else 1