IShardableTest

public interface IShardableTest
implements IRemoteTest

com.android.tradefed.testtype.IShardableTest
Known Indirect Subclasses
AndroidJUnitTest A Test that runs an instrumentation test package on given device using the android.support.test.runner.AndroidJUnitRunner. 
GTest A Test that runs a native test package on given device. 
HostTest A test runner for JUnit host based tests. 
ITestSuite Abstract class used to run Test Suite. 
InstalledInstrumentationsTest Runs all instrumentation found on current device. 
StubTest No-op empty test implementation. 
TfSuiteRunner Implementation of ITestSuite which will load tests from TF jars res/config/suite/ folder. 
XmlDefsTest Runs a set of instrumentation test's defined in test_defs.xml files. 


A IRemoteTest that can be split into separately executable sub-tests. The splitting into sub-tests is expected to be deterministic and each sub-test should be independent in order to allow for execution of different shards on different hosts.

Summary

Public methods

default Collection<IRemoteTest> split()

Shard the test into separately runnable chunks.

default Collection<IRemoteTest> split(int shardCountHint)

Alternative version of split() which also provides the shardCount that is attempted to be run.

Public methods

split

Collection<IRemoteTest> split ()

Shard the test into separately runnable chunks.

This must be deterministic and always return the same list of IRemoteTests for the same input.

This will be called before test execution, so injected dependencies (such as the ITestDevice for IDeviceTests) may be null.

Returns
Collection<IRemoteTest> a collection of subtests to be executed separately or null if test is not currently shardable

split

Collection<IRemoteTest> split (int shardCountHint)

Alternative version of split() which also provides the shardCount that is attempted to be run. This is useful for some test runner that cannot arbitrarly decide sometimes.

Parameters
shardCountHint int: the attempted shard count.

Returns
Collection<IRemoteTest> a collection of subtests to be executed separately or null if test is not currently shardable