rules_jvm icon indicating copy to clipboard operation
rules_jvm copied to clipboard

Gazelle support for junit4

Open gn-harness opened this issue 3 years ago • 1 comments

Hey! I am trying out gazelle java extension for https://github.com/harness/harness-core

After running the tool, I noticed that the java_test_suite it generates has runner5 hardcoded and its adds respective runtime_deps also. We are still using junit4 -- can I somehow configure it to generate runner for junit4 without any runtime deps?

gn-harness avatar Jun 29 '22 01:06 gn-harness

It would be possible to determine which runner to use by looking for the presence of the org.junit.Test annotation in a test file. If it's there, the chances are that this is a junit4 test.

Having said that, junit5 can run those tests with the vintage runner, so we should also provide a config option in build files that allows one to determine the runner to use.

shs96c avatar Jun 29 '22 10:06 shs96c