GranularRetriableTestWrapper.StartEndCollector

public class GranularRetriableTestWrapper.StartEndCollector
extends ResultAndLogForwarder

java.lang.Object
   ↳ com.android.tradefed.result.ResultForwarder
     ↳ com.android.tradefed.result.ResultAndLogForwarder
       ↳ com.android.tradefed.testtype.suite.GranularRetriableTestWrapper.StartEndCollector


Class helper to catch missing run start and end.

Summary

Fields

public TestDescription mCurrentTest

public boolean mRunEndedReported

public boolean mRunStartReported

public boolean mTestInProgress

Public methods

void testEnded(TestDescription test, long endTime, Map<String, String> testMetrics)
void testEnded(TestDescription test, long endTime, HashMap<String, MetricMeasurement.Metric> testMetrics)

Alternative to testEnded(TestDescription,Map) where we can specify the end time directly.

void testEnded(TestDescription test, Map<String, String> testMetrics)
void testEnded(TestDescription test, HashMap<String, MetricMeasurement.Metric> testMetrics)

Reports the execution end of an individual test case.

void testRunEnded(long elapsedTimeMillis, Map<String, String> runMetrics)
void testRunEnded(long elapsedTime, HashMap<String, MetricMeasurement.Metric> runMetrics)

Reports end of test run.

void testRunStarted(String runName, int testCount)

Reports the start of a test run.

void testRunStarted(String runName, int testCount, int attemptNumber, long startTime)

Reports the start of a test run.

void testRunStarted(String runName, int testCount, int attemptNumber)

Reports the start of a test run.

void testStarted(TestDescription test, long startTime)

Alternative to testStarted(TestDescription) where we also specify when the test was started, combined with testEnded(TestDescription,long,Map) for accurate measure.

void testStarted(TestDescription test)

Reports the start of an individual test case.

Fields

mCurrentTest

public TestDescription mCurrentTest

mRunEndedReported

public boolean mRunEndedReported

mRunStartReported

public boolean mRunStartReported

mTestInProgress

public boolean mTestInProgress

Public methods

testEnded

public void testEnded (TestDescription test, 
                long endTime, 
                Map<String, String> testMetrics)

Parameters
test TestDescription

endTime long

testMetrics Map

testEnded

public void testEnded (TestDescription test, 
                long endTime, 
                HashMap<String, MetricMeasurement.Metric> testMetrics)

Alternative to testEnded(TestDescription,Map) where we can specify the end time directly. Combine with testStarted(TestDescription,long) for accurate measure.

Parameters
test TestDescription: identifies the test

endTime long: the time the test ended, measured via System.currentTimeMillis()

testMetrics HashMap: a Map of the metrics emitted

testEnded

public void testEnded (TestDescription test, 
                Map<String, String> testMetrics)

Parameters
test TestDescription

testMetrics Map

testEnded

public void testEnded (TestDescription test, 
                HashMap<String, MetricMeasurement.Metric> testMetrics)

Reports the execution end of an individual test case.

If testFailed(TestDescription, FailureDescription) was not invoked, this test passed. Also returns any key/value metrics which may have been emitted during the test case's execution.

Parameters
test TestDescription: identifies the test

testMetrics HashMap: a Map of the metrics emitted

testRunEnded

public void testRunEnded (long elapsedTimeMillis, 
                Map<String, String> runMetrics)

Parameters
elapsedTimeMillis long

runMetrics Map

testRunEnded

public void testRunEnded (long elapsedTime, 
                HashMap<String, MetricMeasurement.Metric> runMetrics)

Reports end of test run. FIXME: We cannot have two Map<> interfaces with different type, so we have to use HashMap here.

Parameters
elapsedTime long: device reported elapsed time, in milliseconds

runMetrics HashMap: key-value pairs reported at the end of a test run with Metric.

testRunStarted

public void testRunStarted (String runName, 
                int testCount)

Reports the start of a test run.

Parameters
runName String: the test run name

testCount int: total number of tests in test run

testRunStarted

public void testRunStarted (String runName, 
                int testCount, 
                int attemptNumber, 
                long startTime)

Reports the start of a test run.

Parameters
runName String: the test run name

testCount int: total number of tests in test run

attemptNumber int: order number, identifying the different attempts of the same runName that run multiple times. The attemptNumber is 0-indexed and should increment everytime a new run happens. e.g. A test is granular retried 3 times, it should have 4 total runs under the same runName and the attemptNumber is from 0 to 3.

startTime long: the time the run started, measured via System.currentTimeMillis()

testRunStarted

public void testRunStarted (String runName, 
                int testCount, 
                int attemptNumber)

Reports the start of a test run.

Parameters
runName String: the test run name

testCount int: total number of tests in test run

attemptNumber int: order number, identifying the different attempts of the same runName that run multiple times. The attemptNumber is 0-indexed and should increment everytime a new run happens. e.g. A test is granular retried 3 times, it should have 4 total runs under the same runName and the attemptNumber is from 0 to 3.

testStarted

public void testStarted (TestDescription test, 
                long startTime)

Alternative to testStarted(TestDescription) where we also specify when the test was started, combined with testEnded(TestDescription,long,Map) for accurate measure.

Parameters
test TestDescription: identifies the test

startTime long: the time the test started, measured via System.currentTimeMillis()

testStarted

public void testStarted (TestDescription test)

Reports the start of an individual test case. Older interface, should use testStarted(TestDescription) whenever possible.

Parameters
test TestDescription: identifies the test