marathon
marathon copied to clipboard
Support Suite detection
Currently, Marathon uses dex-test-parser
to find all the test cases available in the test APK file.
But this library only looks up tests annotated with @Test
annotation, while unable to extract the test method signatures from @Suite
annotated classes.
Here's example:
- We have an android library with JUnit4 test in the main source set.
- We have an android application which implements this library to it's androidTest source set.
- We define a
@Suite
annotated class in the app androidTest source set and include the test from the library. - Run Marathon. In this scenario Marathon does not find any available test cases. Is it possible to look up for test suites and if it's included test signatures is/are unique, add it to the test batch?
@Unlimity do you mean something like this?
@Malinskiy that's pretty much it. But the point is that the tests included in the suite are located in imported android library modules, and for some reason, dex-test-parser
is not able to detect them. I assume that's because it does not scan included classes from dependencies.
At this moment dex-test-parser
is not aware of @RunWith(Suite.class)
at all. This could be a feature proposal to that project. Could you please create test for the sample app in marathon related to the @Suite
parsing? Just need some sample to get started.
#480
Hello @Malinskiy. I've just tried to do exactly what is described here. We recently migrated from Spoon to Marathon and this is our last missing piece. If this still doesn't exist. What would be a good alternative from JUnit Suites?
@carlosrivin unfortunately this doesn't exist, but using an annotation on tests and filtering based on that annotation is the best approximation for suite behaviour
Thanks! That was my guess. Thanks for the quick reply.