嚴格分片助手

public class StrictShardHelper
extends ShardHelper

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


分片策略創造不一起報告的嚴格分片,

概括

公共構造函數

StrictShardHelper ()

公共方法

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

嘗試將配置分割為子配置,以便重新安排在多個資源上並行運行。

受保護的方法

splitTests ( fullList, int shardCount, boolean useEvenModuleSharding) splitTests ( fullList, int shardCount, boolean useEvenModuleSharding)

拆分要運行的測試列表,但實作認為合適。

公共構造函數

嚴格分片助手

public StrictShardHelper ()

公共方法

分片配置

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

嘗試將配置分割為子配置,以便重新安排在多個資源上並行運行。

成功的分片操作會使目前配置為空,且呼叫不應繼續。

參數
config IConfiguration :目前的IConfiguration

testInfo TestInformation :儲存測試資訊的TestInformation

rescheduler IReschedulerIRescheduler

logger ITestLogger

退貨
boolean如果測試被分片則為 true。否則回傳false

受保護的方法

分割測試

protected  splitTests ( fullList, 
                int shardCount, 
                boolean useEvenModuleSharding)

拆分要運行的測試列表,但實作認為合適。分片需要保持一致。如果分片中無法執行測試,則傳回空列表是可以接受的。

實現此目的是為了提供測試套件特定的分片。預設實現首先嘗試盡可能平衡每個分片的 IRemoteTest 數量,然後使用次要標準或執行提示對清單進行更多調整。

參數
fullList :包含所有需要執行的測試的IRemoteTest的初始完整清單。

shardCount int :需要運作的分片總數。

useEvenModuleSharding boolean :是否使用在分片之間均勻分配模組數量的策略

退貨
已分配給每個分片的IRemoteTest清單。清單大小將是 shardCount。