Switching to ios test runner for unit tests (#29740)

pull/29880/head^2
Denny C. Dai 3 years ago committed by GitHub
parent 3e8054cb3a
commit 689f404d18
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 37
      src/objective-c/grpc_objc_internal_library.bzl
  2. 5
      src/objective-c/tests/BUILD

@ -31,6 +31,43 @@ load(
"generate_objc_non_arc_srcs",
"generate_objc_srcs",
)
load("@build_bazel_rules_apple//apple:ios.bzl", "ios_unit_test")
load(
"@build_bazel_rules_apple//apple/testing/default_runner:ios_test_runner.bzl",
"ios_test_runner",
)
# The default device type for ios objc unit tests
IOS_UNIT_TEST_DEVICE_TYPE = "iPhone 11"
# The default iOS version for ios objc unit tests
# IOS_UNIT_TEST_OS_VERSION = "13.3"
def grpc_objc_ios_unit_test(
name,
deps,
env = {}):
"""ios unit test for running objc test suite on iOS simulator runner
Args:
name: The name of the unit test target.
deps: The dependencies of the target.
env: Optional test environment variables passed to the test
"""
test_runner = "grpc_ios_sim_runner_" + name
ios_test_runner(
name = test_runner,
device_type = IOS_UNIT_TEST_DEVICE_TYPE,
# os_version = IOS_UNIT_TEST_OS_VERSION,
test_environment = env,
)
ios_unit_test(
name = name,
minimum_os_version = "9.0",
runner = test_runner,
deps = deps,
)
def proto_library_objc_wrapper(
name,

@ -17,6 +17,7 @@
load("//bazel:grpc_build_system.bzl", "grpc_sh_test")
load(
"//src/objective-c:grpc_objc_internal_library.bzl",
"grpc_objc_ios_unit_test",
"grpc_objc_testing_library",
"local_objc_grpc_library",
"proto_library_objc_wrapper",
@ -183,10 +184,8 @@ grpc_objc_testing_library(
hdrs = ["MacTests/StressTests.h"],
)
ios_unit_test(
grpc_objc_ios_unit_test(
name = "UnitTests",
minimum_os_version = "9.0",
test_host = ":ios-host",
deps = [
":APIv2Tests-lib",
":ChannelPoolTest-lib",

Loading…
Cancel
Save