Merge pull request #25382 from yashykt/removedisrespecfulterm5

Replace disrespectful term
pull/25405/head
Yash Tibrewal 4 years ago committed by GitHub
commit 7cbc96b274
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      tools/internal_ci/linux/grpc_build_abseil-cpp_at_head.cfg
  2. 4
      tools/internal_ci/linux/grpc_build_boringssl_at_head.cfg
  3. 2
      tools/internal_ci/linux/grpc_build_protobuf_at_head.cfg
  4. 14
      tools/run_tests/python_utils/filter_pull_request_tests.py
  5. 6
      tools/run_tests/sanity/check_test_filtering.py
  6. 2
      tools/run_tests/sanity/core_banned_functions.py

@ -24,7 +24,7 @@ action {
} }
} }
# Tiny hack: misusing an already whitelisted env var to pass submodule name # Tiny hack: misusing an already allowlisted env var to pass submodule name
env_vars { env_vars {
key: "RUN_TESTS_FLAGS" key: "RUN_TESTS_FLAGS"
value: "abseil-cpp" value: "abseil-cpp"

@ -24,13 +24,13 @@ action {
} }
} }
# Tiny hack: misusing an already whitelisted env var to pass submodule name # Tiny hack: misusing an already allowlisted env var to pass submodule name
env_vars { env_vars {
key: "RUN_TESTS_FLAGS" key: "RUN_TESTS_FLAGS"
value: "boringssl-with-bazel" value: "boringssl-with-bazel"
} }
# Tiny hack: misusing an already whitelisted env var to pass branch name to checkout # Tiny hack: misusing an already allowlisted env var to pass branch name to checkout
env_vars { env_vars {
key: "BAZEL_FLAGS" key: "BAZEL_FLAGS"
value: "master-with-bazel" value: "master-with-bazel"

@ -24,7 +24,7 @@ action {
} }
} }
# Tiny hack: misusing an already whitelisted env var to pass submodule name # Tiny hack: misusing an already allowlisted env var to pass submodule name
env_vars { env_vars {
key: "RUN_TESTS_FLAGS" key: "RUN_TESTS_FLAGS"
value: "protobuf" value: "protobuf"

@ -61,12 +61,12 @@ _ALL_TEST_SUITES = [
_LINUX_TEST_SUITE, _WINDOWS_TEST_SUITE, _MACOS_TEST_SUITE _LINUX_TEST_SUITE, _WINDOWS_TEST_SUITE, _MACOS_TEST_SUITE
] ]
# Dictionary of whitelistable files where the key is a regex matching changed files # Dictionary of allowlistable files where the key is a regex matching changed files
# and the value is a list of tests that should be run. An empty list means that # and the value is a list of tests that should be run. An empty list means that
# the changed files should not trigger any tests. Any changed file that does not # the changed files should not trigger any tests. Any changed file that does not
# match any of these regexes will trigger all tests # match any of these regexes will trigger all tests
# DO NOT CHANGE THIS UNLESS YOU KNOW WHAT YOU ARE DOING (be careful even if you do) # DO NOT CHANGE THIS UNLESS YOU KNOW WHAT YOU ARE DOING (be careful even if you do)
_WHITELIST_DICT = { _ALLOWLIST_DICT = {
'^doc/': [], '^doc/': [],
'^examples/': [], '^examples/': [],
'^include/grpc\+\+/': [_CPP_TEST_SUITE], '^include/grpc\+\+/': [_CPP_TEST_SUITE],
@ -111,11 +111,11 @@ _WHITELIST_DICT = {
'setup\.py$': [_PYTHON_TEST_SUITE] 'setup\.py$': [_PYTHON_TEST_SUITE]
} }
# Regex that combines all keys in _WHITELIST_DICT # Regex that combines all keys in _ALLOWLIST_DICT
_ALL_TRIGGERS = "(" + ")|(".join(_WHITELIST_DICT.keys()) + ")" _ALL_TRIGGERS = "(" + ")|(".join(_ALLOWLIST_DICT.keys()) + ")"
# Add all triggers to their respective test suites # Add all triggers to their respective test suites
for trigger, test_suites in six.iteritems(_WHITELIST_DICT): for trigger, test_suites in six.iteritems(_ALLOWLIST_DICT):
for test_suite in test_suites: for test_suite in test_suites:
test_suite.add_trigger(trigger) test_suite.add_trigger(trigger)
@ -166,7 +166,7 @@ def affects_c_cpp(base_branch):
:return: boolean indicating whether C/C++ changes are made in pull request :return: boolean indicating whether C/C++ changes are made in pull request
""" """
changed_files = _get_changed_files(base_branch) changed_files = _get_changed_files(base_branch)
# Run all tests if any changed file is not in the whitelist dictionary # Run all tests if any changed file is not in the allowlist dictionary
for changed_file in changed_files: for changed_file in changed_files:
if not re.match(_ALL_TRIGGERS, changed_file): if not re.match(_ALL_TRIGGERS, changed_file):
return True return True
@ -188,7 +188,7 @@ def filter_tests(tests, base_branch):
print(' %s' % changed_file) print(' %s' % changed_file)
print('') print('')
# Run all tests if any changed file is not in the whitelist dictionary # Run all tests if any changed file is not in the allowlist dictionary
for changed_file in changed_files: for changed_file in changed_files:
if not re.match(_ALL_TRIGGERS, changed_file): if not re.match(_ALL_TRIGGERS, changed_file):
return (tests) return (tests)

@ -146,13 +146,13 @@ class TestFilteringTest(unittest.TestCase):
if label not in filter_pull_request_tests._WINDOWS_TEST_SUITE.labels if label not in filter_pull_request_tests._WINDOWS_TEST_SUITE.labels
]) ])
def test_whitelist(self): def test_allowlist(self):
whitelist = filter_pull_request_tests._WHITELIST_DICT allowlist = filter_pull_request_tests._ALLOWLIST_DICT
files_that_should_trigger_all_tests = [ files_that_should_trigger_all_tests = [
'src/core/foo.bar', 'some_file_not_on_the_white_list', 'BUILD', 'src/core/foo.bar', 'some_file_not_on_the_white_list', 'BUILD',
'etc/roots.pem', 'Makefile', 'tools/foo' 'etc/roots.pem', 'Makefile', 'tools/foo'
] ]
for key in list(whitelist.keys()): for key in list(allowlist.keys()):
for file_name in files_that_should_trigger_all_tests: for file_name in files_that_should_trigger_all_tests:
self.assertFalse(re.match(key, file_name)) self.assertFalse(re.match(key, file_name))

@ -19,7 +19,7 @@ import sys
os.chdir(os.path.join(os.path.dirname(sys.argv[0]), '../../..')) os.chdir(os.path.join(os.path.dirname(sys.argv[0]), '../../..'))
# map of banned function signature to whitelist # map of banned function signature to allowlist
BANNED_EXCEPT = { BANNED_EXCEPT = {
'grpc_slice_from_static_buffer(': ['src/core/lib/slice/slice.cc'], 'grpc_slice_from_static_buffer(': ['src/core/lib/slice/slice.cc'],
'grpc_resource_quota_ref(': ['src/core/lib/iomgr/resource_quota.cc'], 'grpc_resource_quota_ref(': ['src/core/lib/iomgr/resource_quota.cc'],

Loading…
Cancel
Save