question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Parameterized Instrumented tests mangle test output

See original GitHub issue

E.g. Android Studio displays them as:

Screen Shot 2019-09-24 at 6 39 32 PM

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/):

StupidConnectedTest.java.txt

Sample build.gradle: build.gradle.txt

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
mannodermauscommented, Nov 20, 2019

Released in 1.2.0!

1reaction
mannodermauscommented, Nov 15, 2019

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found