Owijarka do testów granularnych do ponownego odtworzenia
public class GranularRetriableTestWrapper
extends Object
implements IRemoteTest , ITestCollector
java.lang.Object | |
com.android.tradefed.testtype.suite.GranularRetriableTestWrapper |
Klasa opakowująca działa na IRemoteTest
, aby granulować IRemoteTest na poziomie przypadku testowego. IRemoteTest może zawierać wiele przypadków testowych. Wcześniej te przypadki testowe były traktowane jako całość: po uruchomieniu narzędzia IRemoteTest zostaną uruchomione wszystkie przypadki testowe. Niektóre IRemoteTest (te, które implementują ITestFilterReceiver) mogą akceptować listę dozwolonych przypadków testowych i uruchamiać tylko te przypadki testowe. Ta klasa wykorzystuje istniejącą funkcję i zapewnia bardziej elastyczny sposób uruchamiania zestawu testów.
- Pojedynczy przypadek testowy można ponawiać wiele razy (w ramach tego samego przebiegu IRemoteTest), aby zmniejszyć odsetek niepowodzeń niezwiązanych z testowaniem.
- Ponowne próby przypadków testowych są dynamicznie zbierane z błędów poprzednich uruchomień.
Notatka:
- Warunkiem wstępnym uruchomienia podzbioru przypadków testowych jest to, że typ testu powinien implementować interfejs
ITestFilterReceiver
. - X to dostosowana maksymalna liczba ponownych prób.
Streszczenie
Klasy zagnieżdżone | |
---|---|
class | GranularRetriableTestWrapper.StartEndCollector Pomocnik klasy, aby złapać brakujący początek i koniec biegu. |
Konstruktorzy publiczni | |
---|---|
GranularRetriableTestWrapper ( IRemoteTest test, ITestInvocationListener mainListener, TestFailureListener failureListener, moduleLevelListeners, int maxRunLimit) GranularRetriableTestWrapper ( IRemoteTest test, ITestInvocationListener mainListener, TestFailureListener failureListener, moduleLevelListeners, int maxRunLimit) | |
GranularRetriableTestWrapper ( IRemoteTest test, ModuleDefinition module, ITestInvocationListener mainListener, TestFailureListener failureListener, moduleLevelListeners, int maxRunLimit) GranularRetriableTestWrapper ( IRemoteTest test, ModuleDefinition module, ITestInvocationListener mainListener, TestFailureListener failureListener, moduleLevelListeners, int maxRunLimit) |
Metody publiczne | |
---|---|
final int | getExpectedTestsCount () Oblicz liczbę przypadków testowych w |
final | getFinalTestRunResults () Pobierz scalone TestRunResults z każdego uruchomienia |
ModuleListener | getResultListener () Zwraca odbiornik zawierający wszystkie wyniki. |
void | run ( TestInformation testInfo, ITestInvocationListener listener) Zaplanuj serię |
void | setCollectTestsOnly (boolean shouldCollectTest) Włącza lub wyłącza tryb zbierania testów |
void | setInvocationContext ( IInvocationContext moduleInvocationContext) Ustaw |
void | setLogSaver ( ILogSaver logSaver) Ustaw |
void | setMarkTestsSkipped (boolean skipTestCases) Ustaw |
void | setMetricCollectors ( runMetricCollectors) setMetricCollectors ( runMetricCollectors) Ustaw |
void | setModuleConfig ( IConfiguration moduleConfiguration) Ustaw ModuleConfig |
void | setModuleId (String moduleId) Ustaw nazwę |
void | setRetryDecision ( IRetryDecision decision) Ustawia |
Konstruktorzy publiczni
Owijarka testowa granularna do ponownego odtworzenia
public GranularRetriableTestWrapper (IRemoteTest test, ITestInvocationListener mainListener, TestFailureListener failureListener,moduleLevelListeners, int maxRunLimit)
Parametry | |
---|---|
test | IRemoteTest |
mainListener | ITestInvocationListener |
failureListener | TestFailureListener |
moduleLevelListeners | |
maxRunLimit | int |
Owijarka testowa granularna do ponownego odtworzenia
public GranularRetriableTestWrapper (IRemoteTest test, ModuleDefinition module, ITestInvocationListener mainListener, TestFailureListener failureListener,moduleLevelListeners, int maxRunLimit)
Parametry | |
---|---|
test | IRemoteTest |
module | ModuleDefinition |
mainListener | ITestInvocationListener |
failureListener | TestFailureListener |
moduleLevelListeners | |
maxRunLimit | int |
Metody publiczne
getExpectedTestsCount
public final int getExpectedTestsCount ()
Oblicz liczbę przypadków testowych w IRemoteTest
. Ta wartość odróżnia te same przypadki testowe, które są wielokrotnie zmieniane w harmonogramie.
Zwroty | |
---|---|
int |
getFinalTestRunResults
public finalgetFinalTestRunResults ()
Pobierz scalone TestRunResults z każdego uruchomienia IRemoteTest
.
Zwroty | |
---|---|
PobierzResultListener
public ModuleListener getResultListener ()
Zwraca odbiornik zawierający wszystkie wyniki.
Zwroty | |
---|---|
ModuleListener |
biegać
public void run (TestInformation testInfo, ITestInvocationListener listener)
Zaplanuj serię IRemoteTest#run(TestInformation, ITestInvocationListener)
.
Parametry | |
---|---|
testInfo | TestInformation : obiekt TestInformation zawierający przydatne informacje do uruchamiania testów. |
listener | ITestInvocationListener : Listener ResultForwarder, który zawiera nowy moduleListener dla każdego uruchomienia. |
Rzuty | |
---|---|
DeviceNotAvailableException |
setCollectTestsOnly
public void setCollectTestsOnly (boolean shouldCollectTest)
Włącza lub wyłącza tryb zbierania testów
setInvocationContext
public void setInvocationContext (IInvocationContext moduleInvocationContext)
Ustaw IInvocationContext
jako atrybut GranularRetriableTestWrapper
.
Parametry | |
---|---|
moduleInvocationContext | IInvocationContext : opakowanie używa InvocationContext do inicjowania MetricCollector w razie potrzeby. |
setLogSaver
public void setLogSaver (ILogSaver logSaver)
Ustaw ILogSaver
modułu jako atrybut GranularRetriableTestWrapper
.
Parametry | |
---|---|
logSaver | ILogSaver : detektory dla każdego przebiegu testu powinny zapisywać dzienniki. |
setMarkTestsPominięto
public void setMarkTestsSkipped (boolean skipTestCases)
Ustaw ModuleDefinition
RunStrategy jako atrybut GranularRetriableTestWrapper
.
Parametry | |
---|---|
skipTestCases | boolean : czy przypadki testowe powinny być pominięte. |
setMetricCollectors
public void setMetricCollectors (runMetricCollectors)
Ustaw ModuleDefinition
ModuleDefinition jako atrybut GranularRetriableTestWrapper
.
Parametry | |
---|---|
runMetricCollectors |
setModuleConfig
public void setModuleConfig (IConfiguration moduleConfiguration)
Ustaw ModuleConfig ModuleDefinition
jako atrybut GranularRetriableTestWrapper
.
Parametry | |
---|---|
moduleConfiguration | IConfiguration : podaj metryki modułu. |
setModuleId
public void setModuleId (String moduleId)
Ustaw nazwę ModuleDefinition
jako atrybut GranularRetriableTestWrapper
.
Parametry | |
---|---|
moduleId | String : nazwa modułuDefinition. |
setRetryDecision
public void setRetryDecision (IRetryDecision decision)
Ustawia IRetryDecision
do użycia.
Parametry | |
---|---|
decision | IRetryDecision |
Treść strony i umieszczone na niej fragmenty kodu podlegają licencjom opisanym w Licencji na treści. Java i OpenJDK są znakami towarowymi lub zastrzeżonymi znakami towarowymi należącymi do firmy Oracle lub jej podmiotów stowarzyszonych.
Ostatnia aktualizacja: 2022-11-07 UTC.