IInvocationExecution
public
interface
IInvocationExecution
| com.android.tradefed.invoker.IInvocationExecution |
Giao diện mô tả những hành động sẽ được thực hiện trong quá trình gọi. Bản thân lệnh gọi TestInvocation sẽ đảm bảo thứ tự của các lệnh gọi.
Tóm tắt
Phương thức công khai | |
|---|---|
default
void
|
cleanUpBuilds(IInvocationContext context, IConfiguration config)
Thực thi bước dọn dẹp build_provider. |
default
void
|
doCleanUp(IInvocationContext context, IConfiguration config, Throwable exception)
Thực hiện bước target_preparer và multi_target_preparer cleanUp. |
default
void
|
doSetup(TestInformation testInfo, IConfiguration config, ITestLogger logger)
Thực hiện bước setUp target_preparer và multi_target_preparer. |
default
void
|
doTeardown(TestInformation testInfo, IConfiguration config, ITestLogger logger, Throwable exception)
Thực hiện bước tháo rời target_preparer và multi_target_preparer. |
default
boolean
|
fetchBuild(TestInformation testInfo, IConfiguration config, IRescheduler rescheduler, ITestInvocationListener listener)
Thực thi bước build_provider của lệnh gọi. |
abstract
void
|
reportLogs(ITestDevice device, ITestLogger logger, TestInvocation.Stage stage)
Báo cáo một số nhật ký thiết bị ở các giai đoạn khác nhau của lệnh gọi. |
default
void
|
runDevicePostInvocationTearDown(IInvocationContext context, IConfiguration config, Throwable exception)
Gọi |
default
void
|
runDevicePreInvocationSetup(IInvocationContext context, IConfiguration config, ITestLogger logger)
Gọi |
default
void
|
runTests(TestInformation info, IConfiguration config, ITestInvocationListener listener)
Chạy kiểm thử. |
default
boolean
|
shardConfig(IConfiguration config, TestInformation testInfo, IRescheduler rescheduler, ITestLogger logger)
Cố gắng phân chia cấu hình thành các cấu hình phụ để lên lịch lại chạy song song trên nhiều tài nguyên. |
Phương thức công khai
cleanUpBuilds
public void cleanUpBuilds (IInvocationContext context, IConfiguration config)
Thực thi bước dọn dẹp build_provider. Liên quan đến việc tìm nạp bản dựng.
| Tham số | |
|---|---|
context |
IInvocationContext: IInvocationContext của lời gọi. |
config |
IConfiguration: IConfiguration của lần chạy kiểm thử này. |
doCleanUp
public void doCleanUp (IInvocationContext context, IConfiguration config, Throwable exception)
Thực hiện bước target_preparer và multi_target_preparer cleanUp. Thiết bị có dọn dẹp không.
| Tham số | |
|---|---|
context |
IInvocationContext: IInvocationContext của lời gọi. |
config |
IConfiguration: IConfiguration của lần chạy kiểm thử này. |
exception |
Throwable: ngoại lệ ban đầu do quá trình chạy kiểm thử khai báo. |
doSetup
public void doSetup (TestInformation testInfo, IConfiguration config, ITestLogger logger)
Thực hiện bước setUp target_preparer và multi_target_preparer. Thiết lập tất cả các thiết bị cần thiết để chạy kiểm thử.
| Tham số | |
|---|---|
testInfo |
TestInformation: TestInformation của lời gọi. |
config |
IConfiguration: IConfiguration của lần chạy kiểm thử này. |
logger |
ITestLogger: ITestLogger để báo cáo nhật ký lỗi thiết lập. |
| Gửi | |
|---|---|
|
com.android.tradefed.device.DeviceNotAvailableException |
|
com.android.tradefed.targetprep.BuildError |
|
com.android.tradefed.targetprep.TargetSetupError |
BuildError |
|
DeviceNotAvailableException |
|
TargetSetupError |
|
doTeardown
public void doTeardown (TestInformation testInfo, IConfiguration config, ITestLogger logger, Throwable exception)
Thực hiện bước tháo rời target_preparer và multi_target_preparer. Thiết bị có bị tháo rời liên quan đến quá trình thiết lập không.
| Tham số | |
|---|---|
testInfo |
TestInformation: TestInformation của lời gọi. |
config |
IConfiguration: IConfiguration của lần chạy kiểm thử này. |
logger |
ITestLogger: ITestLogger để báo cáo nhật ký. |
exception |
Throwable: ngoại lệ ban đầu do quá trình chạy kiểm thử khai báo. |
| Gửi | |
|---|---|
|
java.lang.Throwable |
Throwable |
|
fetchBuild
public boolean fetchBuild (TestInformation testInfo, IConfiguration config, IRescheduler rescheduler, ITestInvocationListener listener)
Thực thi bước build_provider của lệnh gọi.
| Tham số | |
|---|---|
testInfo |
TestInformation: TestInformation của lời gọi. |
config |
IConfiguration: IConfiguration của lần chạy kiểm thử này. |
rescheduler |
IRescheduler: IRescheduler, để lên lịch lại các phần của lời gọi để thực thi trên(các) tài nguyên khác |
listener |
ITestInvocationListener: ITestInvocation để báo cáo lỗi tải xuống bản dựng. |
| Giá trị trả về | |
|---|---|
boolean |
True nếu chúng ta tải bản dựng xuống thành công, false nếu không. |
| Gửi | |
|---|---|
|
com.android.tradefed.build.BuildRetrievalError |
|
com.android.tradefed.device.DeviceNotAvailableException |
BuildRetrievalError |
|
DeviceNotAvailableException |
|
reportLogs
public abstract void reportLogs (ITestDevice device, ITestLogger logger, TestInvocation.Stage stage)
Báo cáo một số nhật ký thiết bị ở các giai đoạn khác nhau của lệnh gọi. Ví dụ: logcat.
| Tham số | |
|---|---|
device |
ITestDevice: Thiết bị để báo cáo nhật ký. |
logger |
ITestLogger: Trình ghi nhật ký cho nhật ký. |
stage |
TestInvocation.Stage: Giai đoạn của lời gọi mà chúng ta đang ở. |
runDevicePostInvocationTearDown
public void runDevicePostInvocationTearDown (IInvocationContext context, IConfiguration config, Throwable exception)
Gọi ITestDevice.postInvocationTearDown(Throwable) cho từng phần thiết bị của lệnh gọi.
| Tham số | |
|---|---|
context |
IInvocationContext: IInvocationContext của lời gọi. |
config |
IConfiguration: IConfiguration của lần chạy kiểm thử này. |
exception |
Throwable: ngoại lệ ban đầu do quá trình kiểm thử đang chạy gửi đi (nếu có). |
runDevicePreInvocationSetup
public void runDevicePreInvocationSetup (IInvocationContext context, IConfiguration config, ITestLogger logger)
Gọi ERROR(ITestDevice.preInvocationSetup(IBuildInfo)/com.android.tradefed.device.ITestDevice#preInvocationSetup(com.android.tradefed.build.IBuildInfo) ITestDevice.preInvocationSetup(IBuildInfo)) cho từng phần thiết bị của lệnh gọi.
| Tham số | |
|---|---|
context |
IInvocationContext: IInvocationContext của lời gọi. |
config |
IConfiguration: IConfiguration của lần chạy kiểm thử này. |
logger |
ITestLogger: ITestLogger để báo cáo nhật ký. |
| Gửi | |
|---|---|
|
com.android.tradefed.device.DeviceNotAvailableException |
|
com.android.tradefed.targetprep.TargetSetupError |
DeviceNotAvailableException |
|
TargetSetupError |
|
runTests
public void runTests (TestInformation info, IConfiguration config, ITestInvocationListener listener)
Chạy kiểm thử.
| Tham số | |
|---|---|
info |
TestInformation: TestInformation để chạy kiểm thử. |
config |
IConfiguration: IConfiguration cần chạy |
listener |
ITestInvocationListener: ITestInvocationListener kết quả kiểm thử |
| Gửi | |
|---|---|
|
java.lang.Throwable |
Throwable |
|
shardConfig
public boolean shardConfig (IConfiguration config, TestInformation testInfo, IRescheduler rescheduler, ITestLogger logger)
Cố gắng phân chia cấu hình thành các cấu hình phụ để lên lịch lại chạy song song trên nhiều tài nguyên.
Nếu số lượng phân đoạn lớn hơn 1, thì hệ thống sẽ chỉ tạo cấu hình cho từng phân đoạn bằng cách đặt chỉ mục phân đoạn và lên lịch lại các phân đoạn đó. Nếu bạn không đặt số lượng phân đoạn,thì số lượng này sẽ quay về IShardHelper.shardConfig.
| Tham số | |
|---|---|
config |
IConfiguration: IConfiguration hiện tại. |
testInfo |
TestInformation: TestInformation lưu giữ thông tin về các kiểm thử. |
rescheduler |
IRescheduler: IRescheduler. |
logger |
ITestLogger: ITestLogger dùng để ghi tệp nhật ký trong quá trình phân đoạn. |
| Giá trị trả về | |
|---|---|
boolean |
true nếu thử nghiệm được phân đoạn. Nếu không, hãy trả về false |