How to execute tests against only 1 shard of X shards?
See original GitHub issueHow can I have marathon split up tests in a deterministic way? For example, let’s say a module has 100 tests, I want to split them into 4 different shards, and run tests against one of those shards (so only 25 of the tests)?
previously I did this with Spoon using --numShards 4 --shard-index 0
Issue Analytics
- State:
- Created 3 years ago
- Comments:14 (6 by maintainers)
Top Results From Across the Web
Speed up your Jest tests with shards | by Max Freundlich
Matrix build with shards. Let's say our yarn test script simply executes jest and our workflow is structured as so: name: Shard Demo...
Read more >Speed up XCUI tests | BrowserStack Docs
Speed up your XCUI mobile automation tests on BrowserStack App Automate. Run tests ... Each shard can then be executed in parallel on...
Read more >cat shards API | Elasticsearch Guide [8.5] | Elastic
Before a shard is available for use, it goes through an INITIALIZING state. You can use the cat shards API to see which...
Read more >Shards failed - no test cases inside · Issue #818 - GitHub
I only noticed One or more shards failed because there are no test cases inside. Please check your sharding configuration. in the Firebase...
Read more >How to Resolve Unassigned Shards in Elasticsearch - Datadog
If that didn't solve the issue, read on to try other solutions. Reason 1: Shard allocation is purposefully delayed. When a node leaves...
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 Free
Top 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

You can extract the list of test same way we’re doing in marathon: https://github.com/linkedin/dex-test-parser. If you don’t want to develop a separate tool for that, it’s possible to reuse your gradle build code and create a task that outputs the test methods
@ZakTaccardi marathon is not a platform, it’s just a test runner. vendor-android assumes that devices are available via adb server. If you have the resources to spin up emulators I suggest creating a basic version of mobile farm and connect the devices using
adb connectTCP/IP.Spinning up emulators locally on the agent doesn’t scale since you can’t have a huge agent to spawn 50+ emulators. And this is exactly the scenario that marathon is targeted: having 50 or even hundreds of devices that in parallel execute your tests.
I’ve built android-farm in my previous company for the purpose of infinite horizontal scaling. Take a look if you’re interested in this topic. https://github.com/agoda-com/android-farm
The approach with shards might work for small/medium setups but cannot be scaled properly. The reason behind is you’d need to setup 50+ jobs in CI. Each of them might fail and these runs are not connected and do not share devices between each other. Compare that with a pool of devices for a single run in marathon: even if a device will fail, the test run still continues since we have devices to spare. Reporting is also significantly simplified: you get 1 report rather than 50. Also, there is a problem with test runs being unbalanced: it is impossible to separate the shard in such a way that all the test runs finish at the same point of time. If they don’t finish at the same time then you’d be wasting resources of the finished test runs.