-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bump to JUnit 5.11 M1, add FieldSource tests & rely on JUnit Platform for test method discovery #329
Conversation
fdc3d16
to
8e9c698
Compare
protected val jupiterTestAnnotations = listOf( | ||
Test::class.java, | ||
TestFactory::class.java, | ||
RepeatedTest::class.java, | ||
TestTemplate::class.java, | ||
ParameterizedTest::class.java, | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of this hardcoded list, should the finder look for symbols annotated with @Testable
(or another annotation that is itself annotated @Testable
instead? See the Jupiter docs:
In order to facilitate test discovery within IDEs and tools prior to launching the JUnit Platform,
TestEngine
implementations are encouraged to make use of the@Testable
annotation. For example, the@Test
and@TestFactory
annotations in JUnit Jupiter are meta-annotated with @testable. Consult the Javadoc for @Testable for further details.https://junit.org/junit5/docs/current/user-guide/#test-engines-custom
This should help to support other test frameworks' TestEngine
s.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The idea behind this declaration is to allow introspection of Jupiter's annotations by name, even for devices that don't support Java 8 yet. If we look inside of these annotations too much, we risk crashing because of unsupported features (e.g. when detecting @Repeatable
in the meta-annotations). I do like the idea of opening up the scope beyond just Jupiter for devices that do support JUnit 5, though, so I cleaned it up a little in the latest commits. Now the annotations are only looked up for old devices and the newer ones only use what the discovery process of the platform returns to it, removing redundancy. ✨
That being said, most of the engines I was able to test require APIs that aren't available on Android (Spek, Cucumber). But hey: At least our Android bridge tried to load them in the first place - I call that a first step win. 🤷♂️
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the explanation! That all makes sense to me!
This should pave the road for supporting non-Jupiter test engines for instrumentation tests
No description provided.