update C# distribtests

pull/15331/head
Jan Tattermusch 7 years ago
parent 149e06973e
commit 1d3cc21910
  1. 11
      test/distrib/csharp/DistribTest/DistribTest.project.json
  2. 27
      test/distrib/csharp/DistribTest/DistribTestDotNet.csproj
  3. 22
      test/distrib/csharp/DistribTest/project.json
  4. 5
      test/distrib/csharp/run_distrib_test.sh
  5. 17
      test/distrib/csharp/run_distrib_test_dotnetcli.sh
  6. 2
      test/distrib/csharp/update_version.sh
  7. 5
      tools/dockerfile/distribtest/csharp_ubuntu1404_x64/Dockerfile

@ -1,11 +0,0 @@
// This file exists only to prevent VS2015 from mistakenly picking up
// project.json file when building .csproj project.
// See https://github.com/Microsoft/msbuild/issues/394
{
"frameworks": {
"net45": { }
},
"runtimes": {
"win": { }
}
}

@ -0,0 +1,27 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>netcoreapp1.0;net45</TargetFrameworks>
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
<GenerateAssemblyDescriptionAttribute>false</GenerateAssemblyDescriptionAttribute>
<GenerateAssemblyFileVersionAttribute>false</GenerateAssemblyFileVersionAttribute>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
<GenerateAssemblyTitleAttribute>false</GenerateAssemblyTitleAttribute>
<GenerateAssemblyVersionAttribute>false</GenerateAssemblyVersionAttribute>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Grpc" Version="__GRPC_NUGET_VERSION__" />
<PackageReference Include="Grpc.Auth" Version="__GRPC_NUGET_VERSION__" />
<PackageReference Include="Grpc.Tools" Version="__GRPC_NUGET_VERSION__" />
</ItemGroup>
<PropertyGroup Condition="'$(OS)' != 'Windows_NT'">
<!-- Workaround for https://github.com/dotnet/sdk/issues/335 -->
<FrameworkPathOverride Condition="Exists('/usr/lib/mono/4.5-api')">/usr/lib/mono/4.5-api</FrameworkPathOverride>
<FrameworkPathOverride Condition="Exists('/usr/local/lib/mono/4.5-api')">/usr/local/lib/mono/4.5-api</FrameworkPathOverride>
<FrameworkPathOverride Condition="Exists('/Library/Frameworks/Mono.framework/Versions/Current/lib/mono/4.5-api')">/Library/Frameworks/Mono.framework/Versions/Current/lib/mono/4.5-api</FrameworkPathOverride>
</PropertyGroup>
</Project>

@ -1,22 +0,0 @@
{
"buildOptions": {
"emitEntryPoint": true
},
"dependencies": {
"Grpc.Auth": "__GRPC_NUGET_VERSION__",
"Grpc.Core": "__GRPC_NUGET_VERSION__",
// Necessary for native deps to get copied correctly.
"Microsoft.NETCore.Platforms": "1.0.1"
},
"frameworks": {
"net45": { },
"netcoreapp1.0": {
"dependencies": {
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.0.0"
}
}
}
}
}

@ -21,11 +21,6 @@ unzip -o "$EXTERNAL_GIT_ROOT/input_artifacts/csharp_nugets_windows_dotnetcli.zip
./update_version.sh auto
# With a recent-enough version of mono, the "nuget restore" command would
# restore packages based on project.json files, but we want to restore packages
# based on the net45 legacy "packages.config" file instead.
rm DistribTest/*project.json
nuget restore
xbuild DistribTest.sln

@ -25,19 +25,22 @@ cd DistribTest
# TODO(jtattermusch): make sure we don't pollute the global nuget cache with
# the nugets being tested.
dotnet restore
dotnet restore DistribTestDotNet.csproj
dotnet build
dotnet publish
dotnet build DistribTestDotNet.csproj
dotnet publish -f netcoreapp1.0 DistribTestDotNet.csproj
dotnet publish -f net45 DistribTestDotNet.csproj
ls -R bin
# .NET 4.5 target after dotnet build
mono bin/Debug/net45/*-x64/DistribTest.exe
mono bin/Debug/net45/publish/DistribTestDotNet.exe
# .NET 4.5 target after dotnet publish
mono bin/Debug/net45/*-x64/publish/DistribTest.exe
mono bin/Debug/net45/publish/DistribTestDotNet.exe
# .NET Core target after dotnet build
dotnet exec bin/Debug/netcoreapp1.0/DistribTest.dll
dotnet exec bin/Debug/netcoreapp1.0/DistribTestDotNet.dll
# .NET Core target after dotnet publish
dotnet exec bin/Debug/netcoreapp1.0/publish/DistribTest.dll
dotnet exec bin/Debug/netcoreapp1.0/publish/DistribTestDotNet.dll

@ -28,4 +28,4 @@ then
fi
# Replaces version placeholder with value provided as first argument.
sed -ibak "s/__GRPC_NUGET_VERSION__/${CSHARP_VERSION}/g" DistribTest/packages.config DistribTest/DistribTest.csproj DistribTest/project.json
sed -ibak "s/__GRPC_NUGET_VERSION__/${CSHARP_VERSION}/g" DistribTest/packages.config DistribTest/DistribTest.csproj DistribTest/DistribTestDotNet.csproj

@ -22,16 +22,13 @@ RUN apt-get update && apt-get install -y \
ca-certificates-mono \
nuget
# make sure we have nuget 2.12+ (in case there's an older cached docker image)
RUN apt-get update && apt-get install -y nuget
RUN apt-get update && apt-get install -y unzip
# Install dotnet CLI
RUN apt-get install -y apt-transport-https
RUN sh -c 'echo "deb [arch=amd64] https://apt-mo.trafficmanager.net/repos/dotnet-release/ trusty main" > /etc/apt/sources.list.d/dotnetdev.list'
RUN apt-key adv --keyserver apt-mo.trafficmanager.net --recv-keys 417A0893
RUN apt-get update && apt-get install -y dotnet-dev-1.0.0-preview2-003121
RUN apt-get update && apt-get install -y dotnet-dev-1.0.4
# Trigger the population of the local package cache for dotnet CLI
RUN mkdir warmup \

Loading…
Cancel
Save