IInvocationExecution

public interface IInvocationExecution

com.android.tradefed.invoker.IInvocationExecution


ממשק שמתאר את הפעולות שיתבצעו כחלק מהפעלה. ההפעלה TestInvocation עצמה מבטיחה את הסדר של הקריאות.

סיכום

שיטות ציבוריות

default void cleanUpBuilds(IInvocationContext context, IConfiguration config)

מריצים את שלב הניקוי build_provider.

default void doCleanUp(IInvocationContext context, IConfiguration config, Throwable exception)

מריצים את שלב הניקוי של target_preparer ושל multi_target_preparer.

default void doSetup(TestInformation testInfo, IConfiguration config, ITestLogger logger)

מריצים את שלב ההגדרה של target_preparer ושל multi_target_preparer.

default void doTeardown(TestInformation testInfo, IConfiguration config, ITestLogger logger, Throwable exception)

מריצים את שלב הפירוק של target_preparer ושל multi_target_preparer.

default boolean fetchBuild(TestInformation testInfo, IConfiguration config, IRescheduler rescheduler, ITestInvocationListener listener)

מריצים את השלב build_provider של ההפעלה.

abstract void reportLogs(ITestDevice device, ITestLogger logger, TestInvocation.Stage stage)

דיווח על יומני מכשיר מסוימים בשלבים שונים של ההפעלה.

default void runDevicePostInvocationTearDown(IInvocationContext context, IConfiguration config, Throwable exception)

מפעילים את ITestDevice.postInvocationTearDown(Throwable) לכל חלק של המכשיר בקריאה.

default void runDevicePreInvocationSetup(IInvocationContext context, IConfiguration config, ITestLogger logger)

מפעילים את ERROR(ITestDevice.preInvocationSetup(IBuildInfo)/com.android.tradefed.device.ITestDevice#preInvocationSetup(com.android.tradefed.build.IBuildInfo) ITestDevice.preInvocationSetup(IBuildInfo)) לכל חלק של המכשיר בקריאה.

default void runTests(TestInformation info, IConfiguration config, ITestInvocationListener listener)

הרצת הבדיקה.

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

נסו לפצל את ההגדרה להגדרות משנה, כדי לתזמן מחדש את ההרצה בכמה משאבים במקביל.

שיטות ציבוריות

cleanUpBuilds

public void cleanUpBuilds (IInvocationContext context, 
                IConfiguration config)

מריצים את שלב הניקוי build_provider. משויך לאחזור ה-build.

פרמטרים
context IInvocationContext: ה-IInvocationContext של ההפעלה.

config IConfiguration: ה-IConfiguration של הריצת הבדיקה הזו.

doCleanUp

public void doCleanUp (IInvocationContext context, 
                IConfiguration config, 
                Throwable exception)

מריצים את שלב הניקוי של target_preparer ושל multi_target_preparer. האם המכשירים ניקו.

פרמטרים
context IInvocationContext: ה-IInvocationContext של ההפעלה.

config IConfiguration: ה-IConfiguration של הריצת הבדיקה הזו.

exception Throwable: חריגה המקורית שהופקה על ידי הבדיקה שפועלת.

doSetup

public void doSetup (TestInformation testInfo, 
                IConfiguration config, 
                ITestLogger logger)

מריצים את שלב ההגדרה של target_preparer ושל multi_target_preparer. מגדירים את כל המכשירים הנדרשים להרצת הבדיקה.

פרמטרים
testInfo TestInformation: ה-TestInformation של ההפעלה.

config IConfiguration: ה-IConfiguration של הריצת הבדיקה הזו.

logger ITestLogger: ITestLogger כדי לדווח על יומני כשלים בהגדרה.

זריקות
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)

מריצים את שלב הפירוק של target_preparer ושל multi_target_preparer. האם המכשירים שמשויכים להגדרה מפורקים.

פרמטרים
testInfo TestInformation: ה-TestInformation של ההפעלה.

config IConfiguration: ה-IConfiguration של הריצת הבדיקה הזו.

logger ITestLogger: ITestLogger לדיווח על יומנים.

exception Throwable: חריגה המקורית שהופקה על ידי הבדיקה שפועלת.

זריקות
ניתן להשלכה

fetchBuild

public boolean fetchBuild (TestInformation testInfo, 
                IConfiguration config, 
                IRescheduler rescheduler, 
                ITestInvocationListener listener)

מריצים את השלב build_provider של ההפעלה.

פרמטרים
testInfo TestInformation: ה-TestInformation של ההפעלה.

config IConfiguration: ה-IConfiguration של הריצת הבדיקה הזו.

rescheduler IRescheduler: IRescheduler, כדי לתזמן מחדש חלקים מהקריאה להפעלה לביצוע במשאבים אחרים

listener ITestInvocationListener: ITestInvocation כדי לדווח על כשלים בהורדת גרסאות build.

החזרות
boolean הערך True אם הורדנו את ה-build בהצלחה, אחרת הערך False.

זריקות
com.android.tradefed.build.BuildRetrievalError
com.android.tradefed.device.DeviceNotAvailableException
BuildRetrievalError
DeviceNotAvailableException

reportLogs

public abstract void reportLogs (ITestDevice device, 
                ITestLogger logger, 
                TestInvocation.Stage stage)

דיווח על יומני מכשיר מסוימים בשלבים שונים של ההפעלה. לדוגמה: logcat.

פרמטרים
device ITestDevice: המכשיר שממנו רוצים לדווח על יומנים.

logger ITestLogger: יומן הרישום של היומנים.

stage TestInvocation.Stage: השלב שבו נמצאת ההפעלה.

runDevicePostInvocationTearDown

public void runDevicePostInvocationTearDown (IInvocationContext context, 
                IConfiguration config, 
                Throwable exception)

מפעילים את ITestDevice.postInvocationTearDown(Throwable) לכל חלק של המכשיר בקריאה.

פרמטרים
context IInvocationContext: ה-IInvocationContext של ההפעלה.

config IConfiguration: ה-IConfiguration של הריצת הבדיקה הזו.

exception Throwable: חריגה מקורית שהופקה על ידי הבדיקה שפועלת, אם יש כזו.

runDevicePreInvocationSetup

public void runDevicePreInvocationSetup (IInvocationContext context, 
                IConfiguration config, 
                ITestLogger logger)

מפעילים את ERROR(ITestDevice.preInvocationSetup(IBuildInfo)/com.android.tradefed.device.ITestDevice#preInvocationSetup(com.android.tradefed.build.IBuildInfo) ITestDevice.preInvocationSetup(IBuildInfo)) לכל חלק של המכשיר בקריאה.

פרמטרים
context IInvocationContext: ה-IInvocationContext של ההפעלה.

config IConfiguration: ה-IConfiguration של הריצת הבדיקה הזו.

logger ITestLogger: ITestLogger לדיווח על יומנים.

זריקות
com.android.tradefed.device.DeviceNotAvailableException
com.android.tradefed.targetprep.TargetSetupError
DeviceNotAvailableException
TargetSetupError

runTests

public void runTests (TestInformation info, 
                IConfiguration config, 
                ITestInvocationListener listener)

הרצת הבדיקה.

פרמטרים
info TestInformation: ה-TestInformation שבו מריצים את הבדיקות.

config IConfiguration: ה-IConfiguration שרוצים להריץ

listener ITestInvocationListener: ITestInvocationListener של תוצאות הבדיקה

זריקות
ניתן להשלכה

shardConfig

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

נסו לפצל את ההגדרה להגדרות משנה, כדי לתזמן מחדש את ההרצה בכמה משאבים במקביל.

אם מספר השברים גדול מ-1, המערכת פשוט תיצור הגדרות לכל שבר על ידי הגדרת אינדקסים של שברים ותתזמן אותם מחדש. אם לא תגדירו את מספר השברים,המערכת תשתמש ב-IShardHelper.shardConfig.

פרמטרים
config IConfiguration: הערך הנוכחי של IConfiguration.

testInfo TestInformation: ה-TestInformation שמכיל את המידע על הבדיקות.

rescheduler IRescheduler: IRescheduler.

logger ITestLogger: ITestLogger שמשמש לרישום ביומן של קובץ במהלך חלוקה למקטעים.

החזרות
boolean הערך true אם הבדיקה חולקה למקטעים. אחרת, מחזירים את הערך false