Closed ianrhamilton closed 3 years ago
Sharding is very obtuse at the moment. What you'd actually have to do is this (see https://docs.saucelabs.com/testrunner-toolkit/configuration/espresso#shardindex):
- name: "saucy barista - combined 1/2"
testOptions:
numShards: 2
shardIndex: 0
clearPackageData: true
emulators:
- name: "Android GoogleApi Emulator"
clearPackageData: true
orientation: portrait
platformVersions:
- "10.0"
- name: "saucy barista - combined 2/2"
testOptions:
numShards: 2
shardIndex: 1
clearPackageData: true
emulators:
- name: "Android GoogleApi Emulator"
clearPackageData: true
orientation: portrait
platformVersions:
- "10.0"
Effectively multiplying the suite based on the number shards you want to use, while incrementing the shardIndex
. It works this way because sharding is performed by espresso and the user in a weird manual way.
However, there's some good news in this! We are actively working on sharding automatically, so that all you have to do is specify numShards
, for which you may want to follow this PR --> https://github.com/saucelabs/saucectl/pull/343
hey @alexplischke - ah I had a feeling I may have to do that. Thanks for the reply! I'll watch the PR - that definitely seems like the best approach - would be very helpful!
Thanks :)
I am trying to shard my espresso tests using the config.yml, however, it is still being executed in a single thread on the same emulator.
My config.yml looks as follows:
Do you plan to upload any examples of sharding?
Thanks in advance, Ian