diff --git a/bazel/envoy_build_system.bzl b/bazel/envoy_build_system.bzl index ca899c240497b..9e0c35c519d3d 100644 --- a/bazel/envoy_build_system.bzl +++ b/bazel/envoy_build_system.bzl @@ -96,6 +96,7 @@ def envoy_cc_test(name, srcs = srcs, data = data, deps = deps, + repository = repository, tags = test_lib_tags, ) native.cc_test( @@ -104,7 +105,7 @@ def envoy_cc_test(name, linkopts = ["-pthread"], linkstatic = 1, deps = [ - repository + name + "_lib", + ":" + name + "_lib", repository + "//test:main" ], tags = tags + ["coverage_test"], diff --git a/test/test_common/environment.cc b/test/test_common/environment.cc index 9d9cf7e1eb014..63cb24eeb57fc 100644 --- a/test/test_common/environment.cc +++ b/test/test_common/environment.cc @@ -71,6 +71,11 @@ std::string TestEnvironment::temporaryFileSubstitute(const std::string& path, std::string out_json_string; { std::ifstream file(tmp_json_path); + if (file.fail()) { + std::cerr << "failed to open: " << tmp_json_path << std::endl; + RELEASE_ASSERT(false); + } + std::stringstream file_string_stream; file_string_stream << file.rdbuf(); out_json_string = file_string_stream.str();