Google is committed to advancing racial equity for Black communities. See how.

ShardHelper

public class ShardHelper
extends Object implements IShardHelper

java.lang.Object
   ↳ com.android.tradefed.invoker.shard.ShardHelper


Helper class that handles creating the shards and scheduling them for an invocation.

Summary

Fields

public static final String LAST_SHARD_DETECTOR

public static final String SHARED_TEST_INFORMATION

Public constructors

ShardHelper()

Public methods

boolean shardConfig(IConfiguration config, TestInformation testInfo, IRescheduler rescheduler, ITestLogger logger)

Attempt to shard the configuration into sub-configurations, to be re-scheduled to run on multiple resources in parallel.

Protected methods

IGlobalConfiguration getGlobalConfiguration()

Returns the current global configuration.

void validateOptions(TestInformation testInfo, IConfiguration config)

Runs the IConfiguration#validateOptions() on the config.

Fields

LAST_SHARD_DETECTOR

public static final String LAST_SHARD_DETECTOR

SHARED_TEST_INFORMATION

public static final String SHARED_TEST_INFORMATION

Public constructors

ShardHelper

public ShardHelper ()

Public methods

shardConfig

public boolean shardConfig (IConfiguration config, 
                TestInformation testInfo, 
                IRescheduler rescheduler, 
                ITestLogger logger)

Attempt to shard the configuration into sub-configurations, to be re-scheduled to run on multiple resources in parallel.

A successful shard action renders the current config empty, and invocation should not proceed.

Parameters
config IConfiguration: the current IConfiguration.

testInfo TestInformation: the TestInformation holding the tests information.

rescheduler IRescheduler: the IRescheduler

logger ITestLogger

Returns
boolean true if test was sharded. Otherwise return false

Protected methods

getGlobalConfiguration

protected IGlobalConfiguration getGlobalConfiguration ()

Returns the current global configuration.

Returns
IGlobalConfiguration

validateOptions

protected void validateOptions (TestInformation testInfo, 
                IConfiguration config)

Runs the IConfiguration#validateOptions() on the config.

Parameters
testInfo TestInformation

config IConfiguration