Android Test Orchestrator support of JUnit parameterised tests
See original GitHub issueDescription
Basically, this not exactly an issue but feature request for Android Test Orchestrator to support JUnit parameterized tests. Several tickets have been already opened for this problem on the old issue tracker but they’re currently closed and there is no update.
Steps to Reproduce
- create a JUnit test class annotated by the
@RunWith(Parameterized::class)
- create a single test inside
- add a static method annotate by the
@Parameterized.Parameters
which provides actual parameters for a test - add Test Orchestrator support to the project
- run a test either via Android Studio or via Gradle command
Expected Results
Test Orchestrator is able to see presence of parameterized tests in a project and execute them properly along with non-parameterized tests.
Actual Results
- if there is no custom name specified for a parameterized test (i.e. just
@Parameterized.Parameters
), then Test Orchestrator doesn’t see such tests at all and execute only non-parameterized - if there a custom name specified (i.e.
@Parameterized.Parameters(name = "Param1: {0}, Param2: {2}")
), then Test Orchestrator throws the “java.lang.ClassNotFoundException” for such tests.
AndroidX Test and Android OS Versions
- any Android version
- AndroidX Test Orchestrator 1.1.1
Link to a public git repo demonstrating the problem:
This link already mentioned in the previous tickets can be used as an example of incorrect behaviour: https://gist.github.com/joaocsousa/a92bbda03bfa99a7868a5e7afddf85f6
This issue isn’t related to any specific app and happens for any of them. Could you please update us is there any plans to implement this feature or how to workaround it and make these 2 cool concepts working together?
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:6
Top GitHub Comments
I agree having duplicates is bad, but do you think you could reference ‘somewhere else’ so people interested in the topic will be able to subscribe to it? Otherwise we won’t know even after feature is implemented and live.
Many apologies folks, I had misdiagnosed this issue. It turns out a simpler fix was possible, and didn’t require an orchestrator overhaul.
Fix is in 1.3.0-beta02 released today https://github.com/android/android-test/releases/tag/androidx-test-1.3.0-beta02