mirror of
https://github.com/vale981/ray
synced 2025-03-04 17:41:43 -05:00
[Java] Add entry to run custom test using bazel (#26073)
Now we can run custom java tests by: 0. `cp testng_custom_template.xml testng_custom.xml` 1. Specify test class/method in `testng_custom.xml` 2. `bazel test //java:custom_test --test_output=streamed`
This commit is contained in:
parent
db6f8a2f01
commit
c4b9e9ffa5
3 changed files with 54 additions and 5 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -163,6 +163,7 @@ java/**/.settings
|
|||
java/**/.classpath
|
||||
java/**/.project
|
||||
java/runtime/native_dependencies/
|
||||
java/testng_custom.xml
|
||||
|
||||
dependency-reduced-pom.xml
|
||||
|
||||
|
|
|
@ -177,11 +177,8 @@ define_java_module(
|
|||
],
|
||||
)
|
||||
|
||||
java_binary(
|
||||
name = "all_tests",
|
||||
args = ["java/testng.xml"],
|
||||
data = ["testng.xml"],
|
||||
main_class = "org.testng.TestNG",
|
||||
java_library(
|
||||
name = "all_tests_lib",
|
||||
runtime_deps = [
|
||||
":io_ray_ray_performance_test",
|
||||
":io_ray_ray_runtime_test",
|
||||
|
@ -190,6 +187,39 @@ java_binary(
|
|||
],
|
||||
)
|
||||
|
||||
java_test(
|
||||
name = "all_tests",
|
||||
args = ["java/testng.xml"],
|
||||
data = [
|
||||
"testng.xml",
|
||||
":ray_java_pkg",
|
||||
"//:ray_pkg",
|
||||
],
|
||||
main_class = "org.testng.TestNG",
|
||||
tags = ["local"],
|
||||
runtime_deps = [
|
||||
":all_tests_lib",
|
||||
],
|
||||
)
|
||||
|
||||
# 0. `cp testng_custom_template.xml testng_custom.xml`
|
||||
# 1. Specify test class/method in `testng_custom.xml`
|
||||
# 2. `bazel test //java:custom_test --test_output=streamed`
|
||||
java_test(
|
||||
name = "custom_test",
|
||||
args = ["java/testng_custom.xml"],
|
||||
data = [
|
||||
"testng_custom.xml",
|
||||
":ray_java_pkg",
|
||||
"//:ray_pkg",
|
||||
],
|
||||
main_class = "org.testng.TestNG",
|
||||
tags = ["local"],
|
||||
runtime_deps = [
|
||||
":all_tests_lib",
|
||||
],
|
||||
)
|
||||
|
||||
# We'd better make resource files can be accessed from 3rd party library.
|
||||
# More detail please see https://github.com/ray-project/ray/pull/21641.
|
||||
java_proto_compile(
|
||||
|
|
18
java/testng_custom_template.xml
Normal file
18
java/testng_custom_template.xml
Normal file
|
@ -0,0 +1,18 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE suite SYSTEM "https://testng.org/testng-1.0.dtd">
|
||||
<suite name="RAY suite" verbose="2" configfailurepolicy="continue">
|
||||
<test name = "RAY test">
|
||||
<classes>
|
||||
<class name="io.ray.test.CrossLanguageInvocationTest">
|
||||
<methods>
|
||||
<include name="testPythonCallJavaFunction" />
|
||||
</methods>
|
||||
</class>
|
||||
</classes>
|
||||
</test>
|
||||
<listeners>
|
||||
<listener class-name="io.ray.test.RayAlterSuiteListener" />
|
||||
<listener class-name="io.ray.test.TestProgressListener" />
|
||||
<listener class-name="io.ray.test.SystemPropertyListener" />
|
||||
</listeners>
|
||||
</suite>
|
Loading…
Add table
Reference in a new issue