IInvocationExecution

public interface IInvocationExecution

com.android.tradefed.invoker.IInvocationExecution


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

סיכום

‫methods ציבוריים

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)

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

‫methods ציבוריים

cleanUpBuilds

public void cleanUpBuilds (IInvocationContext context, 
                IConfiguration config)

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

פרמטרים
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 כדי לדווח על יומני כשל בהגדרה.

הקפצת הודעות שגיאה (throw)
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)

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

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

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

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

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

הקפצת הודעות שגיאה (throw)
java.lang.Throwable
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 אם הורדנו את הגרסה בהצלחה, אחרת False.

הקפצת הודעות שגיאה (throw)
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 לדיווח על יומנים.

הקפצת הודעות שגיאה (throw)
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 תוצאות הבדיקה

הקפצת הודעות שגיאה (throw)
java.lang.Throwable
Throwable

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