aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/run_tests/sanity
diff options
context:
space:
mode:
authorGravatar apolcyn <apolcyn@google.com>2018-02-14 16:08:35 -0800
committerGravatar GitHub <noreply@github.com>2018-02-14 16:08:35 -0800
commit22f363981a32953f9eee9291a6b46a499df08080 (patch)
treeca53b53e261c03a3e02b148a558abd26e14801a4 /tools/run_tests/sanity
parent874f8128cde90bccf5979d49f83f8e8cf2b81bd1 (diff)
parentaa56034b585be1d02eb77cbbe881f1d9833d9da7 (diff)
Merge pull request #14411 from apolcyn/python_test_deps_in_bazel
Add 3rd-party bazel dependencies needed to run resolver tests in bazel
Diffstat (limited to 'tools/run_tests/sanity')
-rwxr-xr-xtools/run_tests/sanity/check_bazel_workspace.py37
1 files changed, 30 insertions, 7 deletions
diff --git a/tools/run_tests/sanity/check_bazel_workspace.py b/tools/run_tests/sanity/check_bazel_workspace.py
index 62a6229c5d..555149c820 100755
--- a/tools/run_tests/sanity/check_bazel_workspace.py
+++ b/tools/run_tests/sanity/check_bazel_workspace.py
@@ -35,6 +35,11 @@ git_submodule_hashes = {
}
_BAZEL_TOOLCHAINS_DEP_NAME = 'com_github_bazelbuild_bazeltoolchains'
+_TWISTED_TWISTED_DEP_NAME = 'com_github_twisted_twisted'
+_YAML_PYYAML_DEP_NAME = 'com_github_yaml_pyyaml'
+_TWISTED_INCREMENTAL_DEP_NAME = 'com_github_twisted_incremental'
+_ZOPEFOUNDATION_ZOPE_INTERFACE_DEP_NAME = 'com_github_zopefoundation_zope_interface'
+_TWISTED_CONSTANTLY_DEP_NAME = 'com_github_twisted_constantly'
_GRPC_DEP_NAMES = [
'boringssl',
@@ -46,6 +51,20 @@ _GRPC_DEP_NAMES = [
'com_github_cares_cares',
'com_google_absl',
_BAZEL_TOOLCHAINS_DEP_NAME,
+ _TWISTED_TWISTED_DEP_NAME,
+ _YAML_PYYAML_DEP_NAME,
+ _TWISTED_INCREMENTAL_DEP_NAME,
+ _ZOPEFOUNDATION_ZOPE_INTERFACE_DEP_NAME,
+ _TWISTED_CONSTANTLY_DEP_NAME,
+]
+
+_GRPC_BAZEL_ONLY_DEPS = [
+ _BAZEL_TOOLCHAINS_DEP_NAME,
+ _TWISTED_TWISTED_DEP_NAME,
+ _YAML_PYYAML_DEP_NAME,
+ _TWISTED_INCREMENTAL_DEP_NAME,
+ _ZOPEFOUNDATION_ZOPE_INTERFACE_DEP_NAME,
+ _TWISTED_CONSTANTLY_DEP_NAME,
]
@@ -70,7 +89,8 @@ class BazelEvalState(object):
return []
def archive(self, **args):
- if args['name'] == _BAZEL_TOOLCHAINS_DEP_NAME:
+ assert self.names_and_urls.get(args['name']) is None
+ if args['name'] in _GRPC_BAZEL_ONLY_DEPS:
self.names_and_urls[args['name']] = 'dont care'
return
self.names_and_urls[args['name']] = args['url']
@@ -82,8 +102,10 @@ with open(os.path.join('bazel', 'grpc_deps.bzl'), 'r') as f:
eval_state = BazelEvalState(names_and_urls)
bazel_file = f.read()
-# grpc_deps.bzl only defines 'grpc_deps', add this to call it
+# grpc_deps.bzl only defines 'grpc_deps' and 'grpc_test_only_deps', add these
+# lines to call them.
bazel_file += '\ngrpc_deps()\n'
+bazel_file += '\ngrpc_test_only_deps()\n'
build_rules = {
'native': eval_state,
}
@@ -92,11 +114,12 @@ for name in _GRPC_DEP_NAMES:
assert name in names_and_urls.keys()
assert len(_GRPC_DEP_NAMES) == len(names_and_urls.keys())
-# bazeltoolschains is an exception to this sanity check,
-# we don't require that there is a corresponding git module.
-names_without_bazeltoolchains = names_and_urls.keys()
-names_without_bazeltoolchains.remove(_BAZEL_TOOLCHAINS_DEP_NAME)
-archive_urls = [names_and_urls[name] for name in names_without_bazeltoolchains]
+# There are some "bazel-only" deps that are exceptions to this sanity check,
+# we don't require that there is a corresponding git module for these.
+names_without_bazel_only_deps = names_and_urls.keys()
+for dep_name in _GRPC_BAZEL_ONLY_DEPS:
+ names_without_bazel_only_deps.remove(dep_name)
+archive_urls = [names_and_urls[name] for name in names_without_bazel_only_deps]
workspace_git_hashes = {
re.search(git_hash_pattern, url).group()
for url in archive_urls