GranularRetriableTestWrapper

public class GranularRetriableTestWrapper
extends Object implements IRemoteTest, ITestCollector

java.lang.Object
   ↳ com.android.tradefed.testtype.suite.GranularRetriableTestWrapper


מחלקת wrapper פועלת על IRemoteTest כדי להפוך את IRemoteTest לגרעיני ברמת testcase. מבחן IRemoteTest יכול להכיל כמה מבחני שימוש. בעבר, תרחישי הבדיקה האלה נחשבו ליחידה אחת: כשמריצים את IRemoteTest, כל תרחישי הבדיקה מורצים. חלק מה-IRemoteTest (אלה שמיישמים את ITestFilterReceiver) יכולים לקבל רשימת היתרים של תרחישי בדיקה ולהריץ רק את תרחישי הבדיקה האלה. הכיתה הזו מנצלת את התכונה הקיימת ומספקת דרך גמישה יותר להפעלת חבילת מקרים לבדיקה.

  • אפשר לנסות שוב כמה פעמים (במהלך אותה הפעלה של IRemoteTest) מקרה בדיקה יחיד כדי להקטין את שיעורי הכשלים שאינם שגיאות בדיקה.
  • המערכת אוספת באופן דינמי את תרחישי הבדיקה שניסו להריץ מחדש מתוך כשלים בהרצה קודמת.

הערה:

  • כדי להריץ קבוצת משנה של מקרי בדיקה, סוג הבדיקה צריך להטמיע את הממשק ITestFilterReceiver.
  • X הוא מספר הניסיונות החוזרים המקסימלי המותאם אישית.

סיכום

כיתות מוטמעות

class GranularRetriableTestWrapper.StartEndCollector

כלי עזר לשיעור שיעזור לכם לזהות מקרים שבהם חסרים נתוני התחלה וסיום של ריצה. 

‫constructors ציבוריים

GranularRetriableTestWrapper(IRemoteTest test, ITestInvocationListener mainListener, int maxRunLimit)
GranularRetriableTestWrapper(IRemoteTest test, ModuleDefinition module, ITestInvocationListener mainListener, int maxRunLimit)
GranularRetriableTestWrapper(IRemoteTest test, ModuleDefinition module, ITestInvocationListener mainListener, int maxRunLimit, boolean useModuleResultsForwarder, boolean removeModuleBuffering, boolean collectKernelLog, int targetPreparerRetryCount)

‫methods ציבוריים

void backfillMissingEvents(ITestInvocationListener listener, FailureDescription failure)
final int getExpectedTestsCount()

חישוב מספר תרחישי הבדיקה ב-IRemoteTest.

final List<TestRunResult> getFinalTestRunResults()

מקבלים את התוצאות הממוזגות של TestRun מכל הרצה של IRemoteTest.

final Set<TestDescription> getPassedTests()
ModuleListener getResultListener()

מחזירה את ה-listener שמכיל את כל התוצאות.

int getRetryCount()
void run(TestInformation testInfo, ITestInvocationListener listener)

קביעת מועד לסדרת IRemoteTest.run(TestInformation,ITestInvocationListener).

void setCollectTestsOnly(boolean shouldCollectTest)

המתג מפעיל או משבית את מצב איסוף הבדיקות

void setDefaultLogCollectors(List<IMetricCollector> collectors)
void setInvocationContext(IInvocationContext moduleInvocationContext)

מגדירים את IInvocationContext כמאפיין GranularRetriableTestWrapper.

void setLogSaver(ILogSaver logSaver)

מגדירים את ILogSaver של המודול כמאפיין GranularRetriableTestWrapper.

void setMarkTestsSkipped(boolean skipTestCases)

מגדירים את ModuleDefinition RunStrategy כמאפיין GranularRetriableTestWrapper.

void setMetricCollectors(List<IMetricCollector> runMetricCollectors)

מגדירים את runMetricCollector של ModuleDefinition כמאפיין GranularRetriableTestWrapper.

void setModuleConfig(IConfiguration moduleConfiguration)

מגדירים את ModuleConfig של ModuleDefinition כמאפיין GranularRetriableTestWrapper.

void setModuleId(String moduleId)

מגדירים את ModuleDefinition השם כמאפיין GranularRetriableTestWrapper.

void setRetryDecision(IRetryDecision decision)

מגדירה את ה-IRetryDecision שייעשה בו שימוש.

‫constructors ציבוריים

GranularRetriableTestWrapper

public GranularRetriableTestWrapper (IRemoteTest test, 
                ITestInvocationListener mainListener, 
                int maxRunLimit)

פרמטרים
test IRemoteTest

mainListener ITestInvocationListener

maxRunLimit int

GranularRetriableTestWrapper

public GranularRetriableTestWrapper (IRemoteTest test, 
                ModuleDefinition module, 
                ITestInvocationListener mainListener, 
                int maxRunLimit)

פרמטרים
test IRemoteTest

module ModuleDefinition

mainListener ITestInvocationListener

maxRunLimit int

GranularRetriableTestWrapper

public GranularRetriableTestWrapper (IRemoteTest test, 
                ModuleDefinition module, 
                ITestInvocationListener mainListener, 
                int maxRunLimit, 
                boolean useModuleResultsForwarder, 
                boolean removeModuleBuffering, 
                boolean collectKernelLog, 
                int targetPreparerRetryCount)

פרמטרים
test IRemoteTest

module ModuleDefinition

mainListener ITestInvocationListener

maxRunLimit int

useModuleResultsForwarder boolean

removeModuleBuffering boolean

collectKernelLog boolean

targetPreparerRetryCount int

‫methods ציבוריים

backfillMissingEvents

public void backfillMissingEvents (ITestInvocationListener listener, 
                FailureDescription failure)

פרמטרים
listener ITestInvocationListener

failure FailureDescription

getExpectedTestsCount

public final int getExpectedTestsCount ()

חישוב מספר תרחישי הבדיקה ב-IRemoteTest. הערך הזה מבדיל בין אותם תרחישי בדיקה שנקבעו להם מועדים חדשים כמה פעמים.

החזרות
int

getFinalTestRunResults

public final List<TestRunResult> getFinalTestRunResults ()

מקבלים את התוצאות הממוזגות של TestRun מכל הרצה של IRemoteTest.

החזרות
List<TestRunResult>

getPassedTests

public final Set<TestDescription> getPassedTests ()

החזרות
Set<TestDescription>

getResultListener

public ModuleListener getResultListener ()

מחזירה את ה-listener שמכיל את כל התוצאות.

החזרות
ModuleListener

getRetryCount

public int getRetryCount ()

החזרות
int

ראן

public void run (TestInformation testInfo, 
                ITestInvocationListener listener)

קביעת מועד לסדרת IRemoteTest.run(TestInformation,ITestInvocationListener).

פרמטרים
testInfo TestInformation: אובייקט TestInformation שמכיל מידע שימושי להרצת בדיקות.

listener ITestInvocationListener: מאזין ResultForwarder שמכיל moduleListener חדש לכל הפעלה.

הקפצת הודעות שגיאה (throw)
DeviceNotAvailableException

setCollectTestsOnly

public void setCollectTestsOnly (boolean shouldCollectTest)

המתג מפעיל או משבית את מצב איסוף הבדיקות

setDefaultLogCollectors

public void setDefaultLogCollectors (List<IMetricCollector> collectors)

פרמטרים
collectors List

setInvocationContext

public void setInvocationContext (IInvocationContext moduleInvocationContext)

מגדירים את IInvocationContext כמאפיין GranularRetriableTestWrapper.

פרמטרים
moduleInvocationContext IInvocationContext: רכיב ה-wrapper משתמש ב-InvocationContext כדי לאתחל את MetricCollector כשצריך.

setLogSaver

public void setLogSaver (ILogSaver logSaver)

מגדירים את ILogSaver של המודול כמאפיין GranularRetriableTestWrapper.

פרמטרים
logSaver ILogSaver: המאזינים לכל הרצת בדיקה צריכים לשמור את היומנים.

setMarkTestsSkipped

public void setMarkTestsSkipped (boolean skipTestCases)

מגדירים את ModuleDefinition RunStrategy כמאפיין GranularRetriableTestWrapper.

פרמטרים
skipTestCases boolean: האם לדלג על תרחישי הבדיקה.

setMetricCollectors

public void setMetricCollectors (List<IMetricCollector> runMetricCollectors)

מגדירים את runMetricCollector של ModuleDefinition כמאפיין GranularRetriableTestWrapper.

פרמטרים
runMetricCollectors List: רשימה של MetricCollector עבור המודול.

setModuleConfig

public void setModuleConfig (IConfiguration moduleConfiguration)

מגדירים את ModuleConfig של ModuleDefinition כמאפיין GranularRetriableTestWrapper.

פרמטרים
moduleConfiguration IConfiguration: מספק את מדדי המודול.

setModuleId

public void setModuleId (String moduleId)

מגדירים את ModuleDefinition השם כמאפיין GranularRetriableTestWrapper.

פרמטרים
moduleId String: השם של moduleDefinition.

setRetryDecision

public void setRetryDecision (IRetryDecision decision)

מגדירה את ה-IRetryDecision שייעשה בו שימוש.

פרמטרים
decision IRetryDecision