tests: restore direct mock/includes and deps for admin_filter and generic_proxy upstream tests#140
Draft
Copilot wants to merge 3 commits into
Draft
tests: restore direct mock/includes and deps for admin_filter and generic_proxy upstream tests#140Copilot wants to merge 3 commits into
Copilot wants to merge 3 commits into
Conversation
Signed-off-by: Ryan Northey <ryan@synca.io>
…eneric_proxy upstream tests Agent-Logs-Url: https://github.com/phlax/envoy/sessions/8c4d59cf-cd3e-4148-9d65-878bc5dfef70 Co-authored-by: phlax <454682+phlax@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix missing includes and dependencies in admin_filter_test
tests: restore direct mock/includes and deps for admin_filter and generic_proxy upstream tests
May 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to mock-include narrowing: two tests were implicitly relying on transitive server-mock includes/deps and now fail to compile after narrowing. This updates those tests to include and depend on the symbols they directly use.
test/server/admin/admin_filter_test.cc/test/server/admin/BUILDStats::IsolatedStoreImpl:source/common/stats/isolated_store_impl.h//source/common/stats:isolated_store_libtest/extensions/filters/network/generic_proxy/router/upstream_test.cc/.../router/BUILDtest/mocks/network/connection.htest/mocks/upstream/thread_local_cluster.husingdeclarations for direct symbol usage:using testing::_;using testing::ByMove;//test/mocks/network:connection_mocks//test/mocks/upstream:thread_local_cluster_mocksWarning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
dl.google.com/build/bazel_root/install/fb2a7f6d344d2f4e335882534df59296/embedded_tools/jdk/bin/java bazel(envoy) --add-opens=java.base/java.lang=ALL-UNNAMED -Xverify:none -Djava.util.logging.config.file=/build/bazel_root/base/javalog.properties -Dcom.google.devtools.build.lib.util.LogHandlerQuerier.class=com.google.devtools.build.lib.util.SimpleLogHandler$HandlerQuerier -XX:-MaxFDLimit -Djava.library.path=/build/bazel_root/install/fb2a7f6d344d2f4e335882534df59296/embedded_tools/jdk/lib:/build/bazel_root/install/fb2a7f6d344d2f4e335882534df59296/embedded_tools/jdk/lib/server:/build/bazel_root/install/fb2a7f6d344d2f4e335882534df59296/ -Dfile.encoding=ISO-8859-1 -Duser.country= -Duser.language= -Duser.variant= -Xmx3g -DBAZEL_TRACK_SOURCE_DIRECTORIES=1 -Djavax.net.ssl.trustStore=/tmp/custom-cacerts -Djavax.net.ssl.trustStorePassword=changeit -jar /build/bazel_root/install/fb2a7f6d344d2f4e335882534df59296/A-server.jar --max_idle_secs=10800 --noshutdown_on_low_sys_mem --connect_timeout_secs=30(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
Context
This is a follow-up to PR envoyproxy#45037 ("[WIP] tests: Narrow test mock includes more generally"), branch
test-mock-includesin this repo (phlax/envoy). Thetools/code/narrow_test_mockstool stripped includes/deps from two test files that were silently relying on transitive includes from server mock headers. CI is now failing on those two files. We need to fix the symptoms (add the missing direct includes + BUILD deps) — do not changenarrow_test_mocks.pyitself in this PR.Failure 1:
test/server/admin/admin_filter_test.ccCompiler errors:
Also note line 26 references
Stats::IsolatedStoreImpl(currently builds because of transitive includes — make it direct anyway since we're touching the file).The file currently only includes:
Fix
Add direct includes to
test/server/admin/admin_filter_test.cc:(
test/test_common/utility.hdefinesHttp::TestRequestHeaderMapImpland pulls intesting::_via gmock includes plus theusing testing::_line that's already implicit in many test headers — actually be safe and also addusing testing::_;to the existingusingblock at the top of the file alongside the existingusing testing::ByMove; using testing::InSequence; using testing::NiceMock; using testing::Return;.)Update
test/server/admin/BUILDfor theadmin_filter_testtarget — currently:Change to:
Verify the exact target name for the stream decoder filter callbacks mock by inspecting
test/mocks/http/BUILD— it may be:stream_decoder_filter_callbacks_mocksor part of:http_mocks. If the dedicated narrow target doesn't exist, use//test/mocks/http:http_mocksand#include "test/mocks/http/mocks.h"instead. Also check the correct stats target —//source/common/stats:isolated_store_libmay be more appropriate than:stats_lib. Pick whichever exists and exposesStats::IsolatedStoreImpl.:instance_mocksis no longer needed (file only usesMockAdmin), so drop it in favour of the narrower:admin_mocks.Failure 2:
test/extensions/filters/network/generic_proxy/router/upstream_test.ccCompiler errors include:
(The second class of errors — the "cannot initialize object parameter" ones for every
EXPECT_CALLandcreateBoundGenericUpstreamreference — are downstream symptoms of_being undeclared inside the macro expansion; once_is fixed they go away.)The file currently includes: