Skip to content

Commit 7a96e62

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

16 files changed

+2998
-2906
lines changed

bazel/googletest.patch

+38-8
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,43 @@
1+
From b217f1131adb21e2c1193782d2659ae03840659a Mon Sep 17 00:00:00 2001
2+
From: Rohit Agrawal <[email protected]>
3+
Date: Sat, 3 May 2025 00:29:17 +0900
4+
Subject: [PATCH] Bazel Fixes
5+
6+
---
7+
BUILD.bazel | 17 -----------------
8+
1 file changed, 17 deletions(-)
9+
110
diff --git a/BUILD.bazel b/BUILD.bazel
2-
index 8099642a85..3598661079 100644
11+
index 53501454ce..fff6e491e7 100644
312
--- a/BUILD.bazel
413
+++ b/BUILD.bazel
5-
@@ -40,7 +40,7 @@ exports_files(["LICENSE"])
6-
7-
config_setting(
8-
name = "windows",
9-
- constraint_values = ["@bazel_tools//platforms:windows"],
10-
+ constraint_values = ["@platforms//os:windows"],
14+
@@ -56,12 +56,6 @@ config_setting(
15+
constraint_values = ["@platforms//os:openbsd"],
1116
)
12-
17+
18+
-# NOTE: Fuchsia is not an officially supported platform.
19+
-config_setting(
20+
- name = "fuchsia",
21+
- constraint_values = ["@platforms//os:fuchsia"],
22+
-)
23+
-
1324
config_setting(
25+
name = "msvc_compiler",
26+
flag_values = {
27+
@@ -157,17 +151,6 @@ cc_library(
28+
"@re2//:re2",
29+
],
30+
"//conditions:default": [],
31+
- }) + select({
32+
- # `gtest-death-test.cc` has `EXPECT_DEATH` that spawns a process,
33+
- # expects it to crash and inspects its logs with the given matcher,
34+
- # so that's why these libraries are needed.
35+
- # Otherwise, builds targeting Fuchsia would fail to compile.
36+
- ":fuchsia": [
37+
- "@fuchsia_sdk//pkg/fdio",
38+
- "@fuchsia_sdk//pkg/syslog",
39+
- "@fuchsia_sdk//pkg/zx",
40+
- ],
41+
- "//conditions:default": [],
42+
}),
43+
)

bazel/repositories.bzl

+4
Original file line numberDiff line numberDiff line change
@@ -583,6 +583,10 @@ def _com_google_googletest():
583583
"com_google_googletest",
584584
patches = ["@envoy//bazel:googletest.patch"],
585585
patch_args = ["-p1"],
586+
repo_mapping = {
587+
"@abseil-cpp": "@com_google_absl",
588+
"@re2": "@com_googlesource_code_re2",
589+
},
586590
)
587591

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

bazel/repository_locations.bzl

+3-3
Original file line numberDiff line numberDiff line change
@@ -931,11 +931,11 @@ REPOSITORY_LOCATIONS_SPEC = dict(
931931
project_url = "https://github.com/google/googletest",
932932
# Pick up fix for MOCK_METHOD compilation with clang-cl for Windows (resolved after 1.10.0)
933933
# see https://github.com/google/googletest/issues/2490
934-
version = "a4ab0abb93620ce26efad9de9296b73b16e88588",
935-
sha256 = "7897bfaa5ad39a479177cfb5c3ce010184dbaee22a7c3727b212282871918751",
934+
version = "52eb8108c5bdec04579160ae17225d66034bd723",
935+
sha256 = "745c55415660044610f7fcd3af7a6420d5de16a7dbb9ebfe2e131275676232be",
936936
strip_prefix = "googletest-{version}",
937937
urls = ["https://github.com/google/googletest/archive/{version}.tar.gz"],
938-
release_date = "2020-09-10",
938+
release_date = "2025-04-30",
939939
use_category = ["test_only"],
940940
cpe = "cpe:2.3:a:google:google_test:*",
941941
license = "BSD-3-Clause",

test/common/http/BUILD

+15
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,7 @@ envoy_cc_test(
293293
# Split to avoid compiler OOM, especially on ASAN.
294294
"conn_manager_impl_test.cc",
295295
"conn_manager_impl_test_2.cc",
296+
"conn_manager_impl_test_3.cc",
296297
],
297298
rbe_pool = "2core",
298299
shard_count = 5,
@@ -305,6 +306,20 @@ envoy_cc_test(
305306
],
306307
)
307308

309+
envoy_cc_test(
310+
name = "conn_manager_misc_test",
311+
srcs = ["conn_manager_misc_test.cc"],
312+
rbe_pool = "2core",
313+
shard_count = 5,
314+
deps = [
315+
":conn_manager_impl_test_base_lib",
316+
":custom_header_extension_lib",
317+
"//envoy/network:proxy_protocol_options_lib",
318+
"//test/extensions/filters/network/common/fuzz/utils:network_filter_fuzzer_fakes_lib",
319+
"//test/server:utility_lib",
320+
],
321+
)
322+
308323
envoy_cc_test(
309324
name = "conn_manager_utility_test",
310325
srcs = ["conn_manager_utility_test.cc"],

test/common/http/conn_manager_impl_test.cc

-83
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
#include "test/test_common/logging.h"
88
#include "test/test_common/test_runtime.h"
99

10-
#include "conn_manager_impl_test_base.h"
11-
1210
using testing::_;
1311
using testing::An;
1412
using testing::AnyNumber;
@@ -2715,87 +2713,6 @@ TEST_F(HttpConnectionManagerImplTest, TestPeriodicAccessLogging) {
27152713
filter->callbacks_->encodeHeaders(std::move(response_headers), true, "details");
27162714
}
27172715

2718-
class StreamErrorOnInvalidHttpMessageTest : public HttpConnectionManagerImplTest {
2719-
public:
2720-
void sendInvalidRequestAndVerifyConnectionState(bool stream_error_on_invalid_http_message,
2721-
bool send_complete_request = true) {
2722-
setup();
2723-
2724-
EXPECT_CALL(*codec_, dispatch(_))
2725-
.WillRepeatedly(Invoke([&](Buffer::Instance& data) -> Http::Status {
2726-
decoder_ = &conn_manager_->newStream(response_encoder_);
2727-
2728-
// These request headers are missing the necessary ":host"
2729-
RequestHeaderMapPtr headers{
2730-
new TestRequestHeaderMapImpl{{":method", "GET"}, {":path", "/"}}};
2731-
decoder_->decodeHeaders(std::move(headers), send_complete_request);
2732-
data.drain(0);
2733-
return Http::okStatus();
2734-
}));
2735-
2736-
auto* filter = new MockStreamFilter();
2737-
EXPECT_CALL(filter_factory_, createFilterChain(_))
2738-
.WillOnce(Invoke([&](FilterChainManager& manager) -> bool {
2739-
auto factory = createStreamFilterFactoryCb(StreamFilterSharedPtr{filter});
2740-
manager.applyFilterFactoryCb({}, factory);
2741-
return true;
2742-
}));
2743-
EXPECT_CALL(*filter, setDecoderFilterCallbacks(_));
2744-
EXPECT_CALL(*filter, setEncoderFilterCallbacks(_));
2745-
2746-
// codec stream error
2747-
EXPECT_CALL(response_encoder_, streamErrorOnInvalidHttpMessage())
2748-
.WillOnce(Return(stream_error_on_invalid_http_message));
2749-
EXPECT_CALL(*filter, encodeComplete());
2750-
EXPECT_CALL(*filter, encodeHeaders(_, true));
2751-
if (!stream_error_on_invalid_http_message) {
2752-
EXPECT_CALL(filter_callbacks_.connection_, close(_)).Times(AnyNumber());
2753-
if (send_complete_request) {
2754-
// The request is complete, so we should not flush close.
2755-
EXPECT_CALL(filter_callbacks_.connection_, close(Network::ConnectionCloseType::FlushWrite))
2756-
.Times(AnyNumber());
2757-
} else {
2758-
// If the request isn't complete, avoid a FIN/RST race with delay close.
2759-
EXPECT_CALL(filter_callbacks_.connection_,
2760-
close(Network::ConnectionCloseType::FlushWriteAndDelay))
2761-
.Times(AnyNumber());
2762-
}
2763-
}
2764-
EXPECT_CALL(response_encoder_, encodeHeaders(_, true))
2765-
.WillOnce(Invoke([&](const ResponseHeaderMap& headers, bool) -> void {
2766-
EXPECT_EQ("400", headers.getStatusValue());
2767-
EXPECT_EQ("missing_host_header",
2768-
filter->decoder_callbacks_->streamInfo().responseCodeDetails().value());
2769-
if (!stream_error_on_invalid_http_message) {
2770-
EXPECT_NE(nullptr, headers.Connection());
2771-
EXPECT_EQ("close", headers.getConnectionValue());
2772-
} else {
2773-
EXPECT_EQ(nullptr, headers.Connection());
2774-
}
2775-
}));
2776-
2777-
EXPECT_CALL(*filter, onStreamComplete());
2778-
EXPECT_CALL(*filter, onDestroy());
2779-
2780-
Buffer::OwnedImpl fake_input;
2781-
conn_manager_->onData(fake_input, false);
2782-
}
2783-
};
2784-
2785-
TEST_F(StreamErrorOnInvalidHttpMessageTest, ConnectionTerminatedIfCodecStreamErrorIsFalse) {
2786-
sendInvalidRequestAndVerifyConnectionState(false);
2787-
}
2788-
2789-
TEST_F(StreamErrorOnInvalidHttpMessageTest,
2790-
ConnectionTerminatedWithDelayIfCodecStreamErrorIsFalse) {
2791-
// Same as above, only with an incomplete request.
2792-
sendInvalidRequestAndVerifyConnectionState(false, false);
2793-
}
2794-
2795-
TEST_F(StreamErrorOnInvalidHttpMessageTest, ConnectionOpenIfCodecStreamErrorIsTrue) {
2796-
sendInvalidRequestAndVerifyConnectionState(true);
2797-
}
2798-
27992716
TEST_F(HttpConnectionManagerImplTest, TestAccessLogSsl) {
28002717
setup(SetupOpts().setSsl(true));
28012718

0 commit comments

Comments
 (0)