15 """Definition of targets run distribution package tests."""
20 sys.path.insert(0, os.path.abspath(
'..'))
31 timeout_seconds=30 * 60):
32 """Creates jobspec for a task running under docker."""
33 environ = environ.copy()
36 environ[
'RELATIVE_COPY_PATH'] = copy_rel_path
39 for k, v
in list(environ.items()):
40 docker_args += [
'-e',
'%s=%s' % (k, v)]
42 'DOCKERFILE_DIR': dockerfile_dir,
43 'DOCKER_RUN_SCRIPT':
'tools/run_tests/dockerize/docker_run.sh',
44 'DOCKER_RUN_SCRIPT_COMMAND': shell_command,
46 jobspec = jobset.JobSpec(
47 cmdline=[
'tools/run_tests/dockerize/build_and_run_docker.sh'] +
50 shortname=
'distribtest.%s' % (name),
51 timeout_seconds=timeout_seconds,
52 flake_retries=flake_retries,
53 timeout_retries=timeout_retries)
64 timeout_seconds=10 * 60):
65 """Creates jobspec."""
66 environ = environ.copy()
68 environ[
'WORKSPACE_NAME'] =
'workspace_%s' % name
69 cmdline = [
'bash',
'tools/run_tests/artifacts/run_in_workspace.sh'
71 jobspec = jobset.JobSpec(cmdline=cmdline,
73 shortname=
'distribtest.%s' % (name),
74 timeout_seconds=timeout_seconds,
75 flake_retries=flake_retries,
76 timeout_retries=timeout_retries,
82 """Tests C# NuGet package"""
90 self.
name =
'csharp_%s_%s' % (platform, arch)
94 self.
labels = [
'distribtest',
'csharp', platform, arch]
96 self.
labels.append(
'presubmit')
99 self.
name +=
'_%s' % docker_suffix
100 self.
labels.append(docker_suffix)
102 self.
name +=
'_dotnetcli'
104 self.
labels.append(
'dotnetcli')
106 self.
labels.append(
'olddotnet')
116 'tools/dockerfile/distribtest/csharp_%s_%s' %
118 'tools/run_tests/artifacts/run_distribtest_csharp.sh',
119 copy_rel_path=
'tools/run_tests/artifacts')
123 [
'tools/run_tests/artifacts/run_distribtest_csharp.sh'],
124 environ={
'EXTERNAL_GIT_ROOT':
'../../../..'},
127 if self.
arch ==
'x64':
131 'MSBUILD_EXTRA_ARGS':
'//p:Platform=x64',
132 'DISTRIBTEST_OUTPATH':
'DistribTest\\bin\\x64\\Debug'
135 environ = {
'DISTRIBTEST_OUTPATH':
'DistribTest\\bin\\Debug'}
138 [
'bash',
'tools/run_tests/artifacts/run_distribtest_csharp.sh'],
142 raise Exception(
"Not supported yet.")
149 """Tests Python package"""
159 self.
name =
'python_dev_%s_%s_%s' % (platform, arch, docker_suffix)
161 self.
name =
'python_%s_%s_%s' % (platform, arch, docker_suffix)
165 self.
labels = [
'distribtest',
'python', platform, arch, docker_suffix]
167 self.
labels.append(
'presubmit')
176 raise Exception(
"Not supported yet.")
181 'tools/dockerfile/distribtest/python_dev_%s_%s' %
183 'test/distrib/python/run_source_distrib_test.sh',
184 copy_rel_path=
'test/distrib')
188 'tools/dockerfile/distribtest/python_%s_%s' %
190 'test/distrib/python/run_binary_distrib_test.sh',
191 copy_rel_path=
'test/distrib')
198 """Tests Ruby package"""
210 self.
name =
'ruby_%s_%s_%s_version_%s_package_type_%s' % (
211 platform, arch, docker_suffix, ruby_version
or
217 self.
labels = [
'distribtest',
'ruby', platform, arch, docker_suffix]
219 self.
labels.append(
'presubmit')
232 raise Exception(
"Not supported yet.")
234 dockerfile_name =
'tools/dockerfile/distribtest/ruby_%s_%s' % (
241 'test/distrib/ruby/run_distrib_test.sh %s %s %s' %
243 copy_rel_path=
'test/distrib')
250 """Tests PHP7 package"""
252 def __init__(self, platform, arch, docker_suffix=None, presubmit=False):
253 self.
name =
'php7_%s_%s_%s' % (platform, arch, docker_suffix)
257 self.
labels = [
'distribtest',
'php',
'php7', platform, arch]
259 self.
labels.append(
'presubmit')
261 self.
labels.append(docker_suffix)
272 'tools/dockerfile/distribtest/php7_%s_%s' %
274 'test/distrib/php/run_distrib_test.sh',
275 copy_rel_path=
'test/distrib')
278 self.
name, [
'test/distrib/php/run_distrib_test_macos.sh'],
279 environ={
'EXTERNAL_GIT_ROOT':
'../../../..'},
280 timeout_seconds=15 * 60,
283 raise Exception(
"Not supported yet.")
290 """Tests Cpp make install by building examples."""
298 if platform ==
'linux':
299 self.
name =
'cpp_%s_%s_%s_%s' % (platform, arch, docker_suffix,
302 self.
name =
'cpp_%s_%s_%s' % (platform, arch, testcase)
315 self.
labels.append(
'presubmit')
317 self.
labels.append(docker_suffix)
324 if inner_jobs
is not None:
326 environ[
'GRPC_CPP_DISTRIBTEST_BUILD_COMPILER_JOBS'] =
str(
332 'tools/dockerfile/distribtest/cpp_%s_%s' %
334 'test/distrib/cpp/run_distrib_test_%s.sh' % self.
testcase,
335 timeout_seconds=45 * 60)
339 [
'test\\distrib\\cpp\\run_distrib_test_%s.bat' % self.
testcase],
341 timeout_seconds=30 * 60,
344 raise Exception(
"Not supported yet.")
351 """Gets list of supported targets"""
354 CppDistribTest(
'linux',
'x64',
'stretch',
'cmake', presubmit=
True),
358 'cmake_as_submodule',
363 'cmake_as_externalproject',
368 'cmake_fetchcontent',
373 'cmake_module_install',
378 'cmake_module_install_pkgconfig',
387 'stretch_aarch64_cross',
388 'cmake_aarch64_cross',
390 CppDistribTest(
'windows',
'x86', testcase=
'cmake', presubmit=
True),
393 testcase=
'cmake_as_externalproject',
453 ruby_version=
'ruby_2_7',
459 ruby_version=
'ruby_2_5',