Skip to content

Commit

Permalink
test: refactor header inclusion to speed up building (for test/common…
Browse files Browse the repository at this point in the history
…/...) (envoyproxy#12046)

Commit Message: refactor header inclusion to speed up building (for test/common/...)
Risk Level: low
Testing: existing 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 6d295e5 commit 4533917
Show file tree
Hide file tree
Showing 36 changed files with 66 additions and 47 deletions.
2 changes: 1 addition & 1 deletion test/common/access_log/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ envoy_cc_test(
"//test/mocks/event:event_mocks",
"//test/mocks/filesystem:filesystem_mocks",
"//test/mocks/runtime:runtime_mocks",
"//test/mocks/server:server_mocks",
"//test/mocks/server:factory_context_mocks",
"//test/mocks/upstream:upstream_mocks",
"//test/test_common:registry_lib",
"//test/test_common:utility_lib",
Expand Down
2 changes: 1 addition & 1 deletion test/common/access_log/access_log_impl_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include "test/mocks/event/mocks.h"
#include "test/mocks/filesystem/mocks.h"
#include "test/mocks/runtime/mocks.h"
#include "test/mocks/server/mocks.h"
#include "test/mocks/server/factory_context.h"
#include "test/mocks/upstream/mocks.h"
#include "test/test_common/printers.h"
#include "test/test_common/registry.h"
Expand Down
2 changes: 1 addition & 1 deletion test/common/config/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ envoy_cc_test(
":dummy_config_proto_cc_proto",
"//source/common/config:config_provider_lib",
"//source/common/protobuf:utility_lib",
"//test/mocks/server:server_mocks",
"//test/mocks/server:instance_mocks",
"//test/test_common:simulated_time_system_lib",
"@envoy_api//envoy/config/core/v3:pkg_cc_proto",
"@envoy_api//envoy/service/discovery/v3:pkg_cc_proto",
Expand Down
2 changes: 1 addition & 1 deletion test/common/config/config_provider_impl_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include "common/protobuf/utility.h"

#include "test/common/config/dummy_config.pb.h"
#include "test/mocks/server/mocks.h"
#include "test/mocks/server/instance.h"
#include "test/test_common/simulated_time_system.h"
#include "test/test_common/utility.h"

Expand Down
8 changes: 3 additions & 5 deletions test/common/config/datasource_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,17 @@

#include "test/mocks/event/mocks.h"
#include "test/mocks/init/mocks.h"
#include "test/mocks/runtime/mocks.h"
#include "test/mocks/upstream/mocks.h"
#include "test/test_common/utility.h"

#include "gtest/gtest.h"

using testing::AtLeast;
using testing::NiceMock;
using testing::Return;

namespace Envoy {
namespace Config {
namespace {
using ::testing::AtLeast;
using ::testing::NiceMock;
using ::testing::Return;

class AsyncDataSourceTest : public testing::Test {
protected:
Expand Down
4 changes: 3 additions & 1 deletion test/common/grpc/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,12 @@ envoy_cc_test_library(
":utility_lib",
"//source/common/api:api_lib",
"//source/common/event:dispatcher_lib",
"//source/common/grpc:context_lib",
"//source/common/http:context_lib",
"//source/common/http/http2:conn_pool_lib",
"//test/integration:integration_lib",
"//test/mocks/local_info:local_info_mocks",
"//test/mocks/server:server_mocks",
"//test/mocks/server:transport_socket_factory_context_mocks",
"//test/proto:helloworld_proto_cc_proto",
"//test/test_common:global_lib",
"//test/test_common:test_time_lib",
Expand Down
4 changes: 3 additions & 1 deletion test/common/grpc/grpc_client_integration_test_harness.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
#include "common/api/api_impl.h"
#include "common/event/dispatcher_impl.h"
#include "common/grpc/async_client_impl.h"
#include "common/grpc/context_impl.h"
#include "common/http/context_impl.h"

#ifdef ENVOY_GOOGLE_GRPC
#include "common/grpc/google_async_client_impl.h"
Expand All @@ -28,7 +30,7 @@
#include "test/integration/fake_upstream.h"
#include "test/mocks/grpc/mocks.h"
#include "test/mocks/local_info/mocks.h"
#include "test/mocks/server/mocks.h"
#include "test/mocks/server/transport_socket_factory_context.h"
#include "test/mocks/tracing/mocks.h"
#include "test/mocks/upstream/mocks.h"
#include "test/proto/helloworld.pb.h"
Expand Down
4 changes: 3 additions & 1 deletion test/common/http/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,9 @@ envoy_cc_test(
"//test/mocks/network:network_mocks",
"//test/mocks/router:router_mocks",
"//test/mocks/runtime:runtime_mocks",
"//test/mocks/server:server_mocks",
"//test/mocks/server:factory_context_mocks",
"//test/mocks/server:instance_mocks",
"//test/mocks/server:overload_manager_mocks",
"//test/mocks/ssl:ssl_mocks",
"//test/mocks/tracing:tracing_mocks",
"//test/mocks/upstream:upstream_mocks",
Expand Down
4 changes: 3 additions & 1 deletion test/common/http/conn_manager_impl_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@
#include "test/mocks/network/mocks.h"
#include "test/mocks/router/mocks.h"
#include "test/mocks/runtime/mocks.h"
#include "test/mocks/server/mocks.h"
#include "test/mocks/server/factory_context.h"
#include "test/mocks/server/instance.h"
#include "test/mocks/server/overload_manager.h"
#include "test/mocks/ssl/mocks.h"
#include "test/mocks/tracing/mocks.h"
#include "test/mocks/upstream/cluster_info.h"
Expand Down
2 changes: 1 addition & 1 deletion test/common/local_reply/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ envoy_cc_test(
deps = [
"//source/common/local_reply:local_reply_lib",
"//test/mocks/http:http_mocks",
"//test/mocks/server:server_mocks",
"//test/mocks/server:factory_context_mocks",
"//test/mocks/stream_info:stream_info_mocks",
"//test/test_common:utility_lib",
"@envoy_api//envoy/extensions/filters/network/http_connection_manager/v3:pkg_cc_proto",
Expand Down
2 changes: 1 addition & 1 deletion test/common/local_reply/local_reply_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include "common/local_reply/local_reply.h"

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

Expand Down
2 changes: 1 addition & 1 deletion test/common/memory/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ envoy_cc_test(
"//source/common/memory:stats_lib",
"//test/common/stats:stat_test_utility_lib",
"//test/mocks/event:event_mocks",
"//test/mocks/server:server_mocks",
"//test/mocks/server:overload_manager_mocks",
"//test/test_common:simulated_time_system_lib",
"//test/test_common:utility_lib",
],
Expand Down
2 changes: 1 addition & 1 deletion test/common/memory/heap_shrinker_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

#include "test/common/stats/stat_test_utility.h"
#include "test/mocks/event/mocks.h"
#include "test/mocks/server/mocks.h"
#include "test/mocks/server/overload_manager.h"
#include "test/test_common/simulated_time_system.h"

#include "gmock/gmock.h"
Expand Down
4 changes: 3 additions & 1 deletion test/common/network/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ envoy_cc_test_library(
"//source/common/network:listener_lib",
"//source/common/network:utility_lib",
"//source/common/stats:stats_lib",
"//source/common/stream_info:stream_info_lib",
"//test/mocks/network:network_mocks",
"//test/mocks/server:server_mocks",
"//test/test_common:environment_lib",
Expand Down Expand Up @@ -138,7 +139,8 @@ envoy_cc_test(
"//test/mocks/buffer:buffer_mocks",
"//test/mocks/network:network_mocks",
"//test/mocks/ratelimit:ratelimit_mocks",
"//test/mocks/server:server_mocks",
"//test/mocks/server:factory_context_mocks",
"//test/mocks/server:instance_mocks",
"//test/mocks/tracing:tracing_mocks",
"//test/mocks/upstream:host_mocks",
"//test/mocks/upstream:upstream_mocks",
Expand Down
3 changes: 2 additions & 1 deletion test/common/network/filter_manager_impl_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
#include "test/mocks/network/mocks.h"
#include "test/mocks/ratelimit/mocks.h"
#include "test/mocks/runtime/mocks.h"
#include "test/mocks/server/mocks.h"
#include "test/mocks/server/factory_context.h"
#include "test/mocks/server/instance.h"
#include "test/mocks/tracing/mocks.h"
#include "test/mocks/upstream/host.h"
#include "test/mocks/upstream/mocks.h"
Expand Down
2 changes: 1 addition & 1 deletion test/common/protobuf/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ envoy_cc_test(
"//test/mocks/init:init_mocks",
"//test/mocks/local_info:local_info_mocks",
"//test/mocks/protobuf:protobuf_mocks",
"//test/mocks/server:server_mocks",
"//test/mocks/server:instance_mocks",
"//test/proto:deprecated_proto_cc_proto",
"//test/proto:sensitive_proto_cc_proto",
"//test/test_common:environment_lib",
Expand Down
2 changes: 1 addition & 1 deletion test/common/protobuf/utility_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#include "test/mocks/init/mocks.h"
#include "test/mocks/local_info/mocks.h"
#include "test/mocks/protobuf/mocks.h"
#include "test/mocks/server/mocks.h"
#include "test/mocks/server/instance.h"
#include "test/proto/deprecated.pb.h"
#include "test/proto/sensitive.pb.h"
#include "test/test_common/environment.h"
Expand Down
14 changes: 7 additions & 7 deletions test/common/router/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ envoy_cc_test_library(
"//source/common/stream_info:filter_state_lib",
"//test/extensions/filters/http/common:empty_http_filter_config_lib",
"//test/fuzz:utility_lib",
"//test/mocks/server:server_mocks",
"//test/mocks/server:instance_mocks",
"//test/test_common:environment_lib",
"//test/test_common:registry_lib",
"//test/test_common:test_runtime_lib",
Expand Down Expand Up @@ -72,7 +72,7 @@ envoy_cc_test(
"//source/server/admin:admin_lib",
"//test/mocks/local_info:local_info_mocks",
"//test/mocks/protobuf:protobuf_mocks",
"//test/mocks/server:server_mocks",
"//test/mocks/server:instance_mocks",
"//test/mocks/thread_local:thread_local_mocks",
"//test/mocks/upstream:upstream_mocks",
"//test/test_common:simulated_time_system_lib",
Expand Down Expand Up @@ -118,7 +118,7 @@ envoy_cc_test(
"//test/mocks/init:init_mocks",
"//test/mocks/protobuf:protobuf_mocks",
"//test/mocks/router:router_mocks",
"//test/mocks/server:server_mocks",
"//test/mocks/server:instance_mocks",
"//test/test_common:simulated_time_system_lib",
"//test/test_common:utility_lib",
"@envoy_api//envoy/admin/v3:pkg_cc_proto",
Expand All @@ -141,7 +141,7 @@ envoy_cc_test(
"//source/server/admin:admin_lib",
"//test/mocks/config:config_mocks",
"//test/mocks/local_info:local_info_mocks",
"//test/mocks/server:server_mocks",
"//test/mocks/server:instance_mocks",
"//test/mocks/thread_local:thread_local_mocks",
"//test/mocks/upstream:upstream_mocks",
"//test/test_common:simulated_time_system_lib",
Expand Down Expand Up @@ -229,7 +229,7 @@ envoy_cc_fuzz_test(
":route_fuzz_proto_cc_proto",
"//source/common/router:config_lib",
"//test/fuzz:utility_lib",
"//test/mocks/server:server_mocks",
"//test/mocks/server:instance_mocks",
"@envoy_api//envoy/config/route/v3:pkg_cc_proto",
],
)
Expand All @@ -245,7 +245,7 @@ envoy_cc_test(
"//test/mocks/http:http_mocks",
"//test/mocks/ratelimit:ratelimit_mocks",
"//test/mocks/router:router_mocks",
"//test/mocks/server:server_mocks",
"//test/mocks/server:instance_mocks",
"//test/test_common:utility_lib",
"@envoy_api//envoy/config/route/v3:pkg_cc_proto",
],
Expand Down Expand Up @@ -307,7 +307,7 @@ envoy_cc_test(
"//test/mocks/network:network_mocks",
"//test/mocks/router:router_mocks",
"//test/mocks/runtime:runtime_mocks",
"//test/mocks/server:server_mocks",
"//test/mocks/server:factory_context_mocks",
"//test/mocks/ssl:ssl_mocks",
"//test/mocks/upstream:upstream_mocks",
"//test/test_common:utility_lib",
Expand Down
2 changes: 1 addition & 1 deletion test/common/router/config_impl_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#include "test/common/router/route_fuzz.pb.h"
#include "test/extensions/filters/http/common/empty_http_filter_config.h"
#include "test/fuzz/utility.h"
#include "test/mocks/server/mocks.h"
#include "test/mocks/server/instance.h"
#include "test/test_common/environment.h"
#include "test/test_common/printers.h"
#include "test/test_common/registry.h"
Expand Down
2 changes: 1 addition & 1 deletion test/common/router/rds_impl_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include "test/mocks/init/mocks.h"
#include "test/mocks/local_info/mocks.h"
#include "test/mocks/protobuf/mocks.h"
#include "test/mocks/server/mocks.h"
#include "test/mocks/server/instance.h"
#include "test/mocks/thread_local/mocks.h"
#include "test/mocks/upstream/mocks.h"
#include "test/test_common/printers.h"
Expand Down
2 changes: 1 addition & 1 deletion test/common/router/route_fuzz_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include "test/common/router/route_fuzz.pb.validate.h"
#include "test/fuzz/fuzz_runner.h"
#include "test/fuzz/utility.h"
#include "test/mocks/server/mocks.h"
#include "test/mocks/server/instance.h"

namespace Envoy {
namespace Router {
Expand Down
2 changes: 1 addition & 1 deletion test/common/router/router_ratelimit_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#include "test/mocks/http/mocks.h"
#include "test/mocks/ratelimit/mocks.h"
#include "test/mocks/router/mocks.h"
#include "test/mocks/server/mocks.h"
#include "test/mocks/server/instance.h"
#include "test/test_common/printers.h"
#include "test/test_common/utility.h"

Expand Down
2 changes: 1 addition & 1 deletion test/common/router/router_upstream_log_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include "test/mocks/network/mocks.h"
#include "test/mocks/router/mocks.h"
#include "test/mocks/runtime/mocks.h"
#include "test/mocks/server/mocks.h"
#include "test/mocks/server/factory_context.h"
#include "test/mocks/upstream/mocks.h"
#include "test/test_common/utility.h"

Expand Down
2 changes: 1 addition & 1 deletion test/common/router/scoped_rds_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include "test/mocks/config/mocks.h"
#include "test/mocks/protobuf/mocks.h"
#include "test/mocks/router/mocks.h"
#include "test/mocks/server/mocks.h"
#include "test/mocks/server/instance.h"
#include "test/test_common/simulated_time_system.h"
#include "test/test_common/utility.h"

Expand Down
2 changes: 1 addition & 1 deletion test/common/router/vhds_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

#include "test/mocks/config/mocks.h"
#include "test/mocks/init/mocks.h"
#include "test/mocks/server/mocks.h"
#include "test/mocks/server/instance.h"
#include "test/mocks/thread_local/mocks.h"
#include "test/mocks/upstream/mocks.h"
#include "test/test_common/printers.h"
Expand Down
6 changes: 4 additions & 2 deletions test/common/secret/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ envoy_cc_test(
"//source/common/secret:secret_manager_impl_lib",
"//source/common/ssl:certificate_validation_context_config_impl_lib",
"//source/common/ssl:tls_certificate_config_impl_lib",
"//test/mocks/server:server_mocks",
"//test/mocks/server:config_tracker_mocks",
"//test/mocks/server:instance_mocks",
"//test/mocks/server:transport_socket_factory_context_mocks",
"//test/test_common:environment_lib",
"//test/test_common:registry_lib",
"//test/test_common:simulated_time_system_lib",
Expand All @@ -46,7 +48,7 @@ envoy_cc_test(
"//test/mocks/init:init_mocks",
"//test/mocks/protobuf:protobuf_mocks",
"//test/mocks/secret:secret_mocks",
"//test/mocks/server:server_mocks",
"//test/mocks/server:instance_mocks",
"//test/test_common:environment_lib",
"//test/test_common:registry_lib",
"//test/test_common:utility_lib",
Expand Down
2 changes: 1 addition & 1 deletion test/common/secret/sds_api_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#include "test/mocks/init/mocks.h"
#include "test/mocks/protobuf/mocks.h"
#include "test/mocks/secret/mocks.h"
#include "test/mocks/server/mocks.h"
#include "test/mocks/server/instance.h"
#include "test/test_common/environment.h"
#include "test/test_common/utility.h"

Expand Down
4 changes: 3 additions & 1 deletion test/common/secret/secret_manager_impl_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
#include "common/ssl/tls_certificate_config_impl.h"

#include "test/mocks/event/mocks.h"
#include "test/mocks/server/mocks.h"
#include "test/mocks/server/config_tracker.h"
#include "test/mocks/server/instance.h"
#include "test/mocks/server/transport_socket_factory_context.h"
#include "test/test_common/environment.h"
#include "test/test_common/simulated_time_system.h"
#include "test/test_common/utility.h"
Expand Down
2 changes: 1 addition & 1 deletion test/common/stats/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ envoy_cc_test(
"//source/common/stats:thread_local_store_lib",
"//source/common/thread_local:thread_local_lib",
"//test/mocks/event:event_mocks",
"//test/mocks/server:server_mocks",
"//test/mocks/server:instance_mocks",
"//test/mocks/stats:stats_mocks",
"//test/mocks/thread_local:thread_local_mocks",
"//test/test_common:logging_lib",
Expand Down
2 changes: 1 addition & 1 deletion test/common/stats/thread_local_store_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

#include "test/common/stats/stat_test_utility.h"
#include "test/mocks/event/mocks.h"
#include "test/mocks/server/mocks.h"
#include "test/mocks/server/instance.h"
#include "test/mocks/stats/mocks.h"
#include "test/mocks/thread_local/mocks.h"
#include "test/test_common/logging.h"
Expand Down
3 changes: 2 additions & 1 deletion test/common/tcp_proxy/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ envoy_cc_test(
"//test/mocks/buffer:buffer_mocks",
"//test/mocks/network:network_mocks",
"//test/mocks/runtime:runtime_mocks",
"//test/mocks/server:server_mocks",
"//test/mocks/server:factory_context_mocks",
"//test/mocks/server:instance_mocks",
"//test/mocks/ssl:ssl_mocks",
"//test/mocks/stream_info:stream_info_mocks",
"//test/mocks/upstream:host_mocks",
Expand Down
3 changes: 2 additions & 1 deletion test/common/tcp_proxy/tcp_proxy_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
#include "test/mocks/buffer/mocks.h"
#include "test/mocks/network/mocks.h"
#include "test/mocks/runtime/mocks.h"
#include "test/mocks/server/mocks.h"
#include "test/mocks/server/factory_context.h"
#include "test/mocks/server/instance.h"
#include "test/mocks/ssl/mocks.h"
#include "test/mocks/stream_info/mocks.h"
#include "test/mocks/tcp/mocks.h"
Expand Down
Loading

0 comments on commit 4533917

Please sign in to comment.