|
|
|
@ -49,7 +49,8 @@ _RUNTESTS_TIMEOUT = 4*60*60 |
|
|
|
|
_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 @@ def _docker_jobspec(name, runtests_args=[], inner_jobs=_DEFAULT_INNER_JOBS): |
|
|
|
|
'-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 _workspace_jobspec(name, runtests_args=[], workspace_name=None, inner_jobs=_ |
|
|
|
|
|
|
|
|
|
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 @@ def _generate_jobs(languages, configs, platforms, |
|
|
|
|
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,20 @@ def _create_portability_test_jobs(extra_args=[], inner_jobs=_DEFAULT_INNER_JOBS) |
|
|
|
|
extra_args=extra_args, |
|
|
|
|
inner_jobs=inner_jobs) |
|
|
|
|
|
|
|
|
|
# C and C++ with the native DNS resolver on Linux |
|
|
|
|
test_jobs += _generate_jobs(languages=['c', 'c++'], |
|
|
|
|
configs=['dbg'], platforms=['linux'], |
|
|
|
|
labels=['portability'], |
|
|
|
|
extra_args=extra_args, |
|
|
|
|
extra_envs={'GRPC_DNS_RESOLVER': 'native'}) |
|
|
|
|
|
|
|
|
|
# C with the native DNS resolver on Windonws |
|
|
|
|
test_jobs += _generate_jobs(languages=['c'], |
|
|
|
|
configs=['dbg'], platforms=['windows'], |
|
|
|
|
labels=['portability'], |
|
|
|
|
extra_args=extra_args, |
|
|
|
|
extra_envs={'GRPC_DNS_RESOLVER': 'native'}) |
|
|
|
|
|
|
|
|
|
test_jobs += _generate_jobs(languages=['python'], |
|
|
|
|
configs=['dbg'], |
|
|
|
|
platforms=['linux'], |
|
|
|
|