Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(31)

Side by Side Diff: build/android/pylib/local/device/local_device_test_run_test.py

Issue 2032253004: [Android] Ensure test names are unique during retry determination. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixed Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « build/android/pylib/local/device/local_device_test_run.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright 2016 The Chromium Authors. All rights reserved. 2 # Copyright 2016 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 # pylint: disable=protected-access 6 # pylint: disable=protected-access
7 7
8 import unittest 8 import unittest
9 9
10 from pylib.base import base_test_result 10 from pylib.base import base_test_result
(...skipping 15 matching lines...) Expand all
26 26
27 class TestLocalDeviceNonStringTestRun( 27 class TestLocalDeviceNonStringTestRun(
28 local_device_test_run.LocalDeviceTestRun): 28 local_device_test_run.LocalDeviceTestRun):
29 29
30 # pylint: disable=abstract-method 30 # pylint: disable=abstract-method
31 31
32 def __init__(self): 32 def __init__(self):
33 super(TestLocalDeviceNonStringTestRun, self).__init__( 33 super(TestLocalDeviceNonStringTestRun, self).__init__(
34 mock.MagicMock(), mock.MagicMock()) 34 mock.MagicMock(), mock.MagicMock())
35 35
36 def _GetTestName(self, test): 36 def _GetUniqueTestName(self, test):
37 return test['name'] 37 return test['name']
38 38
39 39
40 class LocalDeviceTestRunTest(unittest.TestCase): 40 class LocalDeviceTestRunTest(unittest.TestCase):
41 41
42 def testGetTestsToRetry_allTestsPassed(self): 42 def testGetTestsToRetry_allTestsPassed(self):
43 results = [ 43 results = [
44 base_test_result.BaseTestResult( 44 base_test_result.BaseTestResult(
45 'Test1', base_test_result.ResultType.PASS), 45 'Test1', base_test_result.ResultType.PASS),
46 base_test_result.BaseTestResult( 46 base_test_result.BaseTestResult(
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 137
138 test_run = TestLocalDeviceNonStringTestRun() 138 test_run = TestLocalDeviceNonStringTestRun()
139 tests_to_retry = test_run._GetTestsToRetry(tests, try_results) 139 tests_to_retry = test_run._GetTestsToRetry(tests, try_results)
140 self.assertEquals(1, len(tests_to_retry)) 140 self.assertEquals(1, len(tests_to_retry))
141 self.assertIsInstance(tests_to_retry[0], dict) 141 self.assertIsInstance(tests_to_retry[0], dict)
142 self.assertEquals(tests[1], tests_to_retry[0]) 142 self.assertEquals(tests[1], tests_to_retry[0])
143 143
144 144
145 if __name__ == '__main__': 145 if __name__ == '__main__':
146 unittest.main(verbosity=2) 146 unittest.main(verbosity=2)
OLDNEW
« no previous file with comments | « build/android/pylib/local/device/local_device_test_run.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698