diff options
author | Vijay Pai <vpai@google.com> | 2016-02-22 16:16:03 -0800 |
---|---|---|
committer | Vijay Pai <vpai@google.com> | 2016-02-22 16:16:03 -0800 |
commit | b586cd0eb53b1c4daf7efc77ab3109153fee851b (patch) | |
tree | 0a193d6ef1419f0ea458f3aee218678af5ce0b67 /tools/run_tests | |
parent | 2146fe8f88a06669e29a0cef2474e4063e7efe53 (diff) | |
parent | bfc7adaa714b5d8a3b0dca4a25d572dbd92039be (diff) |
Merge branch 'master' into openloop
Diffstat (limited to 'tools/run_tests')
-rw-r--r-- | tools/run_tests/artifact_targets.py | 41 | ||||
-rw-r--r-- | tools/run_tests/build_artifact_python.bat | 61 | ||||
-rwxr-xr-x | tools/run_tests/run_interop_tests.py | 24 | ||||
-rw-r--r-- | tools/run_tests/run_node.bat | 2 | ||||
-rwxr-xr-x | tools/run_tests/run_node.sh | 9 | ||||
-rwxr-xr-x | tools/run_tests/run_tests.py | 4 | ||||
-rw-r--r-- | tools/run_tests/sources_and_headers.json | 31 |
7 files changed, 131 insertions, 41 deletions
diff --git a/tools/run_tests/artifact_targets.py b/tools/run_tests/artifact_targets.py index 9cd02c5e43..b565fbb3f0 100644 --- a/tools/run_tests/artifact_targets.py +++ b/tools/run_tests/artifact_targets.py @@ -80,6 +80,11 @@ def macos_arch_env(arch): return {'CFLAGS': arch_arg, 'LDFLAGS': arch_arg} +python_version_arch_map = { + 'x86': 'Python27_32bits', + 'x64': 'Python27' +} + class PythonArtifact: """Builds Python artifacts.""" @@ -88,27 +93,31 @@ class PythonArtifact: self.platform = platform self.arch = arch self.labels = ['artifact', 'python', platform, arch] + self.python_version = python_version_arch_map[arch] def pre_build_jobspecs(self): return [] def build_jobspec(self): - if self.platform == 'windows': - raise Exception('Not supported yet.') + environ = {} + if self.platform == 'linux': + if self.arch == 'x86': + environ['SETARCH_CMD'] = 'linux32' + return create_docker_jobspec(self.name, + 'tools/dockerfile/grpc_artifact_linux_%s' % self.arch, + 'tools/run_tests/build_artifact_python.sh', + environ=environ) + elif self.platform == 'windows': + return create_jobspec(self.name, + ['tools\\run_tests\\build_artifact_python.bat', + self.python_version + ], + shell=True) else: - environ = {} - if self.platform == 'linux': - if self.arch == 'x86': - environ['SETARCH_CMD'] = 'linux32' - return create_docker_jobspec(self.name, - 'tools/dockerfile/grpc_artifact_linux_%s' % self.arch, - 'tools/run_tests/build_artifact_python.sh', - environ=environ) - else: - environ['SKIP_PIP_INSTALL'] = 'TRUE' - return create_jobspec(self.name, - ['tools/run_tests/build_artifact_python.sh'], - environ=environ) + environ['SKIP_PIP_INSTALL'] = 'TRUE' + return create_jobspec(self.name, + ['tools/run_tests/build_artifact_python.sh'], + environ=environ) def __str__(self): return self.name @@ -235,6 +244,8 @@ def targets(): [PythonArtifact('linux', 'x86'), PythonArtifact('linux', 'x64'), PythonArtifact('macos', 'x64'), + PythonArtifact('windows', 'x86'), + PythonArtifact('windows', 'x64'), RubyArtifact('linux', 'x86'), RubyArtifact('linux', 'x64'), RubyArtifact('macos', 'x64')]) diff --git a/tools/run_tests/build_artifact_python.bat b/tools/run_tests/build_artifact_python.bat new file mode 100644 index 0000000000..023d394549 --- /dev/null +++ b/tools/run_tests/build_artifact_python.bat @@ -0,0 +1,61 @@ +@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. + + +set NUGET=C:\nuget\nuget.exe +%NUGET% restore vsprojects\grpc.sln || goto :error + + +@call vsprojects\build_vs2013.bat vsprojects\grpc.sln /t:grpc_dll /p:Configuration=Release /p:PlatformToolset=v120 /p:Platform=Win32 || goto :error +@call vsprojects\build_vs2013.bat vsprojects\grpc.sln /t:grpc_dll /p:Configuration=Release /p:PlatformToolset=v120 /p:Platform=x64 || goto :error + +mkdir src\python\grpcio\grpc\_cython\_windows + +copy /Y vsprojects\Release\grpc_dll.dll src\python\grpcio\grpc\_cython\_windows\grpc_c.32.python || goto :error +copy /Y vsprojects\x64\Release\grpc_dll.dll src\python\grpcio\grpc\_cython\_windows\grpc_c.64.python || goto :error + + +set PATH=C:\%1;C:\%1\scripts;%PATH% + +pip install --upgrade six +pip install --upgrade setuptools +pip install -rrequirements.txt + +set GRPC_PYTHON_USE_CUSTOM_BDIST=0 +set GRPC_PYTHON_BUILD_WITH_CYTHON=1 + +python setup.py bdist_wheel + +mkdir artifacts +xcopy /Y /I /S dist\* artifacts\ || goto :error + +goto :EOF + +:error +exit /b 1 diff --git a/tools/run_tests/run_interop_tests.py b/tools/run_tests/run_interop_tests.py index 76be932aef..df3ab90a83 100755 --- a/tools/run_tests/run_interop_tests.py +++ b/tools/run_tests/run_interop_tests.py @@ -422,7 +422,7 @@ def _job_kill_handler(job): time.sleep(2) -def cloud_to_prod_jobspec(language, test_case, server_host_name, +def cloud_to_prod_jobspec(language, test_case, server_host_name, server_host_detail, docker_image=None, auth=False): """Creates jobspec for cloud-to-prod interop test""" container_name = None @@ -441,7 +441,7 @@ def cloud_to_prod_jobspec(language, test_case, server_host_name, cwd = language.client_cwd if docker_image: - container_name = dockerjob.random_name('interop_client_%s' % + container_name = dockerjob.random_name('interop_client_%s' % language.safename) cmdline = docker_run_cmdline(cmdline, image=docker_image, @@ -457,7 +457,7 @@ def cloud_to_prod_jobspec(language, test_case, server_host_name, cmdline=cmdline, cwd=cwd, environ=environ, - shortname='%s:%s:%s:%s' % (suite_name, server_host_name, language, + shortname='%s:%s:%s:%s' % (suite_name, server_host_name, language, test_case), timeout_seconds=90, flake_retries=5 if args.allow_flakes else 0, @@ -575,18 +575,18 @@ def aggregate_http2_results(stdout): 'percent': 1.0 * passed / (passed + failed) } -# A dictionary of prod servers to test. +# A dictionary of prod servers to test. # Format: server_name: (server_host, server_host_override, errors_allowed) # TODO(adelez): implement logic for errors_allowed where if the indicated tests # fail, they don't impact the overall test result. prod_servers = { - 'default': ('grpc-test.sandbox.googleapis.com', + 'default': ('grpc-test.sandbox.googleapis.com', 'grpc-test.sandbox.googleapis.com', False), - 'gateway_v2': ('grpc-test2.sandbox.googleapis.com', + 'gateway_v2': ('grpc-test2.sandbox.googleapis.com', 'grpc-test2.sandbox.googleapis.com', True), - 'cloud_gateway': ('216.239.32.255', 'grpc-test.sandbox.googleapis.com', + 'cloud_gateway': ('216.239.32.255', 'grpc-test.sandbox.googleapis.com', False), - 'cloud_gateway_v2': ('216.239.32.255', 'grpc-test2.sandbox.googleapis.com', + 'cloud_gateway_v2': ('216.239.32.255', 'grpc-test2.sandbox.googleapis.com', True) } @@ -720,7 +720,7 @@ try: if not test_case in language.unimplemented_test_cases(): if not test_case in _SKIP_ADVANCED + _SKIP_COMPRESSION: test_job = cloud_to_prod_jobspec( - language, test_case, server_host_name, + language, test_case, server_host_name, prod_servers[server_host_name], docker_image=docker_images.get(str(language))) jobs.append(test_job) @@ -728,7 +728,7 @@ try: if args.http2_interop: for test_case in _HTTP2_TEST_CASES: test_job = cloud_to_prod_jobspec( - http2Interop, test_case, server_host_name, + http2Interop, test_case, server_host_name, prod_servers[server_host_name], docker_image=docker_images.get(str(http2Interop))) jobs.append(test_job) @@ -739,7 +739,7 @@ try: for test_case in _AUTH_TEST_CASES: if not test_case in language.unimplemented_test_cases(): test_job = cloud_to_prod_jobspec( - language, test_case, server_host_name, + language, test_case, server_host_name, prod_servers[server_host_name], docker_image=docker_images.get(str(language)), auth=True) jobs.append(test_job) @@ -802,7 +802,7 @@ try: report_utils.render_interop_html_report( set([str(l) for l in languages]), servers, _TEST_CASES, _AUTH_TEST_CASES, _HTTP2_TEST_CASES, resultset, num_failures, - args.cloud_to_prod_auth or args.cloud_to_prod, args.prod_servers, + args.cloud_to_prod_auth or args.cloud_to_prod, args.prod_servers, args.http2_interop) finally: diff --git a/tools/run_tests/run_node.bat b/tools/run_tests/run_node.bat index f5cf01f095..ad9ca14b8b 100644 --- a/tools/run_tests/run_node.bat +++ b/tools/run_tests/run_node.bat @@ -29,4 +29,4 @@ set JUNIT_REPORT_PATH=src\node\reports.xml set JUNIT_REPORT_STACK=1 -.\node_modules\.bin\mocha.cmd --reporter mocha-jenkins-reporter src\node\test
\ No newline at end of file +.\node_modules\.bin\mocha.cmd --reporter mocha-jenkins-reporter --timeout 8000 src\node\test
\ No newline at end of file diff --git a/tools/run_tests/run_node.sh b/tools/run_tests/run_node.sh index 40f61d77cc..178584ae8e 100755 --- a/tools/run_tests/run_node.sh +++ b/tools/run_tests/run_node.sh @@ -41,10 +41,13 @@ cd $(dirname $0)/../.. root=`pwd` +test_directory='src/node/test' +timeout=8000 + if [ "$CONFIG" = "gcov" ] then ./node_modules/.bin/istanbul cover --dir reports/node_coverage \ - -x **/interop/* ./node_modules/.bin/_mocha -- --timeout 8000 src/node/test + -x **/interop/* ./node_modules/.bin/_mocha -- --timeout $timeout $test_directory cd build gcov Release/obj.target/grpc/ext/*.o lcov --base-directory . --directory . -c -o coverage.info @@ -55,5 +58,7 @@ then echo '<html><head><meta http-equiv="refresh" content="0;URL=lcov-report/index.html"></head></html>' > \ ../reports/node_coverage/index.html else - JUNIT_REPORT_PATH=src/node/reports.xml JUNIT_REPORT_STACK=1 ./node_modules/.bin/mocha --reporter mocha-jenkins-reporter src/node/test + JUNIT_REPORT_PATH=src/node/reports.xml JUNIT_REPORT_STACK=1 \ + ./node_modules/.bin/mocha --timeout $timeout \ + --reporter mocha-jenkins-reporter $test_directory fi diff --git a/tools/run_tests/run_tests.py b/tools/run_tests/run_tests.py index de3716bc88..0b3efa29e3 100755 --- a/tools/run_tests/run_tests.py +++ b/tools/run_tests/run_tests.py @@ -334,13 +334,14 @@ class RubyLanguage(object): def test_specs(self, config, args): return [config.job_spec(['tools/run_tests/run_ruby.sh'], None, + timeout_seconds=10*60, environ=_FORCE_ENVIRON_FOR_WRAPPERS)] def pre_build_steps(self): return [['tools/run_tests/pre_build_ruby.sh']] def make_targets(self, test_regex): - return ['static_c'] + return [] def make_options(self): return [] @@ -1197,4 +1198,3 @@ else: if BuildAndRunError.POST_TEST in errors: exit_code |= 4 sys.exit(exit_code) - diff --git a/tools/run_tests/sources_and_headers.json b/tools/run_tests/sources_and_headers.json index 5b1b67439d..b22a5a135f 100644 --- a/tools/run_tests/sources_and_headers.json +++ b/tools/run_tests/sources_and_headers.json @@ -92,7 +92,7 @@ "language": "c", "name": "census_log_test", "src": [ - "test/core/census/log_test.c" + "test/core/census/mlog_test.c" ] }, { @@ -2983,7 +2983,7 @@ "include/grpc/status.h", "src/core/census/aggregation.h", "src/core/census/grpc_filter.h", - "src/core/census/log.h", + "src/core/census/mlog.h", "src/core/census/rpc_metric_id.h", "src/core/channel/channel_args.h", "src/core/channel/channel_stack.h", @@ -3135,8 +3135,8 @@ "src/core/census/grpc_filter.c", "src/core/census/grpc_filter.h", "src/core/census/initialize.c", - "src/core/census/log.c", - "src/core/census/log.h", + "src/core/census/mlog.c", + "src/core/census/mlog.h", "src/core/census/operation.c", "src/core/census/placeholders.c", "src/core/census/rpc_metric_id.h", @@ -3420,6 +3420,16 @@ { "deps": [ "gpr", + "grpc" + ], + "headers": [], + "language": "c", + "name": "grpc_dll", + "src": [] + }, + { + "deps": [ + "gpr", "gpr_test_util", "grpc" ], @@ -3514,7 +3524,7 @@ "include/grpc/status.h", "src/core/census/aggregation.h", "src/core/census/grpc_filter.h", - "src/core/census/log.h", + "src/core/census/mlog.h", "src/core/census/rpc_metric_id.h", "src/core/channel/channel_args.h", "src/core/channel/channel_stack.h", @@ -3651,8 +3661,8 @@ "src/core/census/grpc_filter.c", "src/core/census/grpc_filter.h", "src/core/census/initialize.c", - "src/core/census/log.c", - "src/core/census/log.h", + "src/core/census/mlog.c", + "src/core/census/mlog.h", "src/core/census/operation.c", "src/core/census/placeholders.c", "src/core/census/rpc_metric_id.h", @@ -4186,7 +4196,8 @@ "test/cpp/util/cli_call.h", "test/cpp/util/create_test_channel.h", "test/cpp/util/string_ref_helper.h", - "test/cpp/util/subprocess.h" + "test/cpp/util/subprocess.h", + "test/cpp/util/test_credentials_provider.h" ], "language": "c++", "name": "grpc++_test_util", @@ -4202,7 +4213,9 @@ "test/cpp/util/string_ref_helper.cc", "test/cpp/util/string_ref_helper.h", "test/cpp/util/subprocess.cc", - "test/cpp/util/subprocess.h" + "test/cpp/util/subprocess.h", + "test/cpp/util/test_credentials_provider.cc", + "test/cpp/util/test_credentials_provider.h" ] }, { |