Skip to content

Commit

Permalink
Improve regularity of a few BUILD files
Browse files Browse the repository at this point in the history
Made .../test/.../lib/bazel its own package, updated .../test/.../lib/BUILD to pick up targets through there.

I confirmed via bazel query that the content of .../lib:srcs is still correct. Moreover, .../lib:all_windows_tests now includes some tests from .../lib/bazel/repository/downloader that appear to have been accidentally omitted.

RELNOTES: None
PiperOrigin-RevId: 227138884
  • Loading branch information
brandjon authored and Copybara-Service committed Dec 28, 2018
1 parent 7019131 commit 1cfa750
Show file tree
Hide file tree
Showing 6 changed files with 87 additions and 53 deletions.
49 changes: 2 additions & 47 deletions src/test/java/com/google/devtools/build/lib/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,7 @@ filegroup(
"//src/test/java/com/google/devtools/build/lib/analysis/platform:srcs",
"//src/test/java/com/google/devtools/build/lib/analysis/skylark/annotations/processor:srcs",
"//src/test/java/com/google/devtools/build/lib/analysis/whitelisting:srcs",
"//src/test/java/com/google/devtools/build/lib/bazel/repository/cache:srcs",
"//src/test/java/com/google/devtools/build/lib/bazel/debug:srcs",
"//src/test/java/com/google/devtools/build/lib/bazel/repository/downloader:srcs",
"//src/test/java/com/google/devtools/build/lib/bazel/repository:srcs",
"//src/test/java/com/google/devtools/build/lib/bazel:srcs",
"//src/test/java/com/google/devtools/build/lib/buildeventservice:srcs",
"//src/test/java/com/google/devtools/build/lib/buildeventstream:srcs",
"//src/test/java/com/google/devtools/build/lib/buildeventstream/transports:srcs",
Expand Down Expand Up @@ -1225,48 +1222,6 @@ java_test(
],
)

java_test(
name = "bazel-rules-tests",
srcs = glob([
"bazel/rules/**/*.java",
]),
resources = [
"//tools/android:android_sdk_repository_template.bzl",
] + glob(["bazel/rules/**/*.txt"]),
tags = ["rules"],
test_class = "com.google.devtools.build.lib.AllTests",
deps = [
":actions_testutil",
":analysis_testutil",
":foundations_testutil",
":guava_junit_truth",
":packages_testutil",
":test_runner",
":testutil",
"//src/main/java/com/google/devtools/build/lib:android-rules",
"//src/main/java/com/google/devtools/build/lib:bazel-main",
"//src/main/java/com/google/devtools/build/lib:bazel-rules",
"//src/main/java/com/google/devtools/build/lib:build-base",
"//src/main/java/com/google/devtools/build/lib:core-rules",
"//src/main/java/com/google/devtools/build/lib:core-workspace-rules",
"//src/main/java/com/google/devtools/build/lib:events",
"//src/main/java/com/google/devtools/build/lib:packages-internal",
"//src/main/java/com/google/devtools/build/lib:python-rules",
"//src/main/java/com/google/devtools/build/lib:syntax",
"//src/main/java/com/google/devtools/build/lib:util",
"//src/main/java/com/google/devtools/build/lib/actions",
"//src/main/java/com/google/devtools/build/lib/cmdline",
"//src/main/java/com/google/devtools/build/lib/collect/nestedset",
"//src/main/java/com/google/devtools/build/lib/rules/config",
"//src/main/java/com/google/devtools/build/lib/rules/cpp",
"//src/main/java/com/google/devtools/build/lib/rules/java:java-compilation",
"//src/main/java/com/google/devtools/build/lib/vfs",
"//src/main/java/com/google/devtools/common/options",
"//src/main/protobuf:crosstool_config_java_proto",
"//src/test/java/com/google/devtools/build/lib/rules/android:AndroidLocalTestTest",
],
)

java_test(
name = "query2-tests",
size = "large",
Expand Down Expand Up @@ -1742,7 +1697,7 @@ test_suite(
"//src/test/java/com/google/devtools/build/lib/analysis/platform:all_windows_tests",
"//src/test/java/com/google/devtools/build/lib/analysis/skylark/annotations/processor:all_windows_tests",
"//src/test/java/com/google/devtools/build/lib/analysis/whitelisting:all_windows_tests",
"//src/test/java/com/google/devtools/build/lib/bazel/repository:all_windows_tests",
"//src/test/java/com/google/devtools/build/lib/bazel:all_windows_tests",
"//src/test/java/com/google/devtools/build/lib/blackbox/tests:blackbox_windows_tests",
"//src/test/java/com/google/devtools/build/lib/buildeventservice:all_windows_tests",
"//src/test/java/com/google/devtools/build/lib/buildeventstream/transports:all_windows_tests",
Expand Down
75 changes: 75 additions & 0 deletions src/test/java/com/google/devtools/build/lib/bazel/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
package(
default_testonly = True,
default_visibility = ["//src:__subpackages__"],
)

filegroup(
name = "srcs",
testonly = 0,
srcs = glob(["**"]) + [
"//src/test/java/com/google/devtools/build/lib/bazel/debug:srcs",
"//src/test/java/com/google/devtools/build/lib/bazel/repository:srcs",
],
visibility = ["//src/test/java/com/google/devtools/build/lib:__pkg__"],
)

test_suite(
name = "windows_tests",
tags = [
"-no_windows",
"-slow",
],
visibility = ["//visibility:private"],
)

test_suite(
name = "all_windows_tests",
tests = [
":windows_tests",
"//src/test/java/com/google/devtools/build/lib/bazel/repository:all_windows_tests",
],
visibility = ["//src/test/java/com/google/devtools/build/lib:__pkg__"],
)

java_test(
name = "bazel-rules-tests",
srcs = glob(["rules/**/*.java"]),
resources = [
"//tools/android:android_sdk_repository_template.bzl",
] + glob(["rules/**/*.txt"]),
tags = ["rules"],
test_class = "com.google.devtools.build.lib.AllTests",
deps = [
"//src/main/java/com/google/devtools/build/lib:android-rules",
"//src/main/java/com/google/devtools/build/lib:bazel-main",
"//src/main/java/com/google/devtools/build/lib:bazel-rules",
"//src/main/java/com/google/devtools/build/lib:build-base",
"//src/main/java/com/google/devtools/build/lib:core-rules",
"//src/main/java/com/google/devtools/build/lib:core-workspace-rules",
"//src/main/java/com/google/devtools/build/lib:events",
"//src/main/java/com/google/devtools/build/lib:packages-internal",
"//src/main/java/com/google/devtools/build/lib:python-rules",
"//src/main/java/com/google/devtools/build/lib:syntax",
"//src/main/java/com/google/devtools/build/lib:util",
"//src/main/java/com/google/devtools/build/lib/actions",
"//src/main/java/com/google/devtools/build/lib/cmdline",
"//src/main/java/com/google/devtools/build/lib/collect/nestedset",
"//src/main/java/com/google/devtools/build/lib/rules/config",
"//src/main/java/com/google/devtools/build/lib/rules/cpp",
"//src/main/java/com/google/devtools/build/lib/rules/java:java-compilation",
"//src/main/java/com/google/devtools/build/lib/vfs",
"//src/main/java/com/google/devtools/common/options",
"//src/main/protobuf:crosstool_config_java_proto",
"//src/test/java/com/google/devtools/build/lib:actions_testutil",
"//src/test/java/com/google/devtools/build/lib:analysis_testutil",
"//src/test/java/com/google/devtools/build/lib:foundations_testutil",
"//src/test/java/com/google/devtools/build/lib:packages_testutil",
"//src/test/java/com/google/devtools/build/lib:test_runner",
"//src/test/java/com/google/devtools/build/lib:testutil",
"//src/test/java/com/google/devtools/build/lib/rules/android:AndroidLocalTestTest",
"//third_party:guava",
"//third_party:guava-testlib",
"//third_party:junit4",
"//third_party:truth",
],
)
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ filegroup(
name = "srcs",
testonly = 0,
srcs = glob(["**"]),
visibility = ["//src/test/java/com/google/devtools/build/lib:__pkg__"],
visibility = ["//src/test/java/com/google/devtools/build/lib/bazel:__pkg__"],
)

java_test(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@ package(
filegroup(
name = "srcs",
testonly = 0,
srcs = glob(["**"]),
visibility = ["//src/test/java/com/google/devtools/build/lib:__pkg__"],
srcs = glob(["**"]) + [
"//src/test/java/com/google/devtools/build/lib/bazel/repository/cache:srcs",
"//src/test/java/com/google/devtools/build/lib/bazel/repository/downloader:srcs",
],
visibility = ["//src/test/java/com/google/devtools/build/lib/bazel:__pkg__"],
)

genrule(
Expand Down Expand Up @@ -81,6 +84,7 @@ test_suite(
tests = [
":windows_tests",
"//src/test/java/com/google/devtools/build/lib/bazel/repository/cache:all_windows_tests",
"//src/test/java/com/google/devtools/build/lib/bazel/repository/downloader:all_windows_tests",
],
visibility = ["//src/test/java/com/google/devtools/build/lib:__pkg__"],
visibility = ["//src/test/java/com/google/devtools/build/lib/bazel:__pkg__"],
)
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ filegroup(
name = "srcs",
testonly = 0,
srcs = glob(["**"]),
visibility = ["//src/test/java/com/google/devtools/build/lib:__pkg__"],
visibility = ["//src/test/java/com/google/devtools/build/lib/bazel/repository:__pkg__"],
)

java_test(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ filegroup(
name = "srcs",
testonly = 0,
srcs = glob(["**"]),
visibility = ["//src/test/java/com/google/devtools/build/lib:__pkg__"],
visibility = ["//src/test/java/com/google/devtools/build/lib/bazel/repository:__pkg__"],
)

java_test(
Expand Down

0 comments on commit 1cfa750

Please sign in to comment.