Merge pull request #18070 from jtattermusch/aspnetcore_server

Add interop tests for grpc-dotnet repository
pull/18333/head
Jan Tattermusch 6 years ago committed by GitHub
commit dcb3b03971
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 20
      templates/tools/dockerfile/interoptest/grpc_interop_aspnetcore/Dockerfile.template
  2. 31
      templates/tools/dockerfile/interoptest/grpc_interop_aspnetcore/build_interop.sh.template
  3. 18
      tools/dockerfile/interoptest/grpc_interop_aspnetcore/Dockerfile
  4. 29
      tools/dockerfile/interoptest/grpc_interop_aspnetcore/build_interop.sh
  5. 1
      tools/internal_ci/helper_scripts/prepare_build_interop_rc
  6. 1
      tools/internal_ci/helper_scripts/prepare_build_macos_interop_rc
  7. 8
      tools/run_tests/dockerize/build_interop_image.sh
  8. 36
      tools/run_tests/run_interop_tests.py

@ -0,0 +1,20 @@
%YAML 1.2
--- |
# 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.
FROM mcr.microsoft.com/dotnet/core/sdk:3.0.100-preview3-stretch
# Define the default command.
CMD ["bash"]

@ -0,0 +1,31 @@
%YAML 1.2
--- |
#!/bin/bash
# Copyright 2017 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.
#
# Builds Grpc.AspNetCore.Server interop server in a base image.
set -e
mkdir -p /var/local/git
git clone /var/local/jenkins/grpc-dotnet /var/local/git/grpc-dotnet
# copy service account keys if available
cp -r /var/local/jenkins/service_account $HOME || true
cd /var/local/git/grpc-dotnet
./build/get-grpc.sh
cd testassets/InteropTestsWebsite
dotnet build --configuration Debug

@ -0,0 +1,18 @@
# 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.
FROM mcr.microsoft.com/dotnet/core/sdk:3.0.100-preview3-stretch
# Define the default command.
CMD ["bash"]

@ -0,0 +1,29 @@
#!/bin/bash
# Copyright 2017 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.
#
# Builds Grpc.AspNetCore.Server interop server in a base image.
set -e
mkdir -p /var/local/git
git clone /var/local/jenkins/grpc-dotnet /var/local/git/grpc-dotnet
# copy service account keys if available
cp -r /var/local/jenkins/service_account $HOME || true
cd /var/local/git/grpc-dotnet
./build/get-grpc.sh
cd testassets/InteropTestsWebsite
dotnet build --configuration Debug

@ -28,6 +28,7 @@ git clone --recursive https://github.com/grpc/grpc-go ./../grpc-go
git clone --recursive https://github.com/grpc/grpc-java ./../grpc-java
git clone --recursive https://github.com/grpc/grpc-node ./../grpc-node
git clone --recursive https://github.com/grpc/grpc-dart ./../grpc-dart
git clone --recursive https://github.com/grpc/grpc-dotnet ./../grpc-dotnet
# Download json file.
mkdir ~/service_account

@ -22,3 +22,4 @@ git clone --recursive https://github.com/grpc/grpc-go ./../grpc-go
git clone --recursive https://github.com/grpc/grpc-java ./../grpc-java
git clone --recursive https://github.com/grpc/grpc-node ./../grpc-node
git clone --recursive https://github.com/grpc/grpc-dart ./../grpc-dart
git clone --recursive https://github.com/grpc/grpc-dotnet ./../grpc-dotnet

@ -64,6 +64,14 @@ else
echo "WARNING: grpc-node not found, it won't be mounted to the docker container."
fi
echo "GRPC_DOTNET_ROOT: ${GRPC_DOTNET_ROOT:=$(cd ../grpc-dotnet && pwd)}"
if [ -n "$GRPC_DOTNET_ROOT" ]
then
MOUNT_ARGS+=" -v $GRPC_DOTNET_ROOT:/var/local/jenkins/grpc-dotnet:ro"
else
echo "WARNING: grpc-dotnet not found, it won't be mounted to the docker container."
fi
# Mount service account dir if available.
# If service_directory does not contain the service account JSON file,
# some of the tests will fail.

@ -173,6 +173,37 @@ class CSharpCoreCLRLanguage:
return 'csharpcoreclr'
class AspNetCoreLanguage:
def __init__(self):
self.client_cwd = '../grpc-dotnet'
self.server_cwd = '../grpc-dotnet/testassets/InteropTestsWebsite/bin/Debug/netcoreapp3.0'
self.safename = str(self)
def cloud_to_prod_env(self):
return {}
def client_cmd(self, args):
# attempt to run client should fail
return ['dotnet' 'exec', 'CLIENT_NOT_SUPPORTED'] + args
def server_cmd(self, args):
return ['dotnet', 'exec', 'InteropTestsWebsite.dll'] + args
def global_env(self):
return {}
def unimplemented_test_cases(self):
# aspnetcore doesn't have a client so ignore all test cases.
return _TEST_CASES + _AUTH_TEST_CASES
def unimplemented_test_cases_server(self):
return _SKIP_COMPRESSION + _SKIP_SPECIAL_STATUS_MESSAGE
def __str__(self):
return 'aspnetcore'
class DartLanguage:
def __init__(self):
@ -590,6 +621,7 @@ _LANGUAGES = {
'c++': CXXLanguage(),
'csharp': CSharpLanguage(),
'csharpcoreclr': CSharpCoreCLRLanguage(),
'aspnetcore': AspNetCoreLanguage(),
'dart': DartLanguage(),
'go': GoLanguage(),
'java': JavaLanguage(),
@ -605,8 +637,8 @@ _LANGUAGES = {
# languages supported as cloud_to_cloud servers
_SERVERS = [
'c++', 'node', 'csharp', 'csharpcoreclr', 'java', 'go', 'ruby', 'python',
'dart'
'c++', 'node', 'csharp', 'csharpcoreclr', 'aspnetcore', 'java', 'go',
'ruby', 'python', 'dart'
]
_TEST_CASES = [

Loading…
Cancel
Save