1

This is how I'm using the java_test_suite:

(https://github.com/bazel-contrib/rules_jvm#java_test_suite)

java_test_suite(
name = "everything-tests",
srcs = glob(["src/test/java/**/*.java"]),
runner = "junit5",
test_suffixes = ["Tests.java"],
runtime_deps = JUNIT5_DEPS,
deps = [
    ":everything",
    ...
] + deps,
)

However, what it is doing is that java_test_suite is iterating over each srcs and creating a java_test for it. The problem becomes when one of my tests has a dependency on another test class.

For example, I have a test class which extends another abstract test class like so:

public class CustomTimerTests extends BaseTimerTests

But CustomTimerTests is failing as it is not able to find BaseTimerTests because java_test_suite does not let me add BaseTimerTests as one of the sources for CustomTimerTests.

Anyone knows how to fix it?

Ken White
  • 123,280
  • 14
  • 225
  • 444
90abyss
  • 7,037
  • 19
  • 63
  • 94
  • Here in this [reference](https://stackoverflow.com/questions/46365464/how-to-run-all-tests-in-bazel-from-a-single-java-test-rule) you can find different ways of taking the src files. – SG_Bazel Dec 07 '22 at 14:02

0 Answers0