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.

Android Test Orchestrator support of JUnit parameterised tests

See original GitHub issue

Description

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:closed
  • Created 5 years ago
  • Reactions:2
  • Comments:6

github_iconTop GitHub Comments

4reactions
dbarwaczcommented, Jan 31, 2020

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.

2reactions
brettchabotcommented, May 20, 2020

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to run parameterized tests with Android Test ...
I'm trying to run parameterized tests using Android Test Orchestrator. But for some reason parameterized tests won't start.
Read more >
AndroidJUnitRunner - Android Developers
Android Test Orchestrator collects JUnit tests at the beginning of your test suite run, but it then executes each test separately, in its...
Read more >
[Solved]-Unable to run parameterized tests with Android Test ...
Coding example for the question Unable to run parameterized tests with Android Test Orchestrator-kotlin.
Read more >
How to Write JUnit 5 Parameterized Tests on Android - Medium
Apart from that, we used Java Streams! If your tests are in test directory they are not going to be running on an...
Read more >
Espresso configuration parameters - Perfecto Help
Indicates that plugin should execute each of the app tests in a separate process using the Android Test Orchestrator. Find JUnitRunner's Orchestrator ......
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