forked from bazelbuild/bazel
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create BUILD file in worker tests directory instead of running tests …
…from the parent directory. RELNOTES: None. PiperOrigin-RevId: 368261056
- Loading branch information
1 parent
3c29bc8
commit 5894a85
Showing
3 changed files
with
121 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
115 changes: 115 additions & 0 deletions
115
src/test/java/com/google/devtools/build/lib/worker/BUILD
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
load("@rules_java//java:defs.bzl", "java_binary", "java_library", "java_test") | ||
|
||
package( | ||
default_testonly = 1, | ||
default_visibility = ["//src:__subpackages__"], | ||
) | ||
|
||
filegroup( | ||
name = "srcs", | ||
testonly = 0, | ||
srcs = glob(["*"]), | ||
visibility = ["//src:__subpackages__"], | ||
) | ||
|
||
java_library( | ||
name = "ExampleWorker_lib", | ||
srcs = [ | ||
"ExampleWorker.java", | ||
"ExampleWorkerMultiplexer.java", | ||
"ExampleWorkerMultiplexerOptions.java", | ||
"ExampleWorkerOptions.java", | ||
"ExampleWorkerProtocol.java", | ||
], | ||
deps = [ | ||
"//src/main/java/com/google/devtools/build/lib/actions:execution_requirements", | ||
"//src/main/java/com/google/devtools/build/lib/worker:work_request_handlers", | ||
"//src/main/java/com/google/devtools/common/options", | ||
"//src/main/protobuf:worker_protocol_java_proto", | ||
"//third_party:gson", | ||
"//third_party:guava", | ||
], | ||
) | ||
|
||
java_library( | ||
name = "testutil", | ||
testonly = 1, | ||
srcs = ["TestUtils.java"], | ||
deps = [ | ||
"//src/main/java/com/google/devtools/build/lib/actions:execution_requirements", | ||
"//src/main/java/com/google/devtools/build/lib/shell", | ||
"//src/main/java/com/google/devtools/build/lib/vfs", | ||
"//src/main/java/com/google/devtools/build/lib/worker", | ||
"//third_party:guava", | ||
], | ||
) | ||
|
||
java_binary( | ||
name = "ExampleWorker", | ||
main_class = "com.google.devtools.build.lib.worker.ExampleWorker", | ||
runtime_deps = [":ExampleWorker_lib"], | ||
) | ||
|
||
java_binary( | ||
name = "ExampleWorkerMultiplexer", | ||
main_class = "com.google.devtools.build.lib.worker.ExampleWorkerMultiplexer", | ||
runtime_deps = [":ExampleWorker_lib"], | ||
) | ||
|
||
java_library( | ||
name = "WorkerTests_lib", | ||
srcs = glob(["*Test.java"]), | ||
deps = [ | ||
":testutil", | ||
"//src/main/java/com/google/devtools/build/lib/actions", | ||
"//src/main/java/com/google/devtools/build/lib/actions:execution_requirements", | ||
"//src/main/java/com/google/devtools/build/lib/clock", | ||
"//src/main/java/com/google/devtools/build/lib/collect/nestedset", | ||
"//src/main/java/com/google/devtools/build/lib/events", | ||
"//src/main/java/com/google/devtools/build/lib/exec:spawn_runner", | ||
"//src/main/java/com/google/devtools/build/lib/exec/local", | ||
"//src/main/java/com/google/devtools/build/lib/sandbox", | ||
"//src/main/java/com/google/devtools/build/lib/util:resource_converter", | ||
"//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/main/java/com/google/devtools/build/lib/worker", | ||
"//src/main/java/com/google/devtools/common/options", | ||
"//src/main/protobuf:worker_protocol_java_proto", | ||
"//src/test/java/com/google/devtools/build/lib/actions/util", | ||
"//src/test/java/com/google/devtools/build/lib/testutil:TestUtils", | ||
"//src/test/java/com/google/devtools/build/lib/vfs/util", | ||
"//third_party:apache_commons_pool2", | ||
"//third_party:guava", | ||
"//third_party:guava-testlib", | ||
"//third_party:junit4", | ||
"//third_party:mockito", | ||
"//third_party:truth", | ||
"//third_party/protobuf:protobuf_java", | ||
], | ||
) | ||
|
||
java_test( | ||
name = "WorkerTests", | ||
size = "small", | ||
data = [ | ||
"//src/test/java/com/google/devtools/build/lib:embedded_scripts", | ||
], | ||
test_class = "com.google.devtools.build.lib.AllTests", | ||
runtime_deps = [ | ||
":WorkerTests_lib", | ||
"//src/test/java/com/google/devtools/build/lib:test_runner", | ||
], | ||
) | ||
|
||
java_test( | ||
name = "WorkRequestHandlerTest", | ||
srcs = ["WorkRequestHandlerTest.java"], | ||
deps = [ | ||
"//src/main/java/com/google/devtools/build/lib/worker:work_request_handlers", | ||
"//src/main/protobuf:worker_protocol_java_proto", | ||
"//third_party:junit4", | ||
"//third_party:mockito", | ||
"//third_party:truth", | ||
], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters