aboutsummaryrefslogtreecommitdiff
path: root/tests/core/go_test/BUILD.bazel
diff options
context:
space:
mode:
authorRoman Mohr <rmohr@redhat.com>2020-01-06 23:15:43 +0100
committerJay Conrod <jayconrod@google.com>2020-01-06 17:15:43 -0500
commite8df8b92975a87f72097a47066e40751bb7d965d (patch)
tree5d8bfae66dfd1c1b9cd688169bdbd53980e6ae82 /tests/core/go_test/BUILD.bazel
parent6a10fd6d11240834f8af685d838a0c78e782bd48 (diff)
downloadbazelbuild-rules_go-e8df8b92975a87f72097a47066e40751bb7d965d.tar.gz
Import all pkg which tests depend on (#2331)
All imports which gazelle identified as test dependencies should be imported in the test main package. This way "hidden" global registrations are properly added to the binary. One use-case is Ginkgo. It has its own wrappers for tests and rules_go would miss them in some cases, which would lead to tests which are not added to the binary. Signed-off-by: Roman Mohr <rmohr@redhat.com>
Diffstat (limited to 'tests/core/go_test/BUILD.bazel')
-rw-r--r--tests/core/go_test/BUILD.bazel9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/core/go_test/BUILD.bazel b/tests/core/go_test/BUILD.bazel
index a56800a1..6ff2f138 100644
--- a/tests/core/go_test/BUILD.bazel
+++ b/tests/core/go_test/BUILD.bazel
@@ -143,3 +143,12 @@ go_bazel_test(
name = "test_filter_test",
srcs = ["test_filter_test.go"],
)
+
+go_test(
+ name = "testmain_import_test",
+ srcs = [
+ "testmain_import_indirect_test.go",
+ "testmain_import_main_test.go",
+ ],
+ importpath = "example.com/imports/test_main",
+)