Closed
Description
The implementation is fundamentally flawed.
For example, I've just spent a few hours trying to figure out why my test classes were not being properly named for their package (TLD of kiwi
), in my specific case, tests in src/test/java/kiwi/**/*
. All country-code TLD based packages would fail too.
Bazel itself appears to use a heuristic based on the maven-style layout of a prefix of src/test/java/
which is even noted in a comment!
The simplest mitigation is probably to allow the prefix to be specified in the rule. E.g.
java_test_suite(
name = "test",
size = "small",
srcs = glob(["src/test/java/**/*"]),
src_prefix = "src/test/java",
resources = glob(["src/test/resources/**/*"]),
runner = "junit5",
runtime_deps = JUNIT5_DEPS,
deps = [
":lib",
artifact("org.junit.jupiter:junit-jupiter-api"),
],
)
Metadata
Metadata
Assignees
Labels
No labels