StrictShardHelper

public class StrictShardHelper
extends ShardHelper

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


กลยุทธ์การแบ่งข้อมูลเพื่อสร้าง Shard ที่เข้มงวดซึ่งจะไม่รายงานร่วมกัน

สรุป

เครื่องมือสร้างสาธารณะ

StrictShardHelper()

เมธอดสาธารณะ

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

พยายามแบ่งการกำหนดค่าออกเป็นการกำหนดค่าย่อยเพื่อกำหนดเวลาใหม่ให้ทำงานใน ทรัพยากรหลายรายการแบบขนาน

วิธีการที่ได้รับการป้องกัน

boolean shardConfigDynamic(IConfiguration config, TestInformation testInfo, IRescheduler rescheduler, ITestLogger logger)
boolean shardConfigInternal(IConfiguration config, TestInformation testInfo, IRescheduler rescheduler, ITestLogger logger)
List<List<IRemoteTest>> splitTests(List<IRemoteTest> fullList, int shardCount, boolean useEvenModuleSharding)

แบ่งรายการการทดสอบที่จะเรียกใช้ตามความเหมาะสมของการติดตั้งใช้งาน

เครื่องมือสร้างสาธารณะ

StrictShardHelper

public StrictShardHelper ()

เมธอดสาธารณะ

shardConfig

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

พยายามแบ่งการกำหนดค่าออกเป็นการกำหนดค่าย่อยเพื่อกำหนดเวลาใหม่ให้ทำงานใน ทรัพยากรหลายรายการแบบขนาน

การดำเนินการ Shard ที่สำเร็จจะทำให้การกำหนดค่าปัจจุบันว่างเปล่า และไม่ควรดำเนินการเรียกใช้ต่อ

พารามิเตอร์
config IConfiguration: IConfiguration ปัจจุบัน

testInfo TestInformation: TestInformation ที่มีข้อมูลการทดสอบ

rescheduler IRescheduler: IRescheduler

logger ITestLogger

การคืนสินค้า
boolean จริง หากมีการแบ่งการทดสอบ ไม่เช่นนั้น ให้ส่งคืน false

วิธีการที่ได้รับการป้องกัน

shardConfigDynamic

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

พารามิเตอร์
config IConfiguration

testInfo TestInformation

rescheduler IRescheduler

logger ITestLogger

การคืนสินค้า
boolean

shardConfigInternal

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

พารามิเตอร์
config IConfiguration

testInfo TestInformation

rescheduler IRescheduler

logger ITestLogger

การคืนสินค้า
boolean

splitTests

protected List<List<IRemoteTest>> splitTests (List<IRemoteTest> fullList, 
                int shardCount, 
                boolean useEvenModuleSharding)

แบ่งรายการการทดสอบที่จะเรียกใช้ตามความเหมาะสมของการติดตั้งใช้งาน การแบ่งข้อมูลต้องสอดคล้องกัน คุณสามารถแสดงผลรายการที่ว่างเปล่าได้หากไม่สามารถเรียกใช้การทดสอบใดๆ ใน Shard

ใช้การตั้งค่านี้เพื่อระบุการแบ่งพาร์ติชันชุดโปรแกรมทดสอบ การติดตั้งใช้งานเริ่มต้น จะพยายามปรับสมดุลจำนวน IRemoteTest ต่อชาร์ดให้มากที่สุด เป็นขั้นตอนแรก จากนั้นจะใช้เกณฑ์รองหรือคำแนะนำในการเรียกใช้เพื่อปรับรายการอีกเล็กน้อย

พารามิเตอร์
fullList List: รายการแบบเต็มเริ่มต้นของ IRemoteTest ที่มีการทดสอบทั้งหมดที่ต้องเรียกใช้

shardCount int: จำนวน Shard ทั้งหมดที่ต้องเรียกใช้

useEvenModuleSharding boolean: whether to use a strategy that evenly distributes number of modules across shards

การคืนสินค้า
List<List<IRemoteTest>> รายการของรายการ IRemoteTests ที่กำหนดให้กับแต่ละ Shard ขนาดของรายการ จะเป็น shardCount