Upgrade googletest (#27287)

pull/28886/head
AJ Heller 3 years ago committed by GitHub
parent 8de825ba80
commit 40f2c2a4e1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      bazel/copts.bzl
  2. 9
      bazel/grpc_deps.bzl
  3. 2
      test/cpp/end2end/grpclb_end2end_test.cc
  4. 2
      test/cpp/end2end/rls_end2end_test.cc
  5. 85
      test/cpp/end2end/xds/xds_end2end_test.cc
  6. 2
      test/cpp/util/grpc_tool_test.cc
  7. 5
      test/cpp/util/test_config.h
  8. 2
      third_party/googletest
  9. 2
      tools/run_tests/sanity/check_submodules.sh

@ -54,9 +54,6 @@ GRPC_LLVM_WARNING_FLAGS = [
# Exceptions but will be removed
"-Wno-deprecated-declarations",
"-Wno-unused-function",
# googletest 1.11 or later is needed to have this warning
# https://github.com/google/googletest/commit/1b3eb6ef34620c1203263d76ec169ef0853789cc
"-Wno-deprecated-copy",
]
GRPC_DEFAULT_COPTS = select({

@ -226,12 +226,11 @@ def grpc_deps():
if "com_google_googletest" not in native.existing_rules():
http_archive(
name = "com_google_googletest",
sha256 = "443d383db648ebb8e391382c0ab63263b7091d03197f304390baac10f178a468",
strip_prefix = "googletest-c9ccac7cb7345901884aabf5d1a786cfa6e2f397",
sha256 = "c8de6c60e12ad014a28225c5247ee735861d85cf906df617f6a29954ca05f547",
strip_prefix = "googletest-0e402173c97aea7a00749e825b194bfede4f2e45",
urls = [
# 2019-08-19
"https://storage.googleapis.com/grpc-bazel-mirror/github.com/google/googletest/archive/c9ccac7cb7345901884aabf5d1a786cfa6e2f397.tar.gz",
"https://github.com/google/googletest/archive/c9ccac7cb7345901884aabf5d1a786cfa6e2f397.tar.gz",
# 2022-02-09
"https://github.com/google/googletest/archive/0e402173c97aea7a00749e825b194bfede4f2e45.tar.gz",
],
)

@ -971,7 +971,7 @@ TEST_F(SingleBalancerTest, SecureNaming) {
}
TEST_F(SingleBalancerTest, SecureNamingDeathTest) {
GRPC_GTEST_FLAG_SET_DEATH_TEST_STYLE("threadsafe");
GTEST_FLAG_SET(death_test_style, "threadsafe");
// Make sure that we blow up (via abort() from the security connector) when
// the name from the balancer doesn't match expectations.
ASSERT_DEATH_IF_SUPPORTED(

@ -1442,7 +1442,7 @@ TEST_F(RlsEnd2endTest, ConnectivityStateTransientFailure) {
}
TEST_F(RlsEnd2endTest, RlsAuthorityDeathTest) {
GRPC_GTEST_FLAG_SET_DEATH_TEST_STYLE("threadsafe");
GTEST_FLAG_SET(death_test_style, "threadsafe");
ResetStub("incorrect_authority");
SetNextResolution(
MakeServiceConfigBuilder()

@ -3016,7 +3016,7 @@ TEST_P(SecureNamingTest, TargetNameIsExpected) {
// Tests that secure naming check fails if target name is unexpected.
TEST_P(SecureNamingTest, TargetNameIsUnexpected) {
GRPC_GTEST_FLAG_SET_DEATH_TEST_STYLE("threadsafe");
GTEST_FLAG_SET(death_test_style, "threadsafe");
CreateClientsAndServers(BootstrapBuilder(),
/*lb_expected_authority=*/"incorrect_server_name");
StartAllBackends();
@ -13142,29 +13142,28 @@ TEST_P(ClientStatusDiscoveryServiceTest, XdsConfigDumpVanilla) {
matchers = {
// Listener
EqGenericXdsConfig(
kLdsTypeUrl, kServerName, /*version_info=*/"1",
kLdsTypeUrl, kServerName, "1",
UnpackListener(EqListener(kServerName, api_listener_matcher)),
ClientResourceStatus::ACKED, /*error_state=*/::testing::_),
ClientResourceStatus::ACKED, ::testing::_),
// Cluster
EqGenericXdsConfig(
kCdsTypeUrl, kDefaultClusterName, /*version_info=*/"1",
UnpackCluster(EqCluster(kDefaultClusterName)),
ClientResourceStatus::ACKED, /*error_state=*/::testing::_),
EqGenericXdsConfig(kCdsTypeUrl, kDefaultClusterName, "1",
UnpackCluster(EqCluster(kDefaultClusterName)),
ClientResourceStatus::ACKED, ::testing::_),
// ClusterLoadAssignment
EqGenericXdsConfig(
kEdsTypeUrl, kDefaultEdsServiceName, /*version_info=*/"1",
kEdsTypeUrl, kDefaultEdsServiceName, "1",
UnpackClusterLoadAssignment(EqClusterLoadAssignment(
kDefaultEdsServiceName, backends_[0]->port(),
kDefaultLocalityWeight)),
ClientResourceStatus::ACKED, /*error_state=*/::testing::_),
ClientResourceStatus::ACKED, ::testing::_),
};
// If RDS is enabled, add matcher for RDS resource.
if (GetParam().enable_rds_testing()) {
matchers.push_back(EqGenericXdsConfig(
kRdsTypeUrl, kDefaultRouteConfigurationName, /*version_info=*/"1",
kRdsTypeUrl, kDefaultRouteConfigurationName, "1",
UnpackRouteConfiguration(EqRouteConfiguration(
kDefaultRouteConfigurationName, kDefaultClusterName)),
ClientResourceStatus::ACKED, /*error_state=*/::testing::_));
ClientResourceStatus::ACKED, ::testing::_));
}
// Validate the dumped xDS configs
EXPECT_THAT(client_config.generic_xds_configs(),
@ -13204,7 +13203,7 @@ TEST_P(ClientStatusDiscoveryServiceTest, XdsConfigDumpListenerError) {
bool ok = ::testing::Value(
csds_response.config(0).generic_xds_configs(),
::testing::Contains(EqGenericXdsConfig(
kLdsTypeUrl, kServerName, /*version_info=*/"1",
kLdsTypeUrl, kServerName, "1",
UnpackListener(EqListener(kServerName, api_listener_matcher)),
ClientResourceStatus::NACKED,
EqUpdateFailureState(
@ -13239,7 +13238,7 @@ TEST_P(ClientStatusDiscoveryServiceTest, XdsConfigDumpRouteError) {
ok = ::testing::Value(
csds_response.config(0).generic_xds_configs(),
::testing::Contains(EqGenericXdsConfig(
kRdsTypeUrl, kDefaultRouteConfigurationName, /*version_info=*/"1",
kRdsTypeUrl, kDefaultRouteConfigurationName, "1",
UnpackRouteConfiguration(EqRouteConfiguration(
kDefaultRouteConfigurationName, kDefaultClusterName)),
ClientResourceStatus::NACKED,
@ -13249,7 +13248,7 @@ TEST_P(ClientStatusDiscoveryServiceTest, XdsConfigDumpRouteError) {
ok = ::testing::Value(
csds_response.config(0).generic_xds_configs(),
::testing::Contains(EqGenericXdsConfig(
kLdsTypeUrl, kServerName, /*version_info=*/"1",
kLdsTypeUrl, kServerName, "1",
UnpackListener(EqListener(
kServerName, EqNoRdsHCM(kDefaultRouteConfigurationName,
kDefaultClusterName))),
@ -13283,7 +13282,7 @@ TEST_P(ClientStatusDiscoveryServiceTest, XdsConfigDumpClusterError) {
bool ok = ::testing::Value(
csds_response.config(0).generic_xds_configs(),
::testing::Contains(EqGenericXdsConfig(
kCdsTypeUrl, kDefaultClusterName, /*version_info=*/"1",
kCdsTypeUrl, kDefaultClusterName, "1",
UnpackCluster(EqCluster(kDefaultClusterName)),
ClientResourceStatus::NACKED,
EqUpdateFailureState(
@ -13318,7 +13317,7 @@ TEST_P(ClientStatusDiscoveryServiceTest, XdsConfigDumpEndpointError) {
bool ok = ::testing::Value(
csds_response.config(0).generic_xds_configs(),
::testing::Contains(EqGenericXdsConfig(
kEdsTypeUrl, kDefaultEdsServiceName, /*version_info=*/"1",
kEdsTypeUrl, kDefaultEdsServiceName, "1",
UnpackClusterLoadAssignment(EqClusterLoadAssignment(
kDefaultEdsServiceName, backends_[0]->port(),
kDefaultLocalityWeight)),
@ -13340,11 +13339,10 @@ TEST_P(ClientStatusDiscoveryServiceTest, XdsConfigDumpListenerRequested) {
.set_rpc_options(RpcOptions().set_timeout_ms(kTimeoutMillisecond))
.set_expected_error_code(StatusCode::DEADLINE_EXCEEDED));
auto csds_response = FetchCsdsResponse();
EXPECT_THAT(
csds_response.config(0).generic_xds_configs(),
::testing::Contains(EqGenericXdsConfig(
kLdsTypeUrl, kServerName, /*version_info=*/::testing::_, ::testing::_,
ClientResourceStatus::REQUESTED, /*error_state=*/::testing::_)));
EXPECT_THAT(csds_response.config(0).generic_xds_configs(),
::testing::Contains(EqGenericXdsConfig(
kLdsTypeUrl, kServerName, ::testing::_, ::testing::_,
ClientResourceStatus::REQUESTED, ::testing::_)));
}
TEST_P(ClientStatusDiscoveryServiceTest, XdsConfigDumpClusterRequested) {
@ -13374,13 +13372,11 @@ TEST_P(ClientStatusDiscoveryServiceTest, XdsConfigDumpClusterRequested) {
EXPECT_THAT(csds_response.config(0).generic_xds_configs(),
::testing::AllOf(
::testing::Contains(EqGenericXdsConfig(
kCdsTypeUrl, kClusterName1, /*version_info=*/::testing::_,
::testing::_, ClientResourceStatus::REQUESTED,
/*error_state=*/::testing::_)),
kCdsTypeUrl, kClusterName1, ::testing::_, ::testing::_,
ClientResourceStatus::REQUESTED, ::testing::_)),
::testing::Contains(EqGenericXdsConfig(
kCdsTypeUrl, kClusterName2, /*version_info=*/::testing::_,
::testing::_, ClientResourceStatus::REQUESTED,
/*error_state=*/::testing::_))));
kCdsTypeUrl, kClusterName2, ::testing::_, ::testing::_,
ClientResourceStatus::REQUESTED, ::testing::_))));
}
class CsdsShortAdsTimeoutTest : public ClientStatusDiscoveryServiceTest {
@ -13399,11 +13395,10 @@ TEST_P(CsdsShortAdsTimeoutTest, XdsConfigDumpListenerDoesNotExist) {
.set_rpc_options(RpcOptions().set_timeout_ms(kTimeoutMillisecond))
.set_expected_error_code(grpc::StatusCode::UNAVAILABLE));
auto csds_response = FetchCsdsResponse();
EXPECT_THAT(
csds_response.config(0).generic_xds_configs(),
::testing::Contains(EqGenericXdsConfig(
kLdsTypeUrl, kServerName, /*version_info=*/::testing::_, ::testing::_,
ClientResourceStatus::DOES_NOT_EXIST, /*error_state=*/::testing::_)));
EXPECT_THAT(csds_response.config(0).generic_xds_configs(),
::testing::Contains(EqGenericXdsConfig(
kLdsTypeUrl, kServerName, ::testing::_, ::testing::_,
ClientResourceStatus::DOES_NOT_EXIST, ::testing::_)));
}
TEST_P(CsdsShortAdsTimeoutTest, XdsConfigDumpRouteConfigDoesNotExist) {
@ -13419,9 +13414,8 @@ TEST_P(CsdsShortAdsTimeoutTest, XdsConfigDumpRouteConfigDoesNotExist) {
EXPECT_THAT(
csds_response.config(0).generic_xds_configs(),
::testing::Contains(EqGenericXdsConfig(
kRdsTypeUrl, kDefaultRouteConfigurationName,
/*version_info=*/::testing::_, ::testing::_,
ClientResourceStatus::DOES_NOT_EXIST, /*error_state=*/::testing::_)));
kRdsTypeUrl, kDefaultRouteConfigurationName, ::testing::_,
::testing::_, ClientResourceStatus::DOES_NOT_EXIST, ::testing::_)));
}
TEST_P(CsdsShortAdsTimeoutTest, XdsConfigDumpClusterDoesNotExist) {
@ -13432,12 +13426,10 @@ TEST_P(CsdsShortAdsTimeoutTest, XdsConfigDumpClusterDoesNotExist) {
.set_rpc_options(RpcOptions().set_timeout_ms(kTimeoutMillisecond))
.set_expected_error_code(grpc::StatusCode::UNAVAILABLE));
auto csds_response = FetchCsdsResponse();
EXPECT_THAT(
csds_response.config(0).generic_xds_configs(),
::testing::Contains(EqGenericXdsConfig(
kCdsTypeUrl, kDefaultClusterName, /*version_info=*/::testing::_,
::testing::_, ClientResourceStatus::DOES_NOT_EXIST,
/*error_state=*/::testing::_)));
EXPECT_THAT(csds_response.config(0).generic_xds_configs(),
::testing::Contains(EqGenericXdsConfig(
kCdsTypeUrl, kDefaultClusterName, ::testing::_, ::testing::_,
ClientResourceStatus::DOES_NOT_EXIST, ::testing::_)));
}
TEST_P(CsdsShortAdsTimeoutTest, XdsConfigDumpEndpointDoesNotExist) {
@ -13448,12 +13440,11 @@ TEST_P(CsdsShortAdsTimeoutTest, XdsConfigDumpEndpointDoesNotExist) {
.set_rpc_options(RpcOptions().set_timeout_ms(kTimeoutMillisecond))
.set_expected_error_code(grpc::StatusCode::UNAVAILABLE));
auto csds_response = FetchCsdsResponse();
EXPECT_THAT(csds_response.config(0).generic_xds_configs(),
::testing::Contains(EqGenericXdsConfig(
kEdsTypeUrl, kDefaultEdsServiceName,
/*version_info=*/::testing::_, ::testing::_,
ClientResourceStatus::DOES_NOT_EXIST,
/*error_state=*/::testing::_)));
EXPECT_THAT(
csds_response.config(0).generic_xds_configs(),
::testing::Contains(EqGenericXdsConfig(
kEdsTypeUrl, kDefaultEdsServiceName, ::testing::_, ::testing::_,
ClientResourceStatus::DOES_NOT_EXIST, ::testing::_)));
}
#endif // DISABLED_XDS_PROTO_IN_CC

@ -1349,6 +1349,6 @@ TEST_F(GrpcToolTest, ConfiguringDefaultServiceConfig) {
int main(int argc, char** argv) {
grpc::testing::TestEnvironment env(argc, argv);
::testing::InitGoogleTest(&argc, argv);
GRPC_GTEST_FLAG_SET_DEATH_TEST_STYLE("threadsafe");
GTEST_FLAG_SET(death_test_style, "threadsafe");
return RUN_ALL_TESTS();
}

@ -19,11 +19,6 @@
#ifndef GRPC_TEST_CPP_UTIL_TEST_CONFIG_H
#define GRPC_TEST_CPP_UTIL_TEST_CONFIG_H
#ifndef GRPC_GTEST_FLAG_SET_DEATH_TEST_STYLE
#define GRPC_GTEST_FLAG_SET_DEATH_TEST_STYLE(style) \
::testing::FLAGS_gtest_death_test_style = style
#endif // GRPC_GTEST_FLAG_SET_DEATH_TEST_STYLE
namespace grpc {
namespace testing {

@ -1 +1 @@
Subproject commit c9ccac7cb7345901884aabf5d1a786cfa6e2f397
Subproject commit 0e402173c97aea7a00749e825b194bfede4f2e45

@ -32,7 +32,7 @@ third_party/boringssl-with-bazel b9232f9e27e5668bc0414879dcdedb2a59ea75f2
third_party/cares/cares 6654436a307a5a686b008c1d4c93b0085da6e6d8
third_party/envoy-api ff47e0a4bd03c0580305f9b138cc7937b63f7900
third_party/googleapis 2f9af297c84c55c8b871ba4495e01ade42476c92
third_party/googletest c9ccac7cb7345901884aabf5d1a786cfa6e2f397
third_party/googletest 0e402173c97aea7a00749e825b194bfede4f2e45
third_party/libuv 02a9e1be252b623ee032a3137c0b0c94afbe6809
third_party/opencensus-proto 4aa53e15cbf1a47bc9087e6cfdca214c1eea4e89
third_party/opentelemetry 60fa8754d890b5c55949a8c68dcfd7ab5c2395df

Loading…
Cancel
Save