IShardableTest

public interface IShardableTest
implements IRemoteTest

com.android.tradefed.testtype.IShardableTest


可拆分为可单独执行的子测试的 IRemoteTest。拆分为子测试应具有确定性,并且每个子测试应相互独立,以便在不同的主机上执行不同的分片。

摘要

公共方法

default Collection<IRemoteTest> split(Integer shardCountHint, TestInformation testInfo)

split(int) 的替代版本,还提供了一个 TestInformation,其中包含创建分片的父级的早期信息。

default Collection<IRemoteTest> split()

将测试分片为可单独运行的块。

default Collection<IRemoteTest> split(int shardCountHint)

split() 的替代版本,还提供尝试运行的 shardCount。

公共方法

分解

public Collection<IRemoteTest> split (Integer shardCountHint, 
                TestInformation testInfo)

split(int) 的替代版本,还提供了一个 TestInformation,其中包含创建分片的父级的早期信息。如果需要在分片期间访问设备或 build 信息等内容,此方法会非常有用。

参数
shardCountHint Integer:尝试分片的数量。

testInfo TestInformation:父级 TestInformation

返回
Collection<IRemoteTest> 要单独执行的子测试集合,如果测试目前无法分片,则为 null

分解

public Collection<IRemoteTest> split ()

将测试分片为可单独运行的块。

此方法必须是确定性的,并且对于相同的输入始终返回相同的 IRemoteTest 列表。

此方法将在测试作业之前调用,因此注入的依赖项(例如 IDeviceTestITestDevice)可能为 null。

返回
Collection<IRemoteTest> 要单独执行的子测试集合,如果测试目前无法分片,则为 null

分解

public Collection<IRemoteTest> split (int shardCountHint)

split() 的替代版本,还提供尝试运行的 shardCount。这对于有时无法任意决定的某些测试运行程序非常有用。

参数
shardCountHint int:尝试分片的数量。

返回
Collection<IRemoteTest> 要单独执行的子测试集合,如果测试目前无法分片,则为 null