Add env variable GRPC_DNS_RESOLVER
diff --git a/tools/run_tests/run_tests_matrix.py b/tools/run_tests/run_tests_matrix.py
index 41db67c..260e0ee 100755
--- a/tools/run_tests/run_tests_matrix.py
+++ b/tools/run_tests/run_tests_matrix.py
@@ -49,7 +49,8 @@
_DEFAULT_INNER_JOBS = 2
-def _docker_jobspec(name, runtests_args=[], inner_jobs=_DEFAULT_INNER_JOBS):
+def _docker_jobspec(name, runtests_args=[], runtests_envs={},
+ inner_jobs=_DEFAULT_INNER_JOBS):
"""Run a single instance of run_tests.py in a docker container"""
test_job = jobset.JobSpec(
cmdline=['python', 'tools/run_tests/run_tests.py',
@@ -58,16 +59,19 @@
'-j', str(inner_jobs),
'-x', 'report_%s.xml' % name,
'--report_suite_name', '%s' % name] + runtests_args,
+ environ=runtests_envs,
shortname='run_tests_%s' % name,
timeout_seconds=_RUNTESTS_TIMEOUT)
return test_job
-def _workspace_jobspec(name, runtests_args=[], workspace_name=None, inner_jobs=_DEFAULT_INNER_JOBS):
+def _workspace_jobspec(name, runtests_args=[], workspace_name=None,
+ runtests_envs={}, inner_jobs=_DEFAULT_INNER_JOBS):
"""Run a single instance of run_tests.py in a separate workspace"""
if not workspace_name:
workspace_name = 'workspace_%s' % name
env = {'WORKSPACE_NAME': workspace_name}
+ env.update(runtests_envs)
test_job = jobset.JobSpec(
cmdline=['tools/run_tests/run_tests_in_workspace.sh',
'-t',
@@ -82,7 +86,7 @@
def _generate_jobs(languages, configs, platforms,
arch=None, compiler=None,
- labels=[], extra_args=[],
+ labels=[], extra_args=[], extra_envs={},
inner_jobs=_DEFAULT_INNER_JOBS):
result = []
for language in languages:
@@ -95,12 +99,16 @@
name += '_%s_%s' % (arch, compiler)
runtests_args += ['--arch', arch,
'--compiler', compiler]
+ for extra_env in extra_envs:
+ name += '_%s=%s' % (extra_env, extra_envs[extra_env])
runtests_args += extra_args
if platform == 'linux':
- job = _docker_jobspec(name=name, runtests_args=runtests_args, inner_jobs=inner_jobs)
+ job = _docker_jobspec(name=name, runtests_args=runtests_args,
+ runtests_envs=extra_envs, inner_jobs=inner_jobs)
else:
- job = _workspace_jobspec(name=name, runtests_args=runtests_args, inner_jobs=inner_jobs)
+ job = _workspace_jobspec(name=name, runtests_args=runtests_args,
+ runtests_envs=extra_envs, inner_jobs=inner_jobs)
job.labels = [platform, config, language] + labels
result.append(job)
@@ -212,6 +220,15 @@
extra_args=extra_args,
inner_jobs=inner_jobs)
+ # Test c and C++ with the native DNS resolver
+ test_jobs += _generate_jobs(languages=['c', 'c++'],
+ configs=['dbg'], platforms=['linux', 'windows'],
+ arch='default',
+ compiler='default',
+ labels=['portability'],
+ extra_args=extra_args,
+ extra_envs={'GRPC_DNS_RESOLVER': 'native'})
+
test_jobs += _generate_jobs(languages=['python'],
configs=['dbg'],
platforms=['linux'],