Skip to content

Commit

Permalink
cleanup(bigtable): split out howto_mock_data_api bazel rule (#13189)
Browse files Browse the repository at this point in the history
Using the same rule for `howto_mock_data_api` as the other
`bigtable_examples_unit_tests` means that the union of the
dependencies for all test are used by each.  This is causing
a problem for an important google_cloud_cpp consumer.

So, split out the `howto_mock_data_api` rule so that we can
minimize its dependency count.  This avoids the downstream
issue.
  • Loading branch information
devbww authored Nov 27, 2023
1 parent 61ad5d2 commit 4dbcd15
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion google/cloud/bigtable/examples/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ cc_library(

load(":bigtable_examples_unit_tests.bzl", "bigtable_examples_unit_tests")

EXCLUDED_UNIT_TESTS = ["howto_mock_data_api.cc"]

filtered_unit_tests = [test for test in bigtable_examples_unit_tests if not test in EXCLUDED_UNIT_TESTS]

[cc_test(
name = test.replace("/", "_").replace(".cc", ""),
srcs = [test],
Expand All @@ -48,7 +52,17 @@ load(":bigtable_examples_unit_tests.bzl", "bigtable_examples_unit_tests")
"//google/cloud/testing_util:google_cloud_cpp_testing_private",
"@com_google_googletest//:gtest_main",
],
) for test in bigtable_examples_unit_tests]
) for test in filtered_unit_tests]

cc_test(
name = "howto_mock_data_api",
srcs = ["howto_mock_data_api.cc"],
deps = [
"//google/cloud/bigtable:google_cloud_cpp_bigtable",
"//google/cloud/bigtable:google_cloud_cpp_bigtable_mocks",
"@com_google_googletest//:gtest_main",
],
)

load(":bigtable_examples.bzl", "bigtable_examples")

Expand Down

0 comments on commit 4dbcd15

Please sign in to comment.