Migrate src/test/j/c/g/devtools/build/lib/remote/merkletree to shared BUILD file.
-load("@rules_java//java:defs.bzl", "java_test")
+load("@rules_java//java:defs.bzl", "java_library", "java_test")
package(
default_testonly = 1,
@@ -9,13 +9,16 @@ filegroup(
name = "srcs",
testonly = 0,
srcs = glob(["**"]),
- visibility = ["//src/test/java/com/google/devtools/build/lib/remote:__pkg__"],
+ visibility = ["//src:__subpackages__"],
)
-java_test(
- name = "merkletree",
- srcs = glob(["*.java"]),
- test_class = "com.google.devtools.build.lib.AllTests",
+java_library(
+ name = "MerkletreeTests_lib",
+ srcs = glob(
+ [
+ "*.java",
+ ],
+ ),
deps = [
"//src/main/java/com/google/devtools/build/lib/actions",
"//src/main/java/com/google/devtools/build/lib/actions:artifacts",
@@ -23,17 +26,23 @@ java_test(
"//src/main/java/com/google/devtools/build/lib/clock",
"//src/main/java/com/google/devtools/build/lib/remote/merkletree",
"//src/main/java/com/google/devtools/build/lib/remote/util",
- "//src/main/java/com/google/devtools/build/lib/util/io",
"//src/main/java/com/google/devtools/build/lib/vfs",
"//src/main/java/com/google/devtools/build/lib/vfs:pathfragment",
"//src/main/java/com/google/devtools/build/lib/vfs/inmemoryfs",
- "//src/test/java/com/google/devtools/build/lib:test_runner",
"//src/test/java/com/google/devtools/build/lib/actions/util",
"//src/test/java/com/google/devtools/build/lib/remote/util",
- "//src/test/java/com/google/devtools/build/lib/testutil",
"//third_party:guava",
+ "//third_party:junit4",
"//third_party:truth",
- "//third_party/protobuf:protobuf_java",
"@remoteapis//:build_bazel_remote_execution_v2_remote_execution_java_proto",
],
)
+
+java_test(
+ name = "MerkletreeTests",
+ test_class = "com.google.devtools.build.lib.AllTests",
+ runtime_deps = [
+ ":MerkletreeTests_lib",
+ "//src/test/java/com/google/devtools/build/lib:test_runner",
+ ],
+)
