Merge pull request #19410 from muxi/fix-run-tests

Fix ObjC test failures in Kokoro
pull/19425/head
Muxi Yan 6 years ago committed by GitHub
commit 559e328799
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      src/objective-c/tests/UnitTests/GRPCClientTests.m
  2. 12
      src/objective-c/tests/run_one_test.sh
  3. 55
      tools/run_tests/run_tests.py

@ -37,10 +37,14 @@
#define TEST_TIMEOUT 16 #define TEST_TIMEOUT 16
static NSString *const kHostAddress = @"localhost:5050"; // The server address is derived from preprocessor macro, which is
// in turn derived from environment variable of the same name.
#define NSStringize_helper(x) #x
#define NSStringize(x) @NSStringize_helper(x)
static NSString *const kHostAddress = NSStringize(HOST_PORT_LOCAL);
static NSString *const kPackage = @"grpc.testing"; static NSString *const kPackage = @"grpc.testing";
static NSString *const kService = @"TestService"; static NSString *const kService = @"TestService";
static NSString *const kRemoteSSLHost = @"grpc-test.sandbox.googleapis.com"; static NSString *const kRemoteSSLHost = NSStringize(HOST_PORT_REMOTE);
static GRPCProtoMethod *kInexistentMethod; static GRPCProtoMethod *kInexistentMethod;
static GRPCProtoMethod *kEmptyCallMethod; static GRPCProtoMethod *kEmptyCallMethod;

@ -45,10 +45,18 @@ set -o pipefail
XCODEBUILD_FILTER='(^CompileC |^Ld |^ *[^ ]*clang |^ *cd |^ *export |^Libtool |^ *[^ ]*libtool |^CpHeader |^ *builtin-copy )' XCODEBUILD_FILTER='(^CompileC |^Ld |^ *[^ ]*clang |^ *cd |^ *export |^Libtool |^ *[^ ]*libtool |^CpHeader |^ *builtin-copy )'
if [ -z $PLATFORM ]; then
DESTINATION='name=iPhone 8'
elif [ $PLATFORM == ios ]; then
DESTINATION='name=iPhone 8'
elif [ $PLATFORM == macos ]; then
DESTINATION='platform=macOS'
fi
xcodebuild \ xcodebuild \
-workspace Tests.xcworkspace \ -workspace Tests.xcworkspace \
-scheme SCHEME \ -scheme $SCHEME \
-destination name="iPhone 8" \ -destination "$DESTINATION" \
HOST_PORT_LOCALSSL=localhost:$TLS_PORT \ HOST_PORT_LOCALSSL=localhost:$TLS_PORT \
HOST_PORT_LOCAL=localhost:$PLAIN_PORT \ HOST_PORT_LOCAL=localhost:$PLAIN_PORT \
HOST_PORT_REMOTE=grpc-test.sandbox.googleapis.com \ HOST_PORT_REMOTE=grpc-test.sandbox.googleapis.com \

@ -1058,8 +1058,8 @@ class ObjCLanguage(object):
def test_specs(self): def test_specs(self):
out = [] out = []
if self.config == 'dbg': out.append(
out += self.config.job_spec( self.config.job_spec(
['src/objective-c/tests/build_one_example.sh'], ['src/objective-c/tests/build_one_example.sh'],
timeout_seconds=10 * 60, timeout_seconds=10 * 60,
shortname='ios-buildtest-example-sample', shortname='ios-buildtest-example-sample',
@ -1067,8 +1067,9 @@ class ObjCLanguage(object):
environ={ environ={
'SCHEME': 'Sample', 'SCHEME': 'Sample',
'EXAMPLE_PATH': 'src/objective-c/examples/Sample' 'EXAMPLE_PATH': 'src/objective-c/examples/Sample'
}) }))
out += job_spec( out.append(
self.config.job_spec(
['src/objective-c/tests/build_one_example.sh'], ['src/objective-c/tests/build_one_example.sh'],
timeout_seconds=10 * 60, timeout_seconds=10 * 60,
shortname='ios-buildtest-example-sample-frameworks', shortname='ios-buildtest-example-sample-frameworks',
@ -1077,8 +1078,9 @@ class ObjCLanguage(object):
'SCHEME': 'Sample', 'SCHEME': 'Sample',
'EXAMPLE_PATH': 'src/objective-c/examples/Sample', 'EXAMPLE_PATH': 'src/objective-c/examples/Sample',
'FRAMEWORKS': 'YES' 'FRAMEWORKS': 'YES'
}) }))
out += self.config.job_spec( out.append(
self.config.job_spec(
['src/objective-c/tests/build_one_example.sh'], ['src/objective-c/tests/build_one_example.sh'],
timeout_seconds=10 * 60, timeout_seconds=10 * 60,
shortname='ios-buildtest-example-switftsample', shortname='ios-buildtest-example-switftsample',
@ -1086,51 +1088,58 @@ class ObjCLanguage(object):
environ={ environ={
'SCHEME': 'SwiftSample', 'SCHEME': 'SwiftSample',
'EXAMPLE_PATH': 'src/objective-c/examples/SwiftSample' 'EXAMPLE_PATH': 'src/objective-c/examples/SwiftSample'
}) }))
out += self.config.job_spec( out.append(
self.config.job_spec(
['src/objective-c/tests/run_plugin_tests.sh'], ['src/objective-c/tests/run_plugin_tests.sh'],
timeout_seconds=60 * 60, timeout_seconds=60 * 60,
shortname='ios-test-plugintest', shortname='ios-test-plugintest',
cpu_cost=1e6, cpu_cost=1e6,
environ=_FORCE_ENVIRON_FOR_WRAPPERS) environ=_FORCE_ENVIRON_FOR_WRAPPERS))
out += self.config.job_spec( out.append(
self.config.job_spec(
['test/core/iomgr/ios/CFStreamTests/run_tests.sh'], ['test/core/iomgr/ios/CFStreamTests/run_tests.sh'],
timeout_seconds=20 * 60, timeout_seconds=20 * 60,
shortname='ios-test-cfstream-tests', shortname='ios-test-cfstream-tests',
cpu_cost=1e6, cpu_cost=1e6,
environ=_FORCE_ENVIRON_FOR_WRAPPERS) environ=_FORCE_ENVIRON_FOR_WRAPPERS))
out += self.config.job_spec( out.append(
self.config.job_spec(
['src/objective-c/tests/run_one_test.sh'], ['src/objective-c/tests/run_one_test.sh'],
timeout_seconds=60 * 60, timeout_seconds=60 * 60,
shortname='ios-test-unittests', shortname='ios-test-unittests',
cpu_cost=1e6, cpu_cost=1e6,
environ={ environ={
SCHEME: 'UnitTests' 'SCHEME': 'UnitTests'
}) }))
out += self.config.job_spec( out.append(
self.config.job_spec(
['src/objective-c/tests/run_one_test.sh'], ['src/objective-c/tests/run_one_test.sh'],
timeout_seconds=60 * 60, timeout_seconds=60 * 60,
shortname='ios-test-interoptests', shortname='ios-test-interoptests',
cpu_cost=1e6, cpu_cost=1e6,
environ={ environ={
SCHEME: 'InteropTests' 'SCHEME': 'InteropTests'
}) }))
out += self.config.job_spec( out.append(
self.config.job_spec(
['src/objective-c/tests/run_one_test.sh'], ['src/objective-c/tests/run_one_test.sh'],
timeout_seconds=60 * 60, timeout_seconds=60 * 60,
shortname='ios-test-cronettests', shortname='ios-test-cronettests',
cpu_cost=1e6, cpu_cost=1e6,
environ={ environ={
SCHEME: 'CronetTests' 'SCHEME': 'CronetTests'
}) }))
out += self.config.job_spec( out.append(
self.config.job_spec(
['src/objective-c/tests/run_one_test.sh'], ['src/objective-c/tests/run_one_test.sh'],
timeout_seconds=60 * 60, timeout_seconds=60 * 60,
shortname='mac-test-basictests', shortname='mac-test-basictests',
cpu_cost=1e6, cpu_cost=1e6,
environ={ environ={
SCHEME: 'MacTests' 'SCHEME': 'MacTests',
}) 'PLATFORM': 'macos'
}))
return sorted(out) return sorted(out)

Loading…
Cancel
Save