From 6c43b2c98a13d72cede65dc5c0defb82be42a083 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Mon, 26 Oct 2020 11:21:24 +0100 Subject: [PATCH] add netcoreapp3.1 C# distribtest --- .../DistribTest/DistribTestDotNet.csproj | 1 + .../csharp/run_distrib_test_dotnetcli.sh | 11 +++++++++ .../distribtest/csharp_alpine_x64/Dockerfile | 3 +++ .../csharp_dotnet31_x64/Dockerfile | 24 +++++++++++++++++++ .../distribtest/csharp_dotnet5_x64/Dockerfile | 1 + .../distribtest/csharp_stretch_x64/Dockerfile | 2 ++ .../csharp_ubuntu1604_x64/Dockerfile | 2 ++ .../artifacts/distribtest_targets.py | 1 + 8 files changed, 45 insertions(+) create mode 100644 tools/dockerfile/distribtest/csharp_dotnet31_x64/Dockerfile diff --git a/test/distrib/csharp/DistribTest/DistribTestDotNet.csproj b/test/distrib/csharp/DistribTest/DistribTestDotNet.csproj index 603891912a8..84a01bd13d5 100644 --- a/test/distrib/csharp/DistribTest/DistribTestDotNet.csproj +++ b/test/distrib/csharp/DistribTest/DistribTestDotNet.csproj @@ -7,6 +7,7 @@ $(TargetFrameworks);net45 $(TargetFrameworks);netcoreapp2.1 + $(TargetFrameworks);netcoreapp3.1 $(TargetFrameworks);net5.0 false diff --git a/test/distrib/csharp/run_distrib_test_dotnetcli.sh b/test/distrib/csharp/run_distrib_test_dotnetcli.sh index f516f12c89e..97bef26d399 100755 --- a/test/distrib/csharp/run_distrib_test_dotnetcli.sh +++ b/test/distrib/csharp/run_distrib_test_dotnetcli.sh @@ -53,6 +53,17 @@ then dotnet exec bin/Debug/netcoreapp2.1/publish/DistribTestDotNet.dll fi +if [ "${SKIP_NETCOREAPP31_DISTRIBTEST}" != "1" ] +then + dotnet publish -f netcoreapp3.1 DistribTestDotNet.csproj + + # .NET Core target after dotnet build + dotnet exec bin/Debug/netcoreapp3.1/DistribTestDotNet.dll + + # .NET Core target after dotnet publish + dotnet exec bin/Debug/netcoreapp3.1/publish/DistribTestDotNet.dll +fi + if [ "${SKIP_NET50_DISTRIBTEST}" != "1" ] then dotnet publish -f net5.0 DistribTestDotNet.csproj diff --git a/tools/dockerfile/distribtest/csharp_alpine_x64/Dockerfile b/tools/dockerfile/distribtest/csharp_alpine_x64/Dockerfile index 87021e3e9b2..44d911c2767 100644 --- a/tools/dockerfile/distribtest/csharp_alpine_x64/Dockerfile +++ b/tools/dockerfile/distribtest/csharp_alpine_x64/Dockerfile @@ -26,5 +26,8 @@ RUN apk add glibc-2.30-r0.apk # installing mono on alpine is hard and we don't really need it ENV SKIP_NET45_DISTRIBTEST=1 +# we have a separate distribtest for netcoreapp3.1 +ENV SKIP_NETCOREAPP31_DISTRIBTEST=1 # we have a separate distribtest for net5.0 ENV SKIP_NET50_DISTRIBTEST=1 + diff --git a/tools/dockerfile/distribtest/csharp_dotnet31_x64/Dockerfile b/tools/dockerfile/distribtest/csharp_dotnet31_x64/Dockerfile new file mode 100644 index 00000000000..9e1a7a8f988 --- /dev/null +++ b/tools/dockerfile/distribtest/csharp_dotnet31_x64/Dockerfile @@ -0,0 +1,24 @@ +# Copyright 2019 The gRPC Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# "3.1" tag uses debian buster +FROM mcr.microsoft.com/dotnet/core/sdk:3.1 + +RUN apt-get update && apt-get install -y unzip && apt-get clean + +# we only want to test dotnet core 3.1 runtime. This also allows us to keep +# this docker image minimal by not installing the other runtimes. +ENV SKIP_NET45_DISTRIBTEST=1 +ENV SKIP_NETCOREAPP21_DISTRIBTEST=1 +ENV SKIP_NET50_DISTRIBTEST=1 diff --git a/tools/dockerfile/distribtest/csharp_dotnet5_x64/Dockerfile b/tools/dockerfile/distribtest/csharp_dotnet5_x64/Dockerfile index ad88a2e4ef7..60ce55b5b9d 100644 --- a/tools/dockerfile/distribtest/csharp_dotnet5_x64/Dockerfile +++ b/tools/dockerfile/distribtest/csharp_dotnet5_x64/Dockerfile @@ -21,3 +21,4 @@ RUN apt-get update && apt-get install -y unzip && apt-get clean # this docker image minimal by not installing the other runtimes. ENV SKIP_NET45_DISTRIBTEST=1 ENV SKIP_NETCOREAPP21_DISTRIBTEST=1 +ENV SKIP_NETCOREAPP31_DISTRIBTEST=1 diff --git a/tools/dockerfile/distribtest/csharp_stretch_x64/Dockerfile b/tools/dockerfile/distribtest/csharp_stretch_x64/Dockerfile index 8f8c26cee08..fb9b14dc849 100644 --- a/tools/dockerfile/distribtest/csharp_stretch_x64/Dockerfile +++ b/tools/dockerfile/distribtest/csharp_stretch_x64/Dockerfile @@ -40,5 +40,7 @@ RUN apt-get update && apt-get install -y unzip && apt-get clean RUN apt-get update && apt-get install -y curl && apt-get clean RUN curl https://curl.haxx.se/ca/cacert.pem > ~/cacert.pem && cert-sync ~/cacert.pem && rm -f ~/cacert.pem +# we have a separate distribtest for netcoreapp3.1 +ENV SKIP_NETCOREAPP31_DISTRIBTEST=1 # we have a separate distribtest for net5.0 ENV SKIP_NET50_DISTRIBTEST=1 diff --git a/tools/dockerfile/distribtest/csharp_ubuntu1604_x64/Dockerfile b/tools/dockerfile/distribtest/csharp_ubuntu1604_x64/Dockerfile index ada5b3b3157..4755a3bce29 100644 --- a/tools/dockerfile/distribtest/csharp_ubuntu1604_x64/Dockerfile +++ b/tools/dockerfile/distribtest/csharp_ubuntu1604_x64/Dockerfile @@ -40,5 +40,7 @@ RUN apt-get update && apt-get install -y unzip && apt-get clean RUN apt-get update && apt-get install -y curl && apt-get clean RUN curl https://curl.haxx.se/ca/cacert.pem > ~/cacert.pem && cert-sync ~/cacert.pem && rm -f ~/cacert.pem +# we have a separate distribtest for netcoreapp3.1 +ENV SKIP_NETCOREAPP31_DISTRIBTEST=1 # we have a separate distribtest for net5.0 ENV SKIP_NET50_DISTRIBTEST=1 diff --git a/tools/run_tests/artifacts/distribtest_targets.py b/tools/run_tests/artifacts/distribtest_targets.py index eef1d29f9bd..c2df322b2b6 100644 --- a/tools/run_tests/artifacts/distribtest_targets.py +++ b/tools/run_tests/artifacts/distribtest_targets.py @@ -334,6 +334,7 @@ def targets(): CSharpDistribTest('linux', 'x64', 'ubuntu1604'), CSharpDistribTest('linux', 'x64', 'ubuntu1604', use_dotnet_cli=True), CSharpDistribTest('linux', 'x64', 'alpine', use_dotnet_cli=True), + CSharpDistribTest('linux', 'x64', 'dotnet31', use_dotnet_cli=True), CSharpDistribTest('linux', 'x64', 'dotnet5', use_dotnet_cli=True), CSharpDistribTest('macos', 'x64'), CSharpDistribTest('windows', 'x86'),