diff options
author | Julien Desprez <jdesprez@google.com> | 2018-06-06 03:00:28 -0700 |
---|---|---|
committer | Julien Desprez <jdesprez@google.com> | 2018-06-06 03:01:29 -0700 |
commit | f14adb8123c9d7aa8b88960c2042f5fc271b65bf (patch) | |
tree | 6e8e3a5b02838880eab615e75669049fec2a2e0b | |
parent | bdd77e05761541001646bbfdb89783a66d89b109 (diff) | |
download | contrib-f14adb8123c9d7aa8b88960c2042f5fc271b65bf.tar.gz |
Update Camera test interface to continue postingandroid-9.0.0_r47android-9.0.0_r46android-9.0.0_r45android-9.0.0_r44android-9.0.0_r43android-9.0.0_r42android-9.0.0_r41android-9.0.0_r40android-9.0.0_r39android-9.0.0_r38android-9.0.0_r37android-9.0.0_r36android-9.0.0_r35android-9.0.0_r34android-9.0.0_r33android-9.0.0_r32android-9.0.0_r31android-9.0.0_r30android-9.0.0_r22android-9.0.0_r21android-9.0.0_r20android-9.0.0_r19android-9.0.0_r16pie-qpr3-s1-releasepie-qpr3-releasepie-qpr3-b-releasepie-qpr2-releasepie-qpr1-s3-releasepie-qpr1-s2-releasepie-qpr1-s1-releasepie-qpr1-releasepie-dr1-devpie-devpie-b4s4-releasepie-b4s4-dev
Camerage tests have an odd way of reporting tests, fix the
interface so results go through.
Test: Url: http://sponge.corp.google.com/invocation?tab=Test+Cases&show=FAILED&show=INTERNAL_ERROR&id=0c490671-a48b-4146-b669-786abfbb725b
Bug: 109667929
Change-Id: I5b7ed73471710f2303861f00c519ff899336ff02
-rw-r--r-- | src/com/android/media/tests/Camera2FrameworkStressTest.java | 7 | ||||
-rw-r--r-- | src/com/android/media/tests/Camera2StressTest.java | 10 | ||||
-rw-r--r-- | src/com/android/media/tests/CameraTestBase.java | 7 |
3 files changed, 16 insertions, 8 deletions
diff --git a/src/com/android/media/tests/Camera2FrameworkStressTest.java b/src/com/android/media/tests/Camera2FrameworkStressTest.java index a6fb7ad..b275fe2 100644 --- a/src/com/android/media/tests/Camera2FrameworkStressTest.java +++ b/src/com/android/media/tests/Camera2FrameworkStressTest.java @@ -20,9 +20,11 @@ import com.android.tradefed.config.OptionClass; import com.android.tradefed.device.DeviceNotAvailableException; import com.android.tradefed.device.IFileEntry; import com.android.tradefed.log.LogUtil.CLog; +import com.android.tradefed.metrics.proto.MetricMeasurement.Metric; import com.android.tradefed.result.ITestInvocationListener; import com.android.tradefed.result.TestDescription; import com.android.tradefed.util.FileUtil; +import com.android.tradefed.util.proto.TfMetricProtoUtil; import java.io.BufferedReader; import java.io.File; @@ -90,14 +92,15 @@ public class Camera2FrameworkStressTest extends CameraTestBase { } @Override - public void testEnded(TestDescription test, long endTime, Map<String, String> testMetrics) { + public void testEnded( + TestDescription test, long endTime, HashMap<String, Metric> testMetrics) { if (hasTestRunFatalError()) { CLog.v("The instrumentation result not found. Fall back to get the metrics from a " + "log file. errorMsg: %s", getCollectingListener().getErrorMessage()); } // For stress test, parse the metrics from a log file. - testMetrics = parseLog(test.getTestName()); + testMetrics = TfMetricProtoUtil.upgradeConvert(parseLog(test.getTestName())); super.testEnded(test, endTime, testMetrics); } diff --git a/src/com/android/media/tests/Camera2StressTest.java b/src/com/android/media/tests/Camera2StressTest.java index b7e88b0..7b770fe 100644 --- a/src/com/android/media/tests/Camera2StressTest.java +++ b/src/com/android/media/tests/Camera2StressTest.java @@ -20,6 +20,7 @@ import com.android.tradefed.config.OptionClass; import com.android.tradefed.device.DeviceNotAvailableException; import com.android.tradefed.device.IFileEntry; import com.android.tradefed.log.LogUtil.CLog; +import com.android.tradefed.metrics.proto.MetricMeasurement.Metric; import com.android.tradefed.result.FileInputStreamSource; import com.android.tradefed.result.ITestInvocationListener; import com.android.tradefed.result.LogDataType; @@ -75,7 +76,8 @@ public class Camera2StressTest extends CameraTestBase { } @Override - public void testEnded(TestDescription test, long endTime, Map<String, String> testMetrics) { + public void testEnded( + TestDescription test, long endTime, HashMap<String, Metric> testMetrics) { if (hasTestRunFatalError()) { CLog.v("The instrumentation result not found. Fall back to get the metrics from a " + "log file. errorMsg: %s", getCollectingListener().getErrorMessage()); @@ -89,8 +91,10 @@ public class Camera2StressTest extends CameraTestBase { // add testMethod name to the metric Map<String, String> namedTestMetrics = new HashMap<>(); - for (Entry<String, String> entry : testMetrics.entrySet()) { - namedTestMetrics.put(test.getTestName() + entry.getKey(), entry.getValue()); + for (Entry<String, Metric> entry : testMetrics.entrySet()) { + namedTestMetrics.put( + test.getTestName() + entry.getKey(), + entry.getValue().getMeasurements().getSingleString()); } // parse the iterations metrics from the stress log files diff --git a/src/com/android/media/tests/CameraTestBase.java b/src/com/android/media/tests/CameraTestBase.java index f077bbb..8196fa5 100644 --- a/src/com/android/media/tests/CameraTestBase.java +++ b/src/com/android/media/tests/CameraTestBase.java @@ -282,11 +282,12 @@ public class CameraTestBase implements IDeviceTest, IRemoteTest, IConfigurationR * @param testMetrics a {@link Map} of the metrics emitted */ @Override - public void testEnded(TestDescription test, long endTime, Map<String, String> testMetrics) { + public void testEnded( + TestDescription test, long endTime, HashMap<String, Metric> testMetrics) { super.testEnded(test, endTime, testMetrics); - handleMetricsOnTestEnded(test, testMetrics); + handleMetricsOnTestEnded(test, TfMetricProtoUtil.compatibleConvert(testMetrics)); stopDumping(test); - mListener.testEnded(test, endTime, TfMetricProtoUtil.upgradeConvert(testMetrics)); + mListener.testEnded(test, endTime, testMetrics); } @Override |