android / android/android-test
Feature request: support dynamic sharding
- Dominant language
- Java
- Stars
- 1.2k
- Forks
- 342
- Avg merge
- 11h 29m
- Merged PRs (30d)
- 2
Description
### Description
According to https://source.android.com/devices/tech/test_infra/tradefed/architecture/advanced/sharding, there is something called 'dynamic sharding', which makes it possible to spread all instrumented tests across all connected devices on the local host in a dynamic fashion. (To be frank, I am not sure what "trade federation" is, this page was just found via Google search.)
As far as I can see, currently the AndroidJUnitRunner only supports the usual fashion of sharding, which is having to explicitly specify the total number of shards, as well as the shard indices: https://developer.android.com/training/testing/junit-runner.html#sharding-tests
This is painful in a CI setup, as you have to keep track of the serial numbers of each of the connect devices, and you'd have to manually split up the individual shards by defining the shard indices. It'd be so more efficient to have support for dynamic sharding, so the runner would just spread out the tests as it prefers.
If this feature is already available and I just missed it, I would appreciate getting details on how I would specify dynamic sharding using `./gradlew` commands.
Contributor guide
Research direction
Start with the AndroidJUnitRunner's existing sharding configuration and the `./gradlew` commands used to invoke it, then compare them with the linked dynamic-sharding behavior. Done means tests can be distributed across connected devices without manually assigning shard counts and indices, with the invocation documented.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- mobile, testing
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100