aboutsummaryrefslogtreecommitdiffhomepage
path: root/infra/presubmit.py
diff options
context:
space:
mode:
authorGravatar Jonathan Metzman <metzman@chromium.org>2021-01-20 15:18:18 -0800
committerGravatar Jonathan Metzman <metzman@chromium.org>2021-01-20 15:18:18 -0800
commit9ce539763fea276cda54dcfc6aea043ca483c862 (patch)
treec79cf924088ceb7e3dc68cf2c9c7ae5bffa2a618 /infra/presubmit.py
parent621729ffd7bee88680c376aa4457fe95fce5a9af (diff)
fix
Diffstat (limited to 'infra/presubmit.py')
-rwxr-xr-xinfra/presubmit.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/infra/presubmit.py b/infra/presubmit.py
index 0cf0d73f..b779fa00 100755
--- a/infra/presubmit.py
+++ b/infra/presubmit.py
@@ -17,6 +17,7 @@
"""Check code for common issues before submitting."""
import argparse
+import pathlib
import os
import subprocess
import sys
@@ -24,6 +25,9 @@ import unittest
import yaml
_SRC_ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
+TEST_DIR_BLOCKLIST = {
+ os.path.join(_SRC_ROOT, 'infra/base-images/base-sanitizer-libs-builder')
+}
def _is_project_file(actual_path, expected_filename):
@@ -330,8 +334,13 @@ def get_changed_files():
def run_tests(relevant_files):
"""Run all unit tests in directories that are different from HEAD."""
changed_dirs = set()
- for file in relevant_files:
- changed_dirs.add(os.path.dirname(file))
+ for file_path in relevant_files:
+ directory = os.path.dirname(file_path)
+ if directory in TEST_DIR_BLOCKLIST:
+ continue
+ if not directory.endswith('build'):
+ continue
+ changed_dirs.add(directory)
# TODO(metzman): This approach for running tests is flawed since tests can
# fail even if their directory isn't changed. Figure out if it is needed (to