From 42e302dbfedd626d4c82d90cb66ce8fbca63c7dd Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Fri, 12 May 2017 11:43:22 +0200 Subject: [PATCH] Run mac and windows distribtests in workspace --- test/distrib/csharp/run_distrib_test.bat | 2 +- .../artifacts/distribtest_targets.py | 24 +++++++++++++------ 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/test/distrib/csharp/run_distrib_test.bat b/test/distrib/csharp/run_distrib_test.bat index cb5dd552739..aeadef37db9 100644 --- a/test/distrib/csharp/run_distrib_test.bat +++ b/test/distrib/csharp/run_distrib_test.bat @@ -31,7 +31,7 @@ cd /d %~dp0 @rem extract input artifacts -powershell -Command "Add-Type -Assembly 'System.IO.Compression.FileSystem'; [System.IO.Compression.ZipFile]::ExtractToDirectory('../../../input_artifacts/csharp_nugets_windows_dotnetcli.zip', 'TestNugetFeed');" +powershell -Command "Add-Type -Assembly 'System.IO.Compression.FileSystem'; [System.IO.Compression.ZipFile]::ExtractToDirectory('../../../../input_artifacts/csharp_nugets_windows_dotnetcli.zip', 'TestNugetFeed');" update_version.sh auto diff --git a/tools/run_tests/artifacts/distribtest_targets.py b/tools/run_tests/artifacts/distribtest_targets.py index 097fd2d8b5e..2262a50ed6a 100644 --- a/tools/run_tests/artifacts/distribtest_targets.py +++ b/tools/run_tests/artifacts/distribtest_targets.py @@ -63,8 +63,14 @@ def create_docker_jobspec(name, dockerfile_dir, shell_command, environ={}, def create_jobspec(name, cmdline, environ=None, shell=False, - flake_retries=0, timeout_retries=0): + flake_retries=0, timeout_retries=0, + use_workspace=False): """Creates jobspec.""" + environ = environ.copy() + if use_workspace: + environ['WORKSPACE_NAME'] = 'workspace_%s' % name + cmdline = ['bash', + 'tools/run_tests/artifacts/run_in_workspace.sh'] + cmdline jobspec = jobset.JobSpec( cmdline=cmdline, environ=environ, @@ -80,7 +86,7 @@ class CSharpDistribTest(object): """Tests C# NuGet package""" def __init__(self, platform, arch, docker_suffix=None, use_dotnet_cli=False): - self.name = 'csharp_nuget_%s_%s' % (platform, arch) + self.name = 'csharp_distribtest_%s_%s' % (platform, arch) self.platform = platform self.arch = arch self.docker_suffix = docker_suffix @@ -110,16 +116,18 @@ class CSharpDistribTest(object): elif self.platform == 'macos': return create_jobspec(self.name, ['test/distrib/csharp/run_distrib_test%s.sh' % self.script_suffix], - environ={'EXTERNAL_GIT_ROOT': '../../..'}) + environ={'EXTERNAL_GIT_ROOT': '../../../..'}, + use_workspace=True) elif self.platform == 'windows': if self.arch == 'x64': environ={'MSBUILD_EXTRA_ARGS': '/p:Platform=x64', 'DISTRIBTEST_OUTPATH': 'DistribTest\\bin\\x64\\Debug'} else: - environ={'DISTRIBTEST_OUTPATH': 'DistribTest\\bin\\\Debug'} + environ={'DISTRIBTEST_OUTPATH': 'DistribTest\\bin\\Debug'} return create_jobspec(self.name, ['test\\distrib\\csharp\\run_distrib_test%s.bat' % self.script_suffix], - environ=environ) + environ=environ, + use_workspace=True) else: raise Exception("Not supported yet.") @@ -161,7 +169,8 @@ class NodeDistribTest(object): return create_jobspec(self.name, ['test/distrib/node/run_distrib_test.sh', str(self.node_version)], - environ={'EXTERNAL_GIT_ROOT': '../../..'}) + environ={'EXTERNAL_GIT_ROOT': '../../../..'}, + use_workspace=True) else: raise Exception("Not supported yet.") @@ -249,7 +258,8 @@ class PHPDistribTest(object): elif self.platform == 'macos': return create_jobspec(self.name, ['test/distrib/php/run_distrib_test.sh'], - environ={'EXTERNAL_GIT_ROOT': '../../..'}) + environ={'EXTERNAL_GIT_ROOT': '../../../..'}, + use_workspace=True) else: raise Exception("Not supported yet.")