From 3c344d2f6955d3a3a7f784279bd66a67c6f02ce4 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Tue, 4 Apr 2017 16:49:06 +0200 Subject: adjust run_tests scripts --- tools/run_tests/helper_scripts/build_csharp.bat | 42 +++++++++++++++++++ tools/run_tests/helper_scripts/build_csharp.sh | 11 ++++- .../helper_scripts/build_csharp_coreclr.bat | 44 ------------------- .../helper_scripts/build_csharp_coreclr.sh | 38 ----------------- .../run_tests/helper_scripts/pre_build_csharp.bat | 49 +--------------------- tools/run_tests/helper_scripts/pre_build_csharp.sh | 45 +------------------- tools/run_tests/run_interop_tests.py | 4 +- tools/run_tests/run_tests.py | 25 ++++------- 8 files changed, 63 insertions(+), 195 deletions(-) create mode 100644 tools/run_tests/helper_scripts/build_csharp.bat delete mode 100644 tools/run_tests/helper_scripts/build_csharp_coreclr.bat delete mode 100755 tools/run_tests/helper_scripts/build_csharp_coreclr.sh (limited to 'tools/run_tests') diff --git a/tools/run_tests/helper_scripts/build_csharp.bat b/tools/run_tests/helper_scripts/build_csharp.bat new file mode 100644 index 0000000000..05ea78564c --- /dev/null +++ b/tools/run_tests/helper_scripts/build_csharp.bat @@ -0,0 +1,42 @@ +@rem Copyright 2016, Google Inc. +@rem All rights reserved. +@rem +@rem Redistribution and use in source and binary forms, with or without +@rem modification, are permitted provided that the following conditions are +@rem met: +@rem +@rem * Redistributions of source code must retain the above copyright +@rem notice, this list of conditions and the following disclaimer. +@rem * Redistributions in binary form must reproduce the above +@rem copyright notice, this list of conditions and the following disclaimer +@rem in the documentation and/or other materials provided with the +@rem distribution. +@rem * Neither the name of Google Inc. nor the names of its +@rem contributors may be used to endorse or promote products derived from +@rem this software without specific prior written permission. +@rem +@rem THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +@rem "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +@rem LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +@rem A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +@rem OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +@rem SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +@rem LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +@rem DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +@rem THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +@rem (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +@rem OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +setlocal + +cd /d %~dp0\..\..\..\src\csharp + +dotnet build --configuration %MSBUILD_CONFIG% Grpc.sln || goto :error + +endlocal + +goto :EOF + +:error +echo Failed! +exit /b %errorlevel% diff --git a/tools/run_tests/helper_scripts/build_csharp.sh b/tools/run_tests/helper_scripts/build_csharp.sh index 84c5b1c777..00897ecbe6 100755 --- a/tools/run_tests/helper_scripts/build_csharp.sh +++ b/tools/run_tests/helper_scripts/build_csharp.sh @@ -32,5 +32,12 @@ set -ex cd $(dirname $0)/../../../src/csharp -# overriding NativeDependenciesConfigurationUnix is needed to make gcov code coverage work. -xbuild /p:Configuration=$MSBUILD_CONFIG /p:NativeDependenciesConfigurationUnix=$CONFIG Grpc.sln +OVERRIDE_NATIVELIB_MAYBE="" +if [ "$CONFIG" == "gcov" ] +then + # overriding NativeDependenciesConfigurationUnix makes C# project pick up + # the gcov flavor of grpc_csharp_ext + OVERRIDE_NATIVELIB_MAYBE="/p:NativeDependenciesConfigurationUnix=$CONFIG" +fi + +dotnet build --configuration $MSBUILD_CONFIG $OVERRIDE_NATIVELIB_MAYBE Grpc.sln diff --git a/tools/run_tests/helper_scripts/build_csharp_coreclr.bat b/tools/run_tests/helper_scripts/build_csharp_coreclr.bat deleted file mode 100644 index 78e5f5998b..0000000000 --- a/tools/run_tests/helper_scripts/build_csharp_coreclr.bat +++ /dev/null @@ -1,44 +0,0 @@ -@rem Copyright 2016, Google Inc. -@rem All rights reserved. -@rem -@rem Redistribution and use in source and binary forms, with or without -@rem modification, are permitted provided that the following conditions are -@rem met: -@rem -@rem * Redistributions of source code must retain the above copyright -@rem notice, this list of conditions and the following disclaimer. -@rem * Redistributions in binary form must reproduce the above -@rem copyright notice, this list of conditions and the following disclaimer -@rem in the documentation and/or other materials provided with the -@rem distribution. -@rem * Neither the name of Google Inc. nor the names of its -@rem contributors may be used to endorse or promote products derived from -@rem this software without specific prior written permission. -@rem -@rem THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -@rem "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -@rem LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -@rem A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -@rem OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -@rem SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -@rem LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -@rem DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -@rem THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -@rem (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -@rem OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -setlocal - -cd /d %~dp0\..\..\..\src\csharp - -dotnet restore . || goto :error - -dotnet build --configuration %MSBUILD_CONFIG% "**/project.json" || goto :error - -endlocal - -goto :EOF - -:error -echo Failed! -exit /b %errorlevel% diff --git a/tools/run_tests/helper_scripts/build_csharp_coreclr.sh b/tools/run_tests/helper_scripts/build_csharp_coreclr.sh deleted file mode 100755 index dd5fd31c75..0000000000 --- a/tools/run_tests/helper_scripts/build_csharp_coreclr.sh +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/bash -# Copyright 2015, Google Inc. -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above -# copyright notice, this list of conditions and the following disclaimer -# in the documentation and/or other materials provided with the -# distribution. -# * Neither the name of Google Inc. nor the names of its -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -set -ex - -cd $(dirname $0)/../../../src/csharp - -# TODO(jtattermusch): introduce caching -dotnet restore . - -dotnet build --configuration $MSBUILD_CONFIG '**/project.json' diff --git a/tools/run_tests/helper_scripts/pre_build_csharp.bat b/tools/run_tests/helper_scripts/pre_build_csharp.bat index bee430ac86..c7684f538e 100644 --- a/tools/run_tests/helper_scripts/pre_build_csharp.bat +++ b/tools/run_tests/helper_scripts/pre_build_csharp.bat @@ -46,54 +46,9 @@ cd %ARCHITECTURE% cmake -G "Visual Studio 14 2015" -A %ARCHITECTURE% -DgRPC_BUILD_TESTS=OFF -DgRPC_MSVC_STATIC_RUNTIME=ON -DCMAKE_ASM_NASM_COMPILER="C:/Program Files (x86)/yasm/yasm.exe" ../../.. || goto :error cd ..\..\.. -@rem Location of nuget.exe -set NUGET=C:\nuget\nuget.exe +cd src/csharp -if exist %NUGET% ( - @rem TODO(jtattermusch): Get rid of this hack. See #8034 - @rem Restore Grpc packages by packages since Nuget client 3.4.4 doesnt support restore - @rem by solution - @rem Moving into each directory to let the restores work based on per-project packages.config files - - cd src/csharp - - cd Grpc.Auth || goto :error - %NUGET% restore -PackagesDirectory ../packages || goto :error - cd .. - - cd Grpc.Core || goto :error - %NUGET% restore -PackagesDirectory ../packages || goto :error - cd .. - - cd Grpc.Core.Tests || goto :error - %NUGET% restore -PackagesDirectory ../packages || goto :error - cd .. - - cd Grpc.Examples.MathClient || goto :error - %NUGET% restore -PackagesDirectory ../packages || goto :error - cd .. - - cd Grpc.Examples.MathServer || goto :error - %NUGET% restore -PackagesDirectory ../packages || goto :error - cd .. - - cd Grpc.Examples || goto :error - %NUGET% restore -PackagesDirectory ../packages || goto :error - cd .. - - cd Grpc.HealthCheck.Tests || goto :error - %NUGET% restore -PackagesDirectory ../packages || goto :error - cd .. - - cd Grpc.HealthCheck || goto :error - %NUGET% restore -PackagesDirectory ../packages || goto :error - cd .. - - cd Grpc.IntegrationTesting || goto :error - %NUGET% restore -PackagesDirectory ../packages || goto :error - - cd /d %~dp0\..\.. || goto :error -) +dotnet restore Grpc.sln || goto :error endlocal diff --git a/tools/run_tests/helper_scripts/pre_build_csharp.sh b/tools/run_tests/helper_scripts/pre_build_csharp.sh index d7665e15af..40be1b6b64 100755 --- a/tools/run_tests/helper_scripts/pre_build_csharp.sh +++ b/tools/run_tests/helper_scripts/pre_build_csharp.sh @@ -33,47 +33,4 @@ set -ex # cd to gRPC csharp directory cd $(dirname $0)/../../../src/csharp -root=`pwd` - -if [ -x "$(command -v nuget)" ] -then - # TODO(jtattermusch): Get rid of this hack. See #8034 - # Restoring Nuget packages by packages rather than by solution because of - # inability to restore by solution with Nuget client 3.4.4 - # Moving into each directory to let the restores work based on per-project packages.config files - cd Grpc.Auth - nuget restore -PackagesDirectory ../packages - cd .. - - cd Grpc.Core.Tests - nuget restore -PackagesDirectory ../packages - cd .. - - cd Grpc.Core - nuget restore -PackagesDirectory ../packages - cd .. - - cd Grpc.Examples.MathClient - nuget restore -PackagesDirectory ../packages - cd .. - - cd Grpc.Examples.MathServer - nuget restore -PackagesDirectory ../packages - cd .. - - cd Grpc.Examples - nuget restore -PackagesDirectory ../packages - cd .. - - cd Grpc.HealthCheck.Tests - nuget restore -PackagesDirectory ../packages - cd .. - - cd Grpc.HealthCheck - nuget restore -PackagesDirectory ../packages - cd .. - - cd Grpc.IntegrationTesting - nuget restore -PackagesDirectory ../packages - cd .. -fi +dotnet restore Grpc.sln diff --git a/tools/run_tests/run_interop_tests.py b/tools/run_tests/run_interop_tests.py index 2d7f4a625d..d2bf529fef 100755 --- a/tools/run_tests/run_interop_tests.py +++ b/tools/run_tests/run_interop_tests.py @@ -114,8 +114,8 @@ class CXXLanguage: class CSharpLanguage: def __init__(self): - self.client_cwd = 'src/csharp/Grpc.IntegrationTesting.Client/bin/Debug' - self.server_cwd = 'src/csharp/Grpc.IntegrationTesting.Server/bin/Debug' + self.client_cwd = 'src/csharp/Grpc.IntegrationTesting.Client/bin/Debug/net45' + self.server_cwd = 'src/csharp/Grpc.IntegrationTesting.Server/bin/Debug/net45' self.safename = str(self) def client_cmd(self, args): diff --git a/tools/run_tests/run_tests.py b/tools/run_tests/run_tests.py index 0b4f26ca44..9fa7cca14e 100755 --- a/tools/run_tests/run_tests.py +++ b/tools/run_tests/run_tests.py @@ -743,14 +743,11 @@ class CSharpLanguage(object): if self.platform == 'windows': _check_compiler(self.args.compiler, ['coreclr', 'default']) _check_arch(self.args.arch, ['default']) - self._cmake_arch_option = 'x64' if self.args.compiler == 'coreclr' else 'Win32' + self._cmake_arch_option = 'x64' self._make_options = [] else: _check_compiler(self.args.compiler, ['default', 'coreclr']) - if self.platform == 'linux' and self.args.compiler == 'coreclr': - self._docker_distro = 'coreclr' - else: - self._docker_distro = 'jessie' + self._docker_distro = 'jessie' if self.platform == 'mac': # TODO(jtattermusch): EMBED_ZLIB=true currently breaks the mac build @@ -766,7 +763,7 @@ class CSharpLanguage(object): tests_by_assembly = json.load(f) msbuild_config = _MSBUILD_CONFIG[self.config.build_config] - nunit_args = ['--labels=All'] + nunit_args = ['--labels=All','--noresult', '--workers=1'] assembly_subdir = 'bin/%s' % msbuild_config assembly_extension = '.exe' @@ -775,7 +772,7 @@ class CSharpLanguage(object): runtime_cmd = ['dotnet', 'exec'] assembly_extension = '.dll' else: - nunit_args += ['--noresult', '--workers=1'] + assembly_subdir += '/net45' if self.platform == 'windows': runtime_cmd = [] else: @@ -827,18 +824,10 @@ class CSharpLanguage(object): return self._make_options; def build_steps(self): - if self.args.compiler == 'coreclr': - if self.platform == 'windows': - return [['tools\\run_tests\\helper_scripts\\build_csharp_coreclr.bat']] - else: - return [['tools/run_tests/helper_scripts/build_csharp_coreclr.sh']] + if self.platform == 'windows': + return [['tools\\run_tests\\helper_scripts\\build_csharp.bat']] else: - if self.platform == 'windows': - return [['vsprojects\\build_vs2015.bat', - 'src/csharp/Grpc.sln', - '/p:Configuration=%s' % _MSBUILD_CONFIG[self.config.build_config]]] - else: - return [['tools/run_tests/helper_scripts/build_csharp.sh']] + return [['tools/run_tests/helper_scripts/build_csharp.sh']] def post_tests_steps(self): if self.platform == 'windows': -- cgit v1.2.3 From 78cb931afd9bf4ae33ecaf26dbd498cff41d6b52 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Tue, 11 Apr 2017 11:04:42 +0200 Subject: address review comments --- tools/run_tests/helper_scripts/build_csharp.sh | 10 ++++------ tools/run_tests/helper_scripts/pre_build_csharp.bat | 3 +-- tools/run_tests/run_tests.py | 2 +- 3 files changed, 6 insertions(+), 9 deletions(-) (limited to 'tools/run_tests') diff --git a/tools/run_tests/helper_scripts/build_csharp.sh b/tools/run_tests/helper_scripts/build_csharp.sh index 00897ecbe6..a7562a7f4a 100755 --- a/tools/run_tests/helper_scripts/build_csharp.sh +++ b/tools/run_tests/helper_scripts/build_csharp.sh @@ -32,12 +32,10 @@ set -ex cd $(dirname $0)/../../../src/csharp -OVERRIDE_NATIVELIB_MAYBE="" if [ "$CONFIG" == "gcov" ] then - # overriding NativeDependenciesConfigurationUnix makes C# project pick up - # the gcov flavor of grpc_csharp_ext - OVERRIDE_NATIVELIB_MAYBE="/p:NativeDependenciesConfigurationUnix=$CONFIG" + # overriding NativeDependenciesConfigurationUnix makes C# project pick up the gcov flavor of grpc_csharp_ext + dotnet build --configuration $MSBUILD_CONFIG /p:NativeDependenciesConfigurationUnix=gcov Grpc.sln +else + dotnet build --configuration $MSBUILD_CONFIG Grpc.sln fi - -dotnet build --configuration $MSBUILD_CONFIG $OVERRIDE_NATIVELIB_MAYBE Grpc.sln diff --git a/tools/run_tests/helper_scripts/pre_build_csharp.bat b/tools/run_tests/helper_scripts/pre_build_csharp.bat index c7684f538e..e59dac4edc 100644 --- a/tools/run_tests/helper_scripts/pre_build_csharp.bat +++ b/tools/run_tests/helper_scripts/pre_build_csharp.bat @@ -44,9 +44,8 @@ mkdir %ARCHITECTURE% cd %ARCHITECTURE% @rem TODO(jtattermusch): Stop hardcoding path to yasm once Jenkins workers can locate yasm correctly cmake -G "Visual Studio 14 2015" -A %ARCHITECTURE% -DgRPC_BUILD_TESTS=OFF -DgRPC_MSVC_STATIC_RUNTIME=ON -DCMAKE_ASM_NASM_COMPILER="C:/Program Files (x86)/yasm/yasm.exe" ../../.. || goto :error -cd ..\..\.. -cd src/csharp +cd ..\..\..\src\csharp dotnet restore Grpc.sln || goto :error diff --git a/tools/run_tests/run_tests.py b/tools/run_tests/run_tests.py index 9fa7cca14e..23abda376b 100755 --- a/tools/run_tests/run_tests.py +++ b/tools/run_tests/run_tests.py @@ -763,7 +763,7 @@ class CSharpLanguage(object): tests_by_assembly = json.load(f) msbuild_config = _MSBUILD_CONFIG[self.config.build_config] - nunit_args = ['--labels=All','--noresult', '--workers=1'] + nunit_args = ['--labels=All', '--noresult', '--workers=1'] assembly_subdir = 'bin/%s' % msbuild_config assembly_extension = '.exe' -- cgit v1.2.3