Open kartik1o opened 1 month ago
Ignored tests on Android historically didn't return any status so I believe from what you're saying this is still the case. For example tests containing ignore annotation have a special handling in vendor android implementation for this reason.
I understand your use case, but the only thing I can suggest here is to separate the test runs and filter the tests by annotation. This is the cleanest approach here.
Merging these into one test run will be problematic to support and doesn't bring any performance or stability improvements, it just brings unnecessary complexity.
Implementation of such a feature would require filtering configuration per pool or some filtering that is always applied to all the test runs which is intrusive to users.
If you can propose a solution that doesn't involve UX degradation and is also simple to support considering the limitations of android - I'm happy to discuss.
But in general all marathon test runs are homogeneous, so diverging from this is strange.
Another way to achieve what you want would be a custom junit4 rule that throws assumption failure instead of being ignored by the framework. This way status will be reported back always and there are no changes necessary on the test runner side
Is your feature request related to a problem? Please describe. CustomFilter provides the ability to filter test run-time based on the characteristics of the device under test.
One use case we have -> We have a device pool consisting of tablet and phone devices. we want a test to be only executed on phone devices and similarly for tablet devices.
testFunctionOnTablet()
should run on a tablet device andtestFunctionOnPhone()
should run on a phone device with single gradle invocation../gradlew connectedDebugAndroidTest -Pandroid.testInstrumentationRunnerArguments.class=com.sampleapp.espresso.DeviceTypeTest -Pandroid.testInstrumentationRunnerArguments.filter=com.sampleapp.espresso.filter.TestDeviceFilter
Describe the solution you'd like It would be nice if Marathon supports this filtering as well. or, is there any marathon filtering I can use to achieve this desired result?
Describe alternatives you've considered Is there a way to achieve this with a custom RunListener class?
Additional context While trying to test this feature with Marathon, I noticed that Test Runner reported the test in the started phase but ended up with no test status being reported, and because of this marathon considered the test as an INCOMPLETE Test.