Skip to content

Commit

Permalink
test: refactor header inclusion to speed up building (for test/extens…
Browse files Browse the repository at this point in the history
…ions/filters/network/...) (envoyproxy#12051)

Commit Message: refactor header inclusion to speed up building
Additional Description:
Risk Level: low
Testing: exsiting tests
Docs Changes: N/A
Release Notes: no
Related Issues: envoyproxy#10917

Signed-off-by: Muge Chen <mugechen@google.com>
Signed-off-by: scheler <santosh.cheler@appdynamics.com>
  • Loading branch information
foreseeable authored and scheler committed Aug 4, 2020
1 parent b2f2c55 commit e2d0932
Show file tree
Hide file tree
Showing 43 changed files with 59 additions and 56 deletions.
2 changes: 1 addition & 1 deletion test/extensions/filters/network/client_ssl_auth/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ envoy_extension_cc_test(
deps = [
"//source/common/protobuf:utility_lib",
"//source/extensions/filters/network/client_ssl_auth:config",
"//test/mocks/server:server_mocks",
"//test/mocks/server:factory_context_mocks",
"@envoy_api//envoy/extensions/filters/network/client_ssl_auth/v3:pkg_cc_proto",
],
)
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include "extensions/filters/network/client_ssl_auth/config.h"
#include "extensions/filters/network/well_known_names.h"

#include "test/mocks/server/mocks.h"
#include "test/mocks/server/factory_context.h"

#include "gmock/gmock.h"
#include "gtest/gtest.h"
Expand Down
10 changes: 5 additions & 5 deletions test/extensions/filters/network/dubbo_proxy/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ envoy_extension_cc_test(
":utility_lib",
"//source/extensions/filters/network/dubbo_proxy:config",
"//source/extensions/filters/network/dubbo_proxy/filters:filter_config_interface",
"//test/mocks/server:server_mocks",
"//test/mocks/server:factory_context_mocks",
"//test/test_common:registry_lib",
"@envoy_api//envoy/extensions/filters/network/dubbo_proxy/v3:pkg_cc_proto",
],
Expand All @@ -112,7 +112,7 @@ envoy_extension_cc_test(
deps = [
"//source/extensions/filters/network/dubbo_proxy:metadata_lib",
"//source/extensions/filters/network/dubbo_proxy/router:route_matcher",
"//test/mocks/server:server_mocks",
"//test/mocks/server:factory_context_mocks",
"@envoy_api//envoy/extensions/filters/network/dubbo_proxy/v3:pkg_cc_proto",
],
)
Expand All @@ -128,7 +128,7 @@ envoy_extension_cc_test(
"//source/extensions/filters/network/dubbo_proxy:dubbo_protocol_impl_lib",
"//source/extensions/filters/network/dubbo_proxy:metadata_lib",
"//source/extensions/filters/network/dubbo_proxy/router:config",
"//test/mocks/server:server_mocks",
"//test/mocks/server:factory_context_mocks",
"//test/test_common:registry_lib",
],
)
Expand Down Expand Up @@ -156,7 +156,7 @@ envoy_extension_cc_test(
":mocks_lib",
"//source/extensions/filters/network/dubbo_proxy/filters:well_known_names",
"//source/extensions/filters/network/dubbo_proxy/router:config",
"//test/mocks/server:server_mocks",
"//test/mocks/server:factory_context_mocks",
"@envoy_api//envoy/extensions/filters/network/dubbo_proxy/router/v3:pkg_cc_proto",
],
)
Expand Down Expand Up @@ -185,7 +185,7 @@ envoy_extension_cc_test(
"//source/extensions/filters/network/dubbo_proxy:dubbo_hessian2_serializer_impl_lib",
"//source/extensions/filters/network/dubbo_proxy:dubbo_protocol_impl_lib",
"//test/common/stats:stat_test_utility_lib",
"//test/mocks/server:server_mocks",
"//test/mocks/server:factory_context_mocks",
"@envoy_api//envoy/extensions/filters/network/dubbo_proxy/v3:pkg_cc_proto",
],
)
2 changes: 1 addition & 1 deletion test/extensions/filters/network/dubbo_proxy/config_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include "extensions/filters/network/dubbo_proxy/filters/filter_config.h"

#include "test/extensions/filters/network/dubbo_proxy/mocks.h"
#include "test/mocks/server/mocks.h"
#include "test/mocks/server/factory_context.h"
#include "test/test_common/registry.h"

#include "gmock/gmock.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include "test/extensions/filters/network/dubbo_proxy/mocks.h"
#include "test/extensions/filters/network/dubbo_proxy/utility.h"
#include "test/mocks/network/mocks.h"
#include "test/mocks/server/mocks.h"
#include "test/mocks/server/factory_context.h"
#include "test/test_common/printers.h"

#include "gmock/gmock.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include "extensions/filters/network/dubbo_proxy/router/route_matcher.h"
#include "extensions/filters/network/dubbo_proxy/serializer_impl.h"

#include "test/mocks/server/mocks.h"
#include "test/mocks/server/factory_context.h"

#include "gmock/gmock.h"
#include "gtest/gtest.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include "extensions/filters/network/dubbo_proxy/router/config.h"

#include "test/extensions/filters/network/dubbo_proxy/mocks.h"
#include "test/mocks/server/mocks.h"
#include "test/mocks/server/factory_context.h"

#include "gmock/gmock.h"
#include "gtest/gtest.h"
Expand Down
2 changes: 1 addition & 1 deletion test/extensions/filters/network/dubbo_proxy/router_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

#include "test/extensions/filters/network/dubbo_proxy/mocks.h"
#include "test/mocks/network/mocks.h"
#include "test/mocks/server/mocks.h"
#include "test/mocks/server/factory_context.h"
#include "test/test_common/printers.h"
#include "test/test_common/registry.h"

Expand Down
2 changes: 1 addition & 1 deletion test/extensions/filters/network/ext_authz/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ envoy_extension_cc_test(
extension_name = "envoy.filters.network.ext_authz",
deps = [
"//source/extensions/filters/network/ext_authz:config",
"//test/mocks/server:server_mocks",
"//test/mocks/server:factory_context_mocks",
"@envoy_api//envoy/config/core/v3:pkg_cc_proto",
"@envoy_api//envoy/extensions/filters/network/ext_authz/v3:pkg_cc_proto",
],
Expand Down
2 changes: 1 addition & 1 deletion test/extensions/filters/network/ext_authz/config_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

#include "extensions/filters/network/ext_authz/config.h"

#include "test/mocks/server/mocks.h"
#include "test/mocks/server/factory_context.h"
#include "test/test_common/utility.h"

#include "gmock/gmock.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ envoy_extension_cc_test(
"//source/extensions/filters/network/http_connection_manager:config",
"//test/integration/filters:encoder_decoder_buffer_filter_lib",
"//test/mocks/network:network_mocks",
"//test/mocks/server:server_mocks",
"//test/mocks/server:factory_context_mocks",
"//test/test_common:registry_lib",
"//test/test_common:utility_lib",
"@envoy_api//envoy/config/core/v3:pkg_cc_proto",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include "test/mocks/config/mocks.h"
#include "test/mocks/http/mocks.h"
#include "test/mocks/network/mocks.h"
#include "test/mocks/server/mocks.h"
#include "test/mocks/server/factory_context.h"
#include "test/test_common/printers.h"
#include "test/test_common/registry.h"
#include "test/test_common/utility.h"
Expand Down
2 changes: 1 addition & 1 deletion test/extensions/filters/network/kafka/broker/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ envoy_extension_cc_test(
extension_name = "envoy.filters.network.kafka_broker",
deps = [
"//source/extensions/filters/network/kafka:kafka_broker_config_lib",
"//test/mocks/server:server_mocks",
"//test/mocks/server:factory_context_mocks",
],
)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "extensions/filters/network/kafka/broker/config.h"

#include "test/mocks/server/mocks.h"
#include "test/mocks/server/factory_context.h"

#include "gmock/gmock.h"
#include "gtest/gtest.h"
Expand Down
2 changes: 1 addition & 1 deletion test/extensions/filters/network/mongo_proxy/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ envoy_extension_cc_test(
extension_name = "envoy.filters.network.mongo_proxy",
deps = [
"//source/extensions/filters/network/mongo_proxy:config",
"//test/mocks/server:server_mocks",
"//test/mocks/server:factory_context_mocks",
"//test/test_common:utility_lib",
"@envoy_api//envoy/extensions/filters/network/mongo_proxy/v3:pkg_cc_proto",
"@envoy_api//envoy/type/v3:pkg_cc_proto",
Expand Down
2 changes: 1 addition & 1 deletion test/extensions/filters/network/mongo_proxy/config_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#include "extensions/filters/network/mongo_proxy/config.h"

#include "test/mocks/server/mocks.h"
#include "test/mocks/server/factory_context.h"
#include "test/test_common/utility.h"

#include "gmock/gmock.h"
Expand Down
3 changes: 2 additions & 1 deletion test/extensions/filters/network/ratelimit/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ envoy_extension_cc_test(
extension_name = "envoy.filters.network.ratelimit",
deps = [
"//source/extensions/filters/network/ratelimit:config",
"//test/mocks/server:server_mocks",
"//test/mocks/server:factory_context_mocks",
"//test/mocks/server:instance_mocks",
"//test/test_common:utility_lib",
"@envoy_api//envoy/config/core/v3:pkg_cc_proto",
"@envoy_api//envoy/extensions/filters/network/ratelimit/v3:pkg_cc_proto",
Expand Down
3 changes: 2 additions & 1 deletion test/extensions/filters/network/ratelimit/config_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@

#include "extensions/filters/network/ratelimit/config.h"

#include "test/mocks/server/mocks.h"
#include "test/mocks/server/factory_context.h"
#include "test/mocks/server/instance.h"
#include "test/test_common/utility.h"

#include "gmock/gmock.h"
Expand Down
2 changes: 1 addition & 1 deletion test/extensions/filters/network/rbac/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ envoy_extension_cc_test(
extension_name = "envoy.filters.network.rbac",
deps = [
"//source/extensions/filters/network/rbac:config",
"//test/mocks/server:server_mocks",
"//test/mocks/server:factory_context_mocks",
"@envoy_api//envoy/config/rbac/v3:pkg_cc_proto",
"@envoy_api//envoy/extensions/filters/network/rbac/v3:pkg_cc_proto",
],
Expand Down
2 changes: 1 addition & 1 deletion test/extensions/filters/network/rbac/config_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

#include "extensions/filters/network/rbac/config.h"

#include "test/mocks/server/mocks.h"
#include "test/mocks/server/factory_context.h"

#include "fmt/printf.h"
#include "gmock/gmock.h"
Expand Down
2 changes: 1 addition & 1 deletion test/extensions/filters/network/redis_proxy/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ envoy_extension_cc_test(
deps = [
"//source/common/protobuf:utility_lib",
"//source/extensions/filters/network/redis_proxy:config",
"//test/mocks/server:server_mocks",
"//test/mocks/server:factory_context_mocks",
"//test/test_common:test_runtime_lib",
"@envoy_api//envoy/extensions/filters/network/redis_proxy/v3:pkg_cc_proto",
],
Expand Down
2 changes: 1 addition & 1 deletion test/extensions/filters/network/redis_proxy/config_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

#include "extensions/filters/network/redis_proxy/config.h"

#include "test/mocks/server/mocks.h"
#include "test/mocks/server/factory_context.h"
#include "test/test_common/test_runtime.h"

#include "gmock/gmock.h"
Expand Down
12 changes: 6 additions & 6 deletions test/extensions/filters/network/rocketmq_proxy/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ envoy_cc_mock(
deps = [
"//source/extensions/filters/network/rocketmq_proxy:config",
"//source/extensions/filters/network/rocketmq_proxy/router:router_lib",
"//test/mocks/server:server_mocks",
"//test/mocks/upstream:upstream_mocks",
],
)
Expand All @@ -31,7 +30,6 @@ envoy_cc_test_library(
hdrs = ["utility.h"],
deps = [
"//source/extensions/filters/network/rocketmq_proxy:config",
"//test/mocks/server:server_mocks",
],
)

Expand All @@ -54,7 +52,7 @@ envoy_extension_cc_test(
":mocks_lib",
":utility_lib",
"//source/extensions/filters/network/rocketmq_proxy:config",
"//test/mocks/server:server_mocks",
"//test/mocks/server:factory_context_mocks",
"//test/test_common:utility_lib",
],
)
Expand All @@ -79,7 +77,8 @@ envoy_extension_cc_test(
"//test/common/stats:stat_test_utility_lib",
"//test/common/upstream:utility_lib",
"//test/mocks/network:network_mocks",
"//test/mocks/server:server_mocks",
"//test/mocks/server:factory_context_mocks",
"//test/mocks/server:instance_mocks",
"//test/mocks/stream_info:stream_info_mocks",
"//test/test_common:utility_lib",
],
Expand All @@ -93,7 +92,7 @@ envoy_extension_cc_test(
":utility_lib",
"//source/extensions/filters/network/rocketmq_proxy:config",
"//test/mocks/network:network_mocks",
"//test/mocks/server:server_mocks",
"//test/mocks/server:factory_context_mocks",
"//test/mocks/stream_info:stream_info_mocks",
"//test/test_common:utility_lib",
],
Expand All @@ -106,7 +105,8 @@ envoy_extension_cc_test(
deps = [
"//source/extensions/filters/network/rocketmq_proxy:config",
"//test/mocks/local_info:local_info_mocks",
"//test/mocks/server:server_mocks",
"//test/mocks/server:factory_context_mocks",
"//test/mocks/server:instance_mocks",
"//test/test_common:registry_lib",
"@envoy_api//envoy/extensions/filters/network/rocketmq_proxy/v3:pkg_cc_proto",
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#include "test/extensions/filters/network/rocketmq_proxy/utility.h"
#include "test/mocks/network/mocks.h"
#include "test/mocks/server/mocks.h"
#include "test/mocks/server/factory_context.h"

#include "gmock/gmock.h"
#include "gtest/gtest.h"
Expand Down
4 changes: 3 additions & 1 deletion test/extensions/filters/network/rocketmq_proxy/codec_test.cc
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#include "common/common/empty_string.h"
#include "common/common/enum_to_int.h"
#include "common/network/address_impl.h"
#include "common/protobuf/utility.h"

Expand Down Expand Up @@ -794,4 +796,4 @@ TEST_F(RocketmqCodecTest, DecodeTopicFailure) {
} // namespace RocketmqProxy
} // namespace NetworkFilters
} // namespace Extensions
} // namespace Envoy
} // namespace Envoy
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
#include "extensions/filters/network/rocketmq_proxy/config.h"

#include "test/mocks/local_info/mocks.h"
#include "test/mocks/server/mocks.h"
#include "test/mocks/server/factory_context.h"
#include "test/mocks/server/instance.h"
#include "test/test_common/registry.h"

#include "gmock/gmock.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
#include "test/extensions/filters/network/rocketmq_proxy/utility.h"
#include "test/mocks/network/connection.h"
#include "test/mocks/network/mocks.h"
#include "test/mocks/server/mocks.h"
#include "test/mocks/server/factory_context.h"
#include "test/mocks/server/instance.h"

#include "gmock/gmock.h"
#include "gtest/gtest.h"
Expand Down
1 change: 0 additions & 1 deletion test/extensions/filters/network/rocketmq_proxy/mocks.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
#include "extensions/filters/network/rocketmq_proxy/active_message.h"
#include "extensions/filters/network/rocketmq_proxy/conn_manager.h"

#include "test/mocks/server/mocks.h"
#include "test/mocks/upstream/mocks.h"

#include "gmock/gmock.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

#include "test/extensions/filters/network/rocketmq_proxy/mocks.h"
#include "test/extensions/filters/network/rocketmq_proxy/utility.h"
#include "test/mocks/server/mocks.h"
#include "test/mocks/server/factory_context.h"

#include "gtest/gtest.h"

Expand Down
2 changes: 0 additions & 2 deletions test/extensions/filters/network/rocketmq_proxy/utility.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
#include "extensions/filters/network/rocketmq_proxy/config.h"
#include "extensions/filters/network/rocketmq_proxy/conn_manager.h"

#include "test/mocks/server/mocks.h"

#include "gtest/gtest.h"

namespace Envoy {
Expand Down
2 changes: 1 addition & 1 deletion test/extensions/filters/network/sni_cluster/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ envoy_extension_cc_test(
"//source/extensions/filters/network/sni_cluster",
"//source/extensions/filters/network/sni_cluster:config",
"//test/mocks/network:network_mocks",
"//test/mocks/server:server_mocks",
"//test/mocks/server:factory_context_mocks",
"//test/mocks/stream_info:stream_info_mocks",
],
)
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include "extensions/filters/network/sni_cluster/sni_cluster.h"

#include "test/mocks/network/mocks.h"
#include "test/mocks/server/mocks.h"
#include "test/mocks/server/factory_context.h"
#include "test/mocks/stream_info/mocks.h"

#include "gmock/gmock.h"
Expand Down
2 changes: 1 addition & 1 deletion test/extensions/filters/network/tcp_proxy/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ envoy_extension_cc_test(
extension_name = "envoy.filters.network.tcp_proxy",
deps = [
"//source/extensions/filters/network/tcp_proxy:config",
"//test/mocks/server:server_mocks",
"//test/mocks/server:factory_context_mocks",
"//test/test_common:utility_lib",
"@envoy_api//envoy/extensions/filters/network/tcp_proxy/v3:pkg_cc_proto",
],
Expand Down
2 changes: 1 addition & 1 deletion test/extensions/filters/network/tcp_proxy/config_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

#include "extensions/filters/network/tcp_proxy/config.h"

#include "test/mocks/server/mocks.h"
#include "test/mocks/server/factory_context.h"
#include "test/test_common/utility.h"

#include "gmock/gmock.h"
Expand Down
Loading

0 comments on commit e2d0932

Please sign in to comment.