IInvocationExecution
public
interface
IInvocationExecution
com.android.tradefed.invoker.IInvocationExecution |
Giao diện mô tả các hành động sẽ được thực hiện trong một lệnh gọi. Bản thân lệnh gọi TestInvocation
đả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 thi bước cleanUp của target_preparer và multi_target_preparer. |
default
void
|
doSetup(TestInformation testInfo, IConfiguration config, ITestLogger logger)
Thực thi bước setUp target_preparer và multi_target_preparer. |
default
void
|
doTeardown(TestInformation testInfo, IConfiguration config, ITestLogger logger, Throwable exception)
Thực thi bước tháo dỡ 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 đoạn cấu hình thành các cấu hình phụ để được 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 kết với quá trình tìm nạp bản dựng.
Tham số | |
---|---|
context |
IInvocationContext : IInvocationContext của lệnh 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 thi bước cleanUp của target_preparer và multi_target_preparer. Thiết bị có dọn dẹp không.
Tham số | |
---|---|
context |
IInvocationContext : IInvocationContext của lệnh 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. |
doSetup
public void doSetup (TestInformation testInfo, IConfiguration config, ITestLogger logger)
Thực thi bước setUp target_preparer và multi_target_preparer. Tất cả các thiết bị có được thiết lập theo yêu cầu để chạy kiểm thử không.
Tham số | |
---|---|
testInfo |
TestInformation : TestInformation của lệnh 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.targetprep.TargetSetupError |
|
com.android.tradefed.targetprep.BuildError |
|
com.android.tradefed.device.DeviceNotAvailableException |
BuildError |
|
DeviceNotAvailableException |
|
TargetSetupError |
doTeardown
public void doTeardown (TestInformation testInfo, IConfiguration config, ITestLogger logger, Throwable exception)
Thực thi bước tháo dỡ target_preparer và multi_target_preparer. Các thiết bị có bị huỷ liên kết với chế độ thiết lập không.
Tham số | |
---|---|
testInfo |
TestInformation : TestInformation của lệnh 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 kiểm thử đang chạy gửi. |
Gửi | |
---|---|
|
Có thể loại bỏ |
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ệnh 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ệnh 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ệnh 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ị trong lệnh gọi.
Tham số | |
---|---|
context |
IInvocationContext : IInvocationContext của lệnh 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 ra (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ị trong lệnh gọi.
Tham số | |
---|---|
context |
IInvocationContext : IInvocationContext của lệnh 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 của kết quả kiểm thử |
Gửi | |
---|---|
|
Có thể loại bỏ |
shardConfig
public boolean shardConfig (IConfiguration config, TestInformation testInfo, IRescheduler rescheduler, ITestLogger logger)
Cố gắng phân đoạn cấu hình thành các cấu hình phụ để được 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 mảnh lớn hơn 1, thì chỉ cần tạo cấu hình cho từng phân mảnh bằng cách đặt chỉ mục phân mảnh và lên lịch lại các phân mảnh đó. Nếu bạn không đặt số lượng phân đoạn,thì số lượng này sẽ được đặt về giá trị mặc định là IShardHelper.shardConfig
.
Tham số | |
---|---|
config |
IConfiguration : IConfiguration hiện tại. |
testInfo |
TestInformation : TestInformation lưu giữ thông tin về các bài kiểm thử. |
rescheduler |
IRescheduler : IRescheduler . |
logger |
ITestLogger : ITestLogger dùng để ghi nhật ký tệp trong quá trình phân đoạn. |
Giá trị trả về | |
---|---|
boolean |
true nếu kiểm thử được phân đoạn. Nếu không, hãy trả về false |