marathon icon indicating copy to clipboard operation
marathon copied to clipboard

Support Suite detection

Open Unlimity opened this issue 5 years ago • 7 comments

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:

  1. We have an android library with JUnit4 test in the main source set.
  2. We have an android application which implements this library to it's androidTest source set.
  3. We define a @Suite annotated class in the app androidTest source set and include the test from the library.
  4. 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 avatar Jun 17 '19 07:06 Unlimity

@Unlimity do you mean something like this?

Malinskiy avatar Jun 17 '19 13:06 Malinskiy

@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.

Unlimity avatar Jun 18 '19 06:06 Unlimity

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.

Malinskiy avatar Jun 18 '19 13:06 Malinskiy

#480

tagantroy avatar May 07 '21 10:05 tagantroy

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 avatar Jan 26 '22 09:01 carlosrivin

@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

Malinskiy avatar Jan 26 '22 09:01 Malinskiy

Thanks! That was my guess. Thanks for the quick reply.

carlosrivin avatar Jan 26 '22 09:01 carlosrivin