default GRPC_IOS_EVENT_ENGINE_CLIENT to 1

pull/36785/head
Hannah Shi 6 months ago
parent 51d1d7ca1b
commit 441fe552a6
  1. 3
      include/grpc/support/port_platform.h
  2. 2
      src/core/lib/event_engine/shim.cc
  3. 2
      src/core/resolver/dns/dns_resolver_plugin.cc
  4. 2
      src/objective-c/tests/BUILD
  5. 1
      test/core/event_engine/test_suite/BUILD
  6. 8
      test/core/event_engine/test_suite/tests/dns_test.cc
  7. 1
      test/core/iomgr/ios/CFStreamTests/Podfile
  8. 1
      test/core/iomgr/ios/CFStreamTests/build_and_run_tests.sh
  9. 2
      tools/internal_ci/macos/grpc_objc_bazel_test.sh

@ -272,6 +272,9 @@
#define GPR_PLATFORM_STRING "ios"
#define GPR_CPU_IPHONE 1
#define GRPC_CFSTREAM 1
#ifndef GRPC_IOS_EVENT_ENGINE_CLIENT
#define GRPC_IOS_EVENT_ENGINE_CLIENT 1
#endif /* GRPC_IOS_EVENT_ENGINE_CLIENT */
/* the c-ares resolver isn't safe to enable on iOS */
#define GRPC_ARES 0
#else /* TARGET_OS_IPHONE */

@ -30,7 +30,7 @@ bool UseEventEngineClient() {
return grpc_core::IsEventEngineClientEnabled();
#elif defined(GPR_WINDOWS) && !defined(GRPC_DO_NOT_INSTANTIATE_POSIX_POLLER)
return grpc_core::IsEventEngineClientEnabled();
#elif defined(GRPC_IOS_EVENT_ENGINE_CLIENT)
#elif GRPC_IOS_EVENT_ENGINE_CLIENT
return true;
#else
return false;

@ -32,7 +32,7 @@
namespace grpc_core {
void RegisterDnsResolver(CoreConfiguration::Builder* builder) {
#ifdef GRPC_IOS_EVENT_ENGINE_CLIENT
#if GRPC_IOS_EVENT_ENGINE_CLIENT
VLOG(2) << "Using EventEngine dns resolver";
builder->resolver_registry()->RegisterResolverFactory(
std::make_unique<EventEngineClientChannelDNSResolverFactory>());

@ -336,7 +336,6 @@ grpc_objc_ios_unit_test(
grpc_objc_testing_library(
name = "EventEngineClientTests-lib",
srcs = ["EventEngineTests/CFEventEngineClientTests.mm"],
# defines = ["GRPC_IOS_EVENT_ENGINE_CLIENT=1"],
deps = [
"//src/core:cf_event_engine",
"//test/core/event_engine/test_suite/posix:oracle_event_engine_posix",
@ -347,7 +346,6 @@ grpc_objc_testing_library(
grpc_objc_testing_library(
name = "EventEngineUnitTests-lib",
srcs = ["EventEngineTests/CFEventEngineUnitTests.mm"],
defines = ["GRPC_IOS_EVENT_ENGINE_CLIENT=1"],
deps = [
"//src/core:cf_event_engine",
"//test/core/event_engine/cf:cf_engine_unit_test_lib",

@ -118,7 +118,6 @@ grpc_cc_test(
grpc_cc_test(
name = "cf_event_engine_test",
srcs = ["cf_event_engine_test.cc"],
copts = ["-DGRPC_IOS_EVENT_ENGINE_CLIENT=1"],
tags = [
"no_linux",
"no_windows",

@ -111,7 +111,7 @@ MATCHER(StatusCodeEq, "") {
class EventEngineDNSTest : public EventEngineTest {
protected:
static void SetUpTestSuite() {
#ifndef GRPC_IOS_EVENT_ENGINE_CLIENT
#if !GRPC_IOS_EVENT_ENGINE_CLIENT
std::string test_records_path = kDNSTestRecordGroupsYamlPath;
std::string dns_server_path = kDNSServerRelPath;
std::string dns_resolver_path = kDNSResolverRelPath;
@ -182,7 +182,7 @@ class EventEngineDNSTest : public EventEngineTest {
}
static void TearDownTestSuite() {
#ifndef GRPC_IOS_EVENT_ENGINE_CLIENT
#if !GRPC_IOS_EVENT_ENGINE_CLIENT
dns_server_.server_process->Interrupt();
dns_server_.server_process->Join();
delete dns_server_.server_process;
@ -233,7 +233,7 @@ class EventEngineDNSTest : public EventEngineTest {
EventEngineDNSTest::DNSServer EventEngineDNSTest::dns_server_;
// TODO(hork): implement XFAIL for resolvers that don't support TXT or SRV
#ifndef GRPC_IOS_EVENT_ENGINE_CLIENT
#if !GRPC_IOS_EVENT_ENGINE_CLIENT
TEST_F(EventEngineDNSTest, QueryNXHostname) {
SKIP_TEST_FOR_NATIVE_DNS_RESOLVER();
@ -434,7 +434,7 @@ TEST_F(EventEngineDNSTest, LocalHost) {
auto dns_resolver = CreateDNSResolverWithoutSpecifyingServer();
dns_resolver->LookupHostname(
[this](auto result) {
#ifdef GRPC_IOS_EVENT_ENGINE_CLIENT
#if GRPC_IOS_EVENT_ENGINE_CLIENT
EXPECT_SUCCESS();
#else
EXPECT_TRUE(result.ok());

@ -29,6 +29,7 @@ post_install do |installer|
config.build_settings['GCC_WARN_ABOUT_RETURN_TYPE'] = 'NO'
# Abseil isn't free from the following warning
config.build_settings['GCC_WARN_64_TO_32_BIT_CONVERSION'] = 'NO'
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] = '$(inherited) GRPC_IOS_EVENT_ENGINE_CLIENT=0'
end
end
end

@ -25,6 +25,7 @@ XCODEBUILD_FILTER_OUTPUT_SCRIPT="../../../../../src/objective-c/tests/xcodebuild
XCODEBUILD_FLAGS="
IPHONEOS_DEPLOYMENT_TARGET=10
GCC_PREPROCESSOR_DEFINITIONS='DGRPC_IOS_EVENT_ENGINE_CLIENT=0'
"
XCODEBUILD_DESTINATION="platform=iOS Simulator,name=iPhone 11"

@ -116,6 +116,7 @@ objc_bazel_tests/bazel_wrapper \
--google_credentials="${KOKORO_GFILE_DIR}/GrpcTesting-d0eeee2db331.json" \
"${BAZEL_REMOTE_CACHE_ARGS[@]}" \
$BAZEL_FLAGS \
--cxxopt=-DGRPC_IOS_EVENT_ENGINE_CLIENT=0 \
"${OBJC_TEST_ENV_ARGS[@]}" \
-- \
"${EXAMPLE_TARGETS[@]}" \
@ -141,7 +142,6 @@ objc_event_engine_bazel_tests/bazel_wrapper \
--google_credentials="${KOKORO_GFILE_DIR}/GrpcTesting-d0eeee2db331.json" \
"${BAZEL_REMOTE_CACHE_ARGS[@]}" \
$BAZEL_FLAGS \
--cxxopt=-DGRPC_IOS_EVENT_ENGINE_CLIENT=1 \
--test_env=GRPC_EXPERIMENTS=event_engine_client \
--test_env=GRPC_VERBOSITY=debug --test_env=GRPC_TRACE=event_engine,api \
"${OBJC_TEST_ENV_ARGS[@]}" \

Loading…
Cancel
Save