rules_jvm icon indicating copy to clipboard operation
rules_jvm copied to clipboard

Allow configuring engine filters

Open marcphilipp opened this issue 3 years ago • 5 comments

This commit introduces include_engines and exclude_engines arguments on java_test_suite and java_junit5_test which can be used to configure which engines should be used. It replaces the previously hard-coded list of engines in ActualRunner.

marcphilipp avatar Oct 29 '22 19:10 marcphilipp

For context: this allows running test with arbitrary test engines, e.g. jqwik.

marcphilipp avatar Oct 29 '22 19:10 marcphilipp

I wonder if there's a way to detect the engines that are available without us needing to list them?

shs96c avatar Nov 09 '22 11:11 shs96c

Apparently there is, and all we need to do is to use the ServiceLoader. I've created #111 to do this.

shs96c avatar Nov 09 '22 14:11 shs96c

Do you still want to be able to set these properties? I think we can probably control the engines by changing the dependencies of a test rule....

shs96c avatar Nov 09 '22 14:11 shs96c

#111 is totally unnecessary. There's no need to set an include filter unless you want to be explicit about which engines from the runtime classpath to include (or exclude). There are use cases where an engine is on the classpath but it should only be used as a library etc. For those it's useful to be able to set include/exclude filters explicitly.

I think #111 should be reverted and this PR should be merged instead. Please let me know if you want me to elaborate more.

marcphilipp avatar Nov 11 '22 14:11 marcphilipp

@shs96c No worries and thanks for the detailed feedback! I've addressed all your feedback, merged in main, and added documentation. If you decide to merge the PR, please squash all commits. PTAL!

marcphilipp avatar Feb 16 '23 15:02 marcphilipp