-
Notifications
You must be signed in to change notification settings - Fork 30
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
Abstract @Test method #13
Comments
The subject says Kotlin, but the code snippet is Java code. It looks like this is an issue in both languages though. I'm not sure if there's any valid reason to have I probably won't have time to take a look at this until after Google I/O next week, but I'll follow up. |
I'm at I/O this week as well. We're using dex-test-parse to power Flank. It'd be cool to meet up if our schedules align. I'm on the firebase slack if you want to chat. I worked around this issue by removing the annotation. |
I just did some testing on this in a test project, and it looks like adb instrument with the Junit4 runner DOES notice and run implementations of abstract methods that were annotated with @test, even if the concrete implementation of that method does not. So it's probably also something dex-test-parser should support, although I'm having trouble thinking of a good reason to use this functionality... |
The issue is causing problems for Flank. For Firebase Test Lab, we need the ability to filter out the abstract classes. |
that seems like a valid use case? I'm not sure there's an easy way to resolve methods in the same way. |
See #16 for a solution |
* Add support for test classes that extend other test classes This supports both abstract and concrete superclasses. Normally, test methods are found via reflection which is why methods defined from the super class would be included. This adds the same behavior to dex-test-parser to match with what is expected when running tests via adb directly. * Fix test to include the new abstract test methods in expectation * Fix naming, remove superfluous logs * Bump version to 2.0 This is a breaking change to the methods to find JUnit4 methods. Also updated the changelog to indicate this * Update changelog styling We want to have a section for the current snapshot, so people can add changes there as they are added
Fixed by #16 Note that this is only fixed for JUnit 4 tests, not JUnit 3. Since Google has deprecated the JUnit 3 base classes in the Android SDK and is now recommending that new tests should be written with the Android Testing Support Library (which is JUnit 4), it's extremely unlikely we'll fix this issue for JUnit 3 (it's not a very straightforward change at all, and would likely have a negative impact on the runtime performance of dex-test-parser). |
I think it's a bug that this test is detected as valid.
The text was updated successfully, but these errors were encountered: