Skip to content

Commit

Permalink
test: split tcp_proxy test into config test and data test (#15067)
Browse files Browse the repository at this point in the history
Signed-off-by: Yuchen Dai <[email protected]>
  • Loading branch information
lambdai authored Mar 2, 2021
1 parent 4f2bf5a commit 16fbe46
Show file tree
Hide file tree
Showing 5 changed files with 1,287 additions and 1,191 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

#pragma once

#include <string>
Expand Down
36 changes: 33 additions & 3 deletions test/common/tcp_proxy/BUILD
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
load(
"//bazel:envoy_build_system.bzl",
"envoy_cc_test",
"envoy_cc_test_library",
"envoy_package",
)

licenses(["notice"]) # Apache 2

envoy_package()

envoy_cc_test(
name = "tcp_proxy_test",
srcs = ["tcp_proxy_test.cc"],
envoy_cc_test_library(
name = "tcp_proxy_test_base",
hdrs = [
"tcp_proxy_test_base.h",
],
deps = [
"//source/common/buffer:buffer_lib",
"//source/common/event:dispatcher_lib",
Expand All @@ -34,6 +37,7 @@ envoy_cc_test(
"//test/mocks/server:instance_mocks",
"//test/mocks/ssl:ssl_mocks",
"//test/mocks/stream_info:stream_info_mocks",
"//test/mocks/upstream:cluster_manager_mocks",
"//test/mocks/upstream:host_mocks",
"//test/test_common:test_runtime_lib",
"@envoy_api//envoy/config/accesslog/v3:pkg_cc_proto",
Expand All @@ -44,12 +48,38 @@ envoy_cc_test(
],
)

envoy_cc_test(
name = "config_test",
srcs = [
"config_test.cc",
],
deps = [
":tcp_proxy_test_base",
],
)

envoy_cc_test(
name = "tcp_proxy_test",
srcs = [
"tcp_proxy_test.cc",
],
deps = [
":tcp_proxy_test_base",
"@envoy_api//envoy/config/accesslog/v3:pkg_cc_proto",
"@envoy_api//envoy/extensions/access_loggers/file/v3:pkg_cc_proto",
"@envoy_api//envoy/extensions/filters/network/tcp_proxy/v3:pkg_cc_proto",
"@envoy_api//envoy/extensions/upstreams/http/generic/v3:pkg_cc_proto",
"@envoy_api//envoy/extensions/upstreams/tcp/generic/v3:pkg_cc_proto",
],
)

envoy_cc_test(
name = "upstream_test",
srcs = ["upstream_test.cc"],
deps = [
"//source/common/tcp_proxy",
"//test/mocks/http:http_mocks",
"//test/mocks/tcp:tcp_mocks",
"//test/mocks/upstream:cluster_manager_mocks",
],
)
Loading

0 comments on commit 16fbe46

Please sign in to comment.