Parameterized Instrumented tests mangle test output
See original GitHub issueE.g. Android Studio displays them as:
Note that the parameterized test method and its cases seem to have been put under new mangled class headings (“String)”) instead of all grouped under the test class (StupidConnectedTest). Additionally, the parameter cases (“”, “abc”, “123”) have been mangled with the method name appended.
Checking the console output reveals the parameterized test has been similarly mangled there too, so this is not or not solely an IDE issue:
gradle_instrumentation_param_tests_output.txt
Sample instrumentation test file (src/androidTest/java/stupidSampleGradleProject/
):
Sample build.gradle: build.gradle.txt
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
AndroidJUnitRunner - Android Developers
The test runner handles loading your test package and the app under test to a device, running your tests, and reporting test results....
Read more >Android Instrumented Tests: testing types and how they work
Manual Tests have the same goal as a Functional Test, except on how they will be executed. As it's not going to be...
Read more >Parameterized Instrumented Tests for Android - Stack Overflow
The answer to AndroidJUnit4 and Parameterized tests links to a Google example for using @RunWith(Parameterized.class) . However, this is a simple unit test....
Read more >Device testing for Android - Bitrise documentation!
With Bitrise's Android virtual device testing solution, you can run UI tests on emulators without having to set up and register your own...
Read more >Start testing with the gcloud CLI | Firebase Test Lab - Google
This guide describes how to run an instrumentation, Robo, or Game Loop test using the gcloud CLI. For a complete list of gcloud...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Released in 1.2.0!
The lack of intermediate nesting is indeed attributable to a limitation with how the Android instrumentation seems to report parameterized tests. Keeping in mind that instrumentation test support is banking on the existing infrastructure, which has to map the new stuff to JUnit 4, it’s an unfortunate consequence that nesting can’t be done arbitrarily - there’s only class nodes and their direct children, the test methods.
As an alternative to the current approach, I considered making each dynamic test group its own entry on the class level (i.e. there would be
JavaInstrumentationTests
&JavaInstrumentationTests.testParameterized()
on the same level in the hierarchy). Ultimately, I decided against that, though.