Skip to content

Commit 389511a

Browse files
committed
deps: bump up googletest to v1.17.0
Signed-off-by: Rohit Agrawal <[email protected]>
1 parent ffac11b commit 389511a

13 files changed

+34
-45
lines changed

bazel/googletest.patch

-13
This file was deleted.

bazel/repositories.bzl

+2-3
Original file line numberDiff line numberDiff line change
@@ -571,9 +571,8 @@ def _com_github_ncopa_suexec():
571571

572572
def _com_google_googletest():
573573
external_http_archive(
574-
"com_google_googletest",
575-
patches = ["@envoy//bazel:googletest.patch"],
576-
patch_args = ["-p1"],
574+
name = "com_google_googletest",
575+
repo_mapping = {"@abseil-cpp": "@com_google_absl", "@re2": "@com_googlesource_code_re2"},
577576
)
578577

579578
# TODO(jmarantz): replace the use of bind and external_deps with just

bazel/repository_locations.bzl

+4-6
Original file line numberDiff line numberDiff line change
@@ -910,13 +910,11 @@ REPOSITORY_LOCATIONS_SPEC = dict(
910910
project_name = "Google Test",
911911
project_desc = "Google's C++ test framework",
912912
project_url = "https://github.com/google/googletest",
913-
# Pick up fix for MOCK_METHOD compilation with clang-cl for Windows (resolved after 1.10.0)
914-
# see https://github.com/google/googletest/issues/2490
915-
version = "a4ab0abb93620ce26efad9de9296b73b16e88588",
916-
sha256 = "7897bfaa5ad39a479177cfb5c3ce010184dbaee22a7c3727b212282871918751",
913+
version = "1.17.0",
914+
sha256 = "65fab701d9829d38cb77c14acdc431d2108bfdbf8979e40eb8ae567edf10b27c",
917915
strip_prefix = "googletest-{version}",
918-
urls = ["https://github.com/google/googletest/archive/{version}.tar.gz"],
919-
release_date = "2020-09-10",
916+
urls = ["https://github.com/google/googletest/releases/download/v{version}/googletest-{version}.tar.gz"],
917+
release_date = "2025-04-30",
920918
use_category = ["test_only"],
921919
cpe = "cpe:2.3:a:google:google_test:*",
922920
license = "BSD-3-Clause",

test/common/http/header_mutation_test.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ TEST(HeaderMutationTest, Death) {
276276
ProtoHeaderMutatons proto_mutations;
277277
proto_mutations.Add();
278278

279-
EXPECT_DEATH(HeaderMutations::create(proto_mutations).IgnoreError(), "unset oneof");
279+
EXPECT_DEATH(HeaderMutations::create(proto_mutations).IgnoreError(), ".*unset oneof.*");
280280
}
281281

282282
} // namespace

test/common/quic/envoy_quic_proof_verifier_test.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@ TEST_F(EnvoyQuicProofVerifierTest, VerifyProof) {
446446
configCertVerificationDetails(true);
447447
EXPECT_DEATH(verifier_->VerifyProof("", 0, "", quic::QUIC_VERSION_IETF_RFC_V1, "", {}, "", "",
448448
nullptr, nullptr, nullptr, {}),
449-
"not implemented");
449+
".*not implemented.*");
450450
}
451451

452452
TEST_F(EnvoyQuicProofVerifierTest, CreateDefaultContext) {

test/common/quic/quic_filter_manager_connection_impl_test.cc

+3-4
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ TEST_F(QuicFilterManagerConnectionImplTest, RawWrite) {
114114
}
115115

116116
TEST_F(QuicFilterManagerConnectionImplTest, BufferLimit) {
117-
EXPECT_DEATH(impl_.bufferLimit(), "not implemented");
117+
EXPECT_DEATH(impl_.bufferLimit(), ".*not implemented.*");
118118
}
119119

120120
TEST_F(QuicFilterManagerConnectionImplTest, SetBufferLimits) {
@@ -127,12 +127,11 @@ TEST_F(QuicFilterManagerConnectionImplTest, CloseConnection) {
127127
}
128128

129129
TEST_F(QuicFilterManagerConnectionImplTest, GetWriteBuffer) {
130-
EXPECT_DEATH(impl_.getWriteBuffer(), "not implemented");
130+
EXPECT_DEATH(impl_.getWriteBuffer(), ".*not implemented.*");
131131
}
132132

133133
TEST_F(QuicFilterManagerConnectionImplTest, EnableHalfClose) {
134-
impl_.enableHalfClose(false); // No-op
135-
EXPECT_DEATH(impl_.enableHalfClose(true), "Quic connection doesn't support half close.");
134+
EXPECT_DEATH(impl_.enableHalfClose(true), ".*Quic connection doesn't support half close.*");
136135
}
137136

138137
TEST_F(QuicFilterManagerConnectionImplTest, IsHalfCloseEnabled) {

test/common/runtime/BUILD

+2
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ envoy_cc_test(
6666
args = [
6767
"--runtime-feature-override-for-tests=envoy.reloadable_features.test_feature_false",
6868
"--runtime-feature-disable-for-tests=envoy.reloadable_features.test_feature_true",
69+
"--envoy_reloadable_features_test_feature_false=true",
70+
"--envoy_reloadable_features_test_feature_true=false",
6971
],
7072
coverage = False,
7173
rbe_pool = "6gig",

test/extensions/filters/http/kill_request/kill_request_filter_test.cc

+4-4
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ TEST_F(KillRequestFilterTest, KillRequestCrashEnvoy) {
4747

4848
ON_CALL(random_generator_, random()).WillByDefault(Return(0));
4949
EXPECT_DEATH(filter_->decodeHeaders(request_headers_, false),
50-
"KillRequestFilter is crashing Envoy!!!");
50+
".*KillRequestFilter is crashing Envoy!!!.*");
5151
}
5252

5353
TEST_F(KillRequestFilterTest, KillRequestCrashEnvoyWithCustomKillHeader) {
@@ -59,7 +59,7 @@ TEST_F(KillRequestFilterTest, KillRequestCrashEnvoyWithCustomKillHeader) {
5959

6060
ON_CALL(random_generator_, random()).WillByDefault(Return(0));
6161
EXPECT_DEATH(filter_->decodeHeaders(request_headers_, false),
62-
"KillRequestFilter is crashing Envoy!!!");
62+
".*KillRequestFilter is crashing Envoy!!!.*");
6363
}
6464

6565
TEST_F(KillRequestFilterTest, KillRequestWithMillionDenominatorCrashEnvoy) {
@@ -183,7 +183,7 @@ TEST_F(KillRequestFilterTest, CanKillOnResponse) {
183183
ON_CALL(random_generator_, random()).WillByDefault(Return(0));
184184
response_headers_.addCopy("x-envoy-kill-request", "true");
185185
EXPECT_DEATH(filter_->encodeHeaders(response_headers_, false),
186-
"KillRequestFilter is crashing Envoy!!!");
186+
".*KillRequestFilter is crashing Envoy!!!.*");
187187
}
188188

189189
TEST_F(KillRequestFilterTest, KillsBasedOnDirection) {
@@ -201,7 +201,7 @@ TEST_F(KillRequestFilterTest, KillsBasedOnDirection) {
201201
ON_CALL(random_generator_, random()).WillByDefault(Return(0));
202202
response_headers_.addCopy("x-envoy-kill-request", "true");
203203
EXPECT_DEATH(filter_->encodeHeaders(response_headers_, false),
204-
"KillRequestFilter is crashing Envoy!!!");
204+
".*KillRequestFilter is crashing Envoy!!!.*");
205205
}
206206

207207
TEST_F(KillRequestFilterTest, PerRouteKillSettingFound) {

test/extensions/matching/input_matchers/cel_matcher/cel_matcher_test.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -562,7 +562,7 @@ TEST_F(CelMatcherTest, CelMatcherRequestResponseNotMatchedWithParsedExprUseCel)
562562

563563
TEST_F(CelMatcherTest, NoCelExpression) {
564564
EXPECT_DEATH(buildMatcherTree(RequestHeaderCelExprString, ExpressionType::NoExpression),
565-
".*panic: unset oneof.*");
565+
".*unset oneof.*");
566566
}
567567

568568
} // namespace CelMatcher

test/fuzz/fuzz_runner.cc

+4-3
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,10 @@ void runCleanupHooks() {
8585
// LLVMFuzzerInitialize() is called by LibFuzzer once before fuzzing starts.
8686
// NOLINTNEXTLINE(readability-identifier-naming)
8787
extern "C" int LLVMFuzzerInitialize(int* argc, char*** argv) {
88-
// Before parsing gmock flags, set the default value of flag --gmock_verbose to "error".
89-
// This suppresses logs from NiceMock objects, which can be noisy and provide little value.
90-
testing::GMOCK_FLAG(verbose) = "error";
88+
// Set Google Test/Google Mock verbosity to error level to suppress noisy NiceMock logs
89+
char* new_argv[] = {(*argv)[0], const_cast<char*>("--gtest_verbose=error")};
90+
*argv = new_argv;
91+
*argc = 2;
9192
testing::InitGoogleMock(argc, *argv);
9293
Envoy::Fuzz::Runner::setupEnvironment(1, *argv, spdlog::level::critical);
9394
atexit(Envoy::Fuzz::runCleanupHooks);

test/integration/tcp_proxy_odcds_integration_test.cc

+5-5
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ TEST_P(TcpProxyOdcdsIntegrationTest, SingleTcpClient) {
163163
ASSERT_TRUE(fake_upstream_connection->waitForDisconnect());
164164
tcp_client->waitForHalfClose();
165165
tcp_client->close();
166-
assertOnDemandCounters(1, 0, 0);
166+
EXPECT_TRUE(assertOnDemandCounters(1, 0, 0));
167167
}
168168

169169
// Verify only one delta xds response is needed for multiple tcp_proxy requests.
@@ -249,7 +249,7 @@ TEST_P(TcpProxyOdcdsIntegrationTest, ShutdownConnectionOnTimeout) {
249249

250250
tcp_client->waitForHalfClose();
251251
tcp_client->close();
252-
assertOnDemandCounters(0, 0, 1);
252+
EXPECT_TRUE(assertOnDemandCounters(0, 0, 1));
253253
}
254254

255255
TEST_P(TcpProxyOdcdsIntegrationTest, ShutdownConnectionOnClusterMissing) {
@@ -277,7 +277,7 @@ TEST_P(TcpProxyOdcdsIntegrationTest, ShutdownConnectionOnClusterMissing) {
277277

278278
tcp_client->waitForHalfClose();
279279
tcp_client->close();
280-
assertOnDemandCounters(0, 1, 0);
280+
EXPECT_TRUE(assertOnDemandCounters(0, 1, 0));
281281
}
282282

283283
TEST_P(TcpProxyOdcdsIntegrationTest, ShutdownAllConnectionsOnClusterLookupTimeout) {
@@ -306,7 +306,7 @@ TEST_P(TcpProxyOdcdsIntegrationTest, ShutdownAllConnectionsOnClusterLookupTimeou
306306

307307
tcp_client_1->waitForHalfClose(true);
308308
tcp_client_2->waitForHalfClose(true);
309-
assertOnDemandCounters(0, 0, 2);
309+
EXPECT_TRUE(assertOnDemandCounters(0, 0, 2));
310310
tcp_client_1->close();
311311
tcp_client_2->close();
312312
}
@@ -331,7 +331,7 @@ TEST_P(TcpProxyOdcdsIntegrationTest, ShutdownTcpClientBeforeOdcdsResponse) {
331331
EXPECT_EQ(1, test_server_->counter("tcp.tcpproxy_stats.on_demand_cluster_attempt")->value());
332332
// Client disconnect when the tcp proxy is waiting for the on demand response.
333333
tcp_client->close();
334-
assertOnDemandCounters(0, 0, 0);
334+
EXPECT_TRUE(assertOnDemandCounters(0, 0, 0));
335335
}
336336

337337
} // namespace

test/test_common/test_random_generator.cc

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#include "test/test_common/test_random_generator.h"
22

3+
#include "absl/flags/flag.h"
34
#include "gtest/gtest.h"
4-
5-
using testing::GTEST_FLAG(random_seed);
5+
#include "gtest/internal/gtest-port.h" // for GTEST_FLAG_GET
66

77
namespace Envoy {
88

@@ -16,7 +16,8 @@ int32_t getSeed() {
1616
}
1717

1818
TestRandomGenerator::TestRandomGenerator()
19-
: seed_(GTEST_FLAG(random_seed) == 0 ? getSeed() : GTEST_FLAG(random_seed)), generator_(seed_) {
19+
: seed_(GTEST_FLAG_GET(random_seed) == 0 ? getSeed() : GTEST_FLAG_GET(random_seed)),
20+
generator_(seed_) {
2021
ENVOY_LOG_MISC(info, "TestRandomGenerator running with seed {}", seed_);
2122
}
2223

test/test_runner.cc

+3-1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
#include "test/test_listener.h"
1616

1717
#include "gmock/gmock.h"
18+
#include "gtest/gtest.h"
19+
#include "gtest/internal/gtest-port.h" // for GTEST_FLAG_SET
1820

1921
namespace Envoy {
2022

@@ -90,7 +92,7 @@ int TestRunner::runTests(int argc, char** argv) {
9092

9193
// Use the recommended, but not default, "threadsafe" style for the Death Tests.
9294
// See: https://github.com/google/googletest/commit/84ec2e0365d791e4ebc7ec249f09078fb5ab6caa
93-
::testing::FLAGS_gtest_death_test_style = "threadsafe";
95+
GTEST_FLAG_SET(death_test_style, "threadsafe");
9496

9597
// Set gtest properties
9698
// (https://github.com/google/googletest/blob/master/googletest/docs/advanced.md#logging-additional-information),

0 commit comments

Comments
 (0)